Question about arrays and character animations

0 favourites
  • 9 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Hi,

    If I wanted to make a character sprite's animation change during a dialogue scene and the dialogue is contained in an array, is there a quicker way to do this other than using separate "set animation" events?

  • Depends if you managed to run the dialogue in an efficient way from the array but if you are running through it in one event using loopindex then you could put the name of the animation used in an adjacent column and as you play the dialogue you can set the animation to the array.at() which would be one event.

  • Thanks lionz,

    I'm still new to this, what do I put in the "()" after array.at?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have all the dialogue at Y=0 column and the animation names at Y=1 column then the dialogue is array.at(loopindex,0) and the animation name is at array.at(loopindex,1) when in a for loop to run through the array. If it's slower than this you could put it in a function and replace loopindex with a parameter variable that increments and you add 1 to every time you call the function.

  • Thanks lionz.

    Could you provide a screenshot of the array setup? I probably putting the right things in the wrong places as I can get the dialogue to display but not cycle through.

  • Show me the logic you have for cycling through the dialogue, it kinda depends on this.

  • I've tried to recreate what I had yesterday, I didn't save as it wasn't working so I've almost certainly missed several things out.

  • This looks very confusing, I would have to make something from scratch when I have the time. The events don't really show how you run through the dialogue in the game, only how you are populating the array. The key event is how you are using the dialogue in the game then you can add the animation logic with it.

  • I know it's confusing. I don't really have the experience to get it working, so a small example would be very helpful if possible.

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