How do I make a local variable change a included event sheet

Get help using Construct 2

Post » Sat Jan 28, 2017 10:50 pm

This is a puzzle game.

I have multiple layouts for the same part of the game. "Layout Puzzle1, 2 ect..."
Each Puzzle layout is essentially the same minus a change in 3 different sprites. One a fully animated, very complicated (for me as a new game maker) sprite. I mean the sprite is simple enough but it gets manipulated thru the event sheet very heavily.

What I would "like" to do is create an event page for each Puzzle layout that uses all the events from the first sheet but lets me exchange one sprite for another.

Puzzle Event sheet 2
-------------------------------
Include:Puzzle Event sheet 1
but everytime sprite:apple appears in the sheet replace it with sprite:pear

Puzzle Event sheet 3
--------------------------------
Include:Puzzle Event sheet 1
but everytime sprite:apple appears in the sheet replace it with sprite:orange

ect...

I hope this makes sense. Is this possible thru a local variable? or something else that I am not thinking of?

Edited to add:
I have a really beautiful menu screen that lets you scroll thru the puzzles.

Maybe there would be a way to configure it from there? So when Button1 is pressed it loads a Universal Puzzle layout which uses the Puzzle event sheet but changes the sprite that is used?

or....is there a way to
OnTouch Button1 | set global variable to Apple | go to layout Universal Puzzle

the Universal Puzzle Layout would be linked to a Universal Puzzle Event Sheet
and that sheet would check
if global variable is set to Apple use event sheet apple
if global variable is set to Orange use event sheet orange
ect....

Not sure if it is even possible and if it isn't possible to use a variable to replace one sprite with another that leads me to ask, which is more resource heavy, a game with 15 additional Layouts (that are almost exactly identical?) or a game with 15 additional event sheets (that have the exact same events minus a change in sprite names?)
B
10
S
5
G
3
Posts: 2
Reputation: 2,333

Post » Sat Jan 28, 2017 11:42 pm

From what I understand of your description, it sounds like families might be useful for you. Put all your sprite variations into one family, and have your events refer to the family.
Mistakes were made.
B
52
S
26
G
110
Posts: 1,620
Reputation: 62,161

Post » Sat Jan 28, 2017 11:48 pm

Oh that is a thought. Haven't quite wrapped my head around families but that is because I am still using the free version and I don't believe you can use them yet. This is my first game with Construct and only the 2nd I have ever made. Wasn't planning on upgrading until I got closer to publishing it. Going to do some research on families. Might have to upgrade sooner.

Thank you for the thought.
Off to read more.
B
10
S
5
G
3
Posts: 2
Reputation: 2,333


Return to How do I....?

Who is online

Users browsing this forum: jbr190 and 33 guests