Running scripts without players input

Local_Redditor
25 Sept 2021, 14:34

I created a turn script that changes an objects alias whenever the flag is set. Although it works, it only updates when the player makes a move themselves and not if the game moves the player. Is there something that can do something like that, without the players input?


mrangel
25 Sept 2021, 16:03

Turnscripts run when the player enters a command.

If you want to run a script when the player moves, use the roomenter script on the game's "Scripts" tab.

If you want to run a script when a flag is set, you might want a changescript.


Local_Redditor
26 Sept 2021, 04:15

how can I use changescripts on a flag?


mrangel
26 Sept 2021, 06:44

If you have a flag called foo then a script attribute called changedfoo will be run whenever it changes. You can use that script to do whatever you want; although normally you'll want to start with an if statement checking if the flag was turned on or off.


Local_Redditor
26 Sept 2021, 12:16

I tried both, dunno if I tried them properly, but it doesn't seem like what I wanted, though it was close. I kinda want something that would constantly update it, without the player putting any input. Will timers help with that?