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.

call script for variables

how would I go about using the call script to add 1 to a the variable with the same [id] as the event it is located in?

example:

*****************************
event :01

call script- add 1 to variable[event_id]
*****************************


and what would happen is the variable with the id ==[01] would have 1 added to it.

Using the same call script again...

*****************************
event: 36

Call script- Add 1 to variable[event_id]
*****************************


would add 1 to the variable with the id==[36]

The application of this would be for a farming type system.
I would want a common event that essentially says.
When you interact with a plant, it will add 1 to the variable with the same id as the event the common event was called from.

thanks in advance!
 

arev

Sponsor

Oh yeah? :D And what is @event_id in the Interpreter? :p

get_character(0) means as much as "this event", and always refers to the event it's been called from (via "Script" command ofcourse). The code you asked is proper.
 

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