How do I pick an instence of an object?

0 favourites
  • 4 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • So basically I have an object that holds different characters per frame, each character (frame) has its own stats that takes them for an array.

    Also each character(frame) comes with 4 skills.

    I made the skills like the characters, 1 object with multiple frames and each frame comes with a value that take from an array.

    Now here's the problem I encountered.

    The game is turn based so since there's 1 object with multiple frames that act as different characters I need to define that now it's object#0 turn then when he finishes there's the object#1 that needs to act and I don't really understand how can I do that.

    Now let's say that making 2 more duplicates of the same object is an option and that it won't affect preformance, I still need to pick the skill instance to get the specific value I need.

    I don't really wanna fill the game with duplicates or make all the skills 1 by 1, not just for preformance reasons but also for learning purposes!

    I hope I was clear with what I am asking here.

    Thanks in advance!!!

  • Starting out I'd suggest using instance variables.

    Click the object add a variable in preferences to the left.

    You can then click different instances in the editor to change the instances variable, or set the variable when the instance is created.

    To pick the specific instance you use the compare instance variable in the conditions of the object.

    Going forward there many many different ways to pick instances, with things like frame, opacity, and even using the system to "pick nth".

    Do the getting started tuts. Seriously.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I would like to apologise since English is not my native language and I didn't explain my issue properly.i am not looking to pick an instence variable. Let me please explain, I have in a layer 1 object 3 times, I was able to set in each on of those separate values for their instance variables what I am looking for is let's say how do I say to the engine that when I press the object with iid 2 to do this and when I press the object with iid 4 do something else

  • Comparing the variable picks the instance its associated with.

    Again do the tutorials.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)