Check Instance Variable for Each Unique Item???

Get help using Construct 2

Post » Tue Mar 11, 2014 8:50 pm

Hello, I need a suggestion on this

I was planning to make a function which would change the animation/state of the sprite depending on an instance variable specified. Also it should still be saved when I leave the layout.

For example

If the instance variable of the sprite is 1, then its visible. On the other hand if it's 0 then it's not. Then there are many instances of the object on the layout.

Is there any way to do that, while saving everything when I leave the layout? Oh and also, a variable from another layout changes the state of the object in the previous.
B
8
Posts: 35
Reputation: 388

Post » Thu Mar 13, 2014 3:18 am

I don't understand why you need a function. If the player can move between layouts, the sprites values remain the same. Like an RPG where the player moves between rooms. What ever set of conditions you use to change their variable, the variable remain the same, when returning to the layout. Make sure the sprites are set to global in the properties.
However once the layout is changed, you'll be operating from a different event sheet. You can't effect the variables because they are not global. So use a single event sheet for both layouts.
Make sure you "Groups" to nest your code in. This way you can disable or enable a group to avoid conflicts, depending which layout the Player is on.

Hope that helps.



http://www.neoprofessor.com

http://www.nakedgametalk.com
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests