YesNoOk
avatar

Platform wall and unique helper ids? (Read 768 times)

Started by SaltAddict, March 21, 2017, 07:45:42 pm
Share this topic:
Platform wall and unique helper ids?
#1  March 21, 2017, 07:45:42 pm
  • avatar
  • ***
    • Portugal
Is it possible to give each helper an unique id automatically (so, something like id = something * something) and then detect it? Or detect a range of ids? I'm coding platforms for a fullgame. So far, I've managed to get basic platforms working. I'm also coding breakable walls. How can I make it so p1 can't go throught the wall, keeping in mind there will be multiple walls in a given stage? Also, how can I make it so the walls have platforms on top that also dissapear when the wall is broken? From my experience, numhelper(id) or helper(id) only work with the first instance of that helper created, so I can't just check distance to numhelper. How do I give each of the wall helpers a unique id and then detect it, without having to do it manually (i.e, give every single wall in the game a different id in the state controller and then add triggers for all of them. I would rather avoid doing this...). Can I also make it so a platform detects the nearest wall helper and dissapears along with it?
Last Edit: March 22, 2017, 05:05:23 pm by FastFlash
Re: Platform wall and unique helper ids?
#2  March 23, 2017, 07:14:41 am
  • ******
  • Legendary XIII
  • I am the eye of the storm to come!
    • New Zealand
    • network.mugenguild.com/cyanide/
Increment a variable every time you create the helper. Create them with

ID = var(whatever)

There are limitations around this as it makes it a little harder to count that helper type and although you can trigger to check on it based on the total value of the variable it gets messy if they can blow up or be lost while a helper with a higher value hasn't gone away.

Sadly there is no code that has a helper affect its parent for playerpush. it'll work for p2, mostly. But parent has to use its position in relation to the helper to decide whether the velocity should continue to apply.

This is all somewhat dependant on what you want to do. Platforms are best set up by allowing them to hit both players and using hitdefs and short custom states to assign what you want the player to do. Not coding for positions based on a helpers existence. Playerpush is still a bit awkward for wall helpers even if you do take this path.


In M.U.G.E.N there is no magic button

They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance.