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.

Event caller?

Go to the event commands and go to the last page. It's the last item in the last column. Type in whatever script you have in the box that comes up.


Or do you mean how do you find which event called the script? In that case, I think the easiest way would be to use a variable to pass the event ID to the script.
 
Dark Zero said:
Go to the event commands and go to the last page. It's the last item in the last column. Type in whatever script you have in the box that comes up.


Or do you mean how do you find which event called the script? In that case, I think the easiest way would be to use a variable to pass the event ID to the script.

Thanx for the tut. No i mean, how to find Wich event called the script. Like if i had a class it would look mayby like this:
class Someclass
def initialize
@trigger_that_called_this_method=??????
end
end

So the event look like the tut you showed. In the command section of the trigger:
Someclass.new

There must be a way whitout using arguments to find out the event that called the method...or am i wrong?
 
frankie2000 said:
Thanx for the tut. No i mean, how to find Wich event called the script. Like if i had a class it would look mayby like this:
class Someclass
def initialize
@trigger_that_called_this_method=??????
end
end

So the event look like the tut you showed. In the command section of the trigger:
Someclass.new

There must be a way whitout using arguments to find out the event that called the method...or am i wrong?
i'm not really sure if this is what you want

you need to be in the Interpreter class for this, add this.
the interpreter handles all event commands.
Code:
class Interpreter
  def event
     return $game_map.events[@event_id]
  end
end
this will retrieve the current event if i'm not mistaken
i never messed with the interpretter class before so i dont have a clue how to call it.
 
Freakboy said:
i'm not really sure if this is what you want

you need to be in the Interpreter class for this, add this.
the interpreter handles all event commands.
Code:
class Interpreter
  def event
     return $game_map.events[@event_id]
  end
end
this will retrieve the current event if i'm not mistaken
i never messed with the interpretter class before so i dont have a clue how to call it.

I haven´t messed around with it either. Mayby somone else knows how to do this?

Or another way to get the event.
 

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