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.

Getting 'This Event' information for call script

Good day to everybody, I just have a small question. Within a game script, how would you get the "This Event" id for the event that called your script through a call script?

For instance, I know this probably works through call script...

Code:
Script: event = get_character(0)
Script: $game_player.do_something(event)

However, for the sake of user simplicity, how can I do that directly IN the script instead of having to write it in the call script?

So I can just type out...

Code:
$game_player.do_something

Seeing as the script is always looking for the active event.
 
The script is always called through a call script, and it will always be looking for the event that called it... and it needs that event's ID. Am I clear now?

It gives me "undefined method for Interpreter class 'get_character(0)" when I write it into the script, so I'm stuck having to write that line into a call script before I call my method.

event = get_character(0)
$game_player.do_something(event)


I want to get rid of the need for the extra line before my method call and have it done from within the script, so I can just simply use...

$game_player.do_something
 

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