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.

If event isn't being used?

Well, In my game I'm using a parallel process event that sees whetheer a button is being pressed.  Unfortunately, it recognizes this when events are being run, causing huge glitches in the game.

Is there a line that I can put in a conditional branch -> script that checks whether another event is being run before continuing the event?

Thanks in advance.
 
It's easier for people who haven't already made over 100 events, and there are five maps of those 100 events equalling 500 seperate instances of working the switch on and offf.

It'll take aaaaages to do.
 

e

Sponsor

I think this should do the trick :

Code:
def is_event_running?
  for event in $game_map.events.values
    return true if event.starting # The starting flag will be set to true if it is running
  end

   return false # No event running
end

Although this should theoretically work, I've tried it and it doesn't. At least, it doesn't seem to be, but I couldn't get events running at the same time. I suck at eventing :(
 

e

Sponsor

Well, as I said, it doesn't work, even though it SHOULD work. Technically, you'd fire up the Script Editor, and select the script Main.

Above the line which starts with "begin", you'd insert the method I pasted up there.

Then, in the event editor, you'd call the line :

Code:
is_event_running?

But as I said, I don't really know the event editor much, and I couldn't get it to work :(
 
I see your point.  I tried multiple variations of how to import it, and to no avail.  At one point, I got it to half-work, however the event which contained the script no longer worked, but the rest of the map worked fine. 

Hmm...
 

e

Sponsor

I've researched a bit into it, and man were we far from it!

The solution is a lot simpler than what we originally thought;

Basically, you could the same as before; just overwrite the script I pasted above for :

Code:
def events_running?
  return $game_system.map_interpreter.running?
end

Or, in your Conditional Branch > Script, you could simply put :

Code:
$game_system.map_interpreter.running?

Should work.
 

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