Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Need to disable player touch while a move route completes

I'm working on a scene where the player can chase a butterfly. The butterfly has a touch event that sets off a move route. When the butterfly gets to the end of his move route, he waits for the player to touch him again, and then he does the next move route.

It's all working correctly using variables as long as I touch the butterfly once, then let the move route play out. If I touch the butterfly during the move route, though, it restarts the current move route.

I tried using Wait for Move's Completion, but that held the player while the butterfly moved. I also tried moving the variable increment to right at the start of the move route... but then touching the butterfly just skips to the next move route instead of repeating the current one.

Is there any way to disable the player touch until the move route is done, then re-enable it?

Thanks!
 
Well, ultimately you're "chasing" the butterfly to a fixed location, which triggers a cutscene. So what I'm trying to do is get the butterfly to lead you there by stopping occasionally.
 

Jason

Awesome Bro

Hmm this may be a bit extreme, but if you want to be able to move around while the butterfly is moving...

Make the event have two pages, on the first page, make it be "Player Touch", and in the event box, turn Self Switch A on...

Now, on the second page, make it's conditions be "Self Switch A is ON", make it be parallel process, and insert the move route.

At the end of the move route, turn Self Switch A off.

If you're not bothered about moving as the butterfly is moving, just add a "Wait for moves completion" command after the move route, if that doesn't work, just try a Wait command.

Hope this helps.
 
yeah, you definately wanna have the move routes being on a seperate event page than the player touch that activates it.

to further clarify what I think jbrist was saying, you basically want to have your Player Touch page do nothing more that activate a self-switch. That self switch goes to page 2 that has the move route. After the move route completes, it should increase a variable by 1 and then switch itself off so that the butterfly no longer moves and instead, waits to be touched again.

Now that would cover the first movement... I wanted to make sure that part was understood before handling the fact that the butterfly moves multiple times. Page 2 doesn't just have a move route on it, but instead a Conditional Branch.

If (whatever variable you designate for this) is 0 (default), it excutes the first move route. If it's 1 (so after the first increased it by 1), it'll excute the next and so on for however many times it's supposed to move.

Does that make sense?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top