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.

[Resolved] Is it possible to call events in code?

Status
Not open for further replies.

Dko

Member

I want to be able to call the 'Show chioces' event before I even get to the main menu of the game so I can easily make a choice there in my code with out having to making a whole new command window(which I don't understand yet 100% any way). Is this possible? Or do something similar thats fairly simple to do?
 
Of course this is possible. You need to create an Interpreter-Object and then set this object to execute your event.

Code:
# If it is not already constructed you need to create the $game_temp-object, as the interpreter needs this when running
$game_Temp = Game_temp.new
myInterpreter = Interpreter.new
# Setup a commen event (Here with the id 1 you can change this number to whatever the id of the event, you want to be executed, is)
myInterpreter.setup($data_common_events[1], 0)
# Run the interpreter
myInterpreter.update
 
Status
Not open for further replies.

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