How do I create the same event for multiple players

0 favourites
  • 6 posts
From the Asset Store
Very simple code without excess options (15 events for server and 11 events for client)
  • Hi,

    I am not sure if this is possible or not, but just wondering if anyone would know of a way to create one set of events for different characters/ players.

    Explanation: So I am creating a game that the player can select up to 4 different characters all with their own animations (Same names, Same frame numbers etc) and when the layout starts the chosen character is created and pinned to the single bg object. I.E. same for each one. I would like to have more, but my current approach makes it very tedious and painful, especially if there is an error in an event.

    So the problem is that I seem to have to write the same event 4 times depending on the character chosen.

    So if they choose a ninja, then I have to write ninja events for all the animations depending on the action and so on for each other character, which produces 4 events for the same action.

    I.E.

    If character = ninjaboy and right arrow pressed set ninjaboy animation running etc etc

    If character = ninjagirl and right arrow pressed set ninjagirl animation running etc etc

    If character = soldierboy and right arrow pressed set soldierboy animation running etc etc

    etc.

    I also have spriter pro in which I can map character parts on the fly using the same animation, so not sure if something similar can be done here or maybe there is a different way.

    I could probably add all the animations of all the characters into a single sprite, then select the animation depending on the character, but when I have 9 animations per character I have to add 36 validations which is the same as having separate characters with their own animations.

    Perhaps a search and replace on highlighted events would make things easier so I could create all the events for one character, copy / paste then replace? Enhancment

    Thanks,

    Paul

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could make all of the characters the same sprite and have different animation sets for each character.

  • Hi BriggyBros,

    Thanks for the quick answer. Yes I think this is the only way I can see of doing it. I guess once in place and there is a problem with the event the fix will be quicker than doing multiple events.

    Cheers,

  • You can also use family's for this https://www.scirra.com/manual/142/families

  • Yes I have tried families previously on a different game but had mixed success. I might take another look at this again. Thanks

  • If your sprites have many animations families would be better. I only really use the frame method for static objects.

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