Disable Turn Script Inside of Turn Script

Kaejer
04 Jul 2020, 15:38

Hi there,

Is it possible to Disable the current Turn Script inside of itself? I keep trying different things, even external Turn Scripts that constantly disable Turn Scripts and they seem to keep going. I've confirmed for sure with the Debugger that there are many times where the player or Harvey has the flag "teleported" and Harvey will stop following, but as soon as that flag is removed he starts following again. The Turn Script is turned on by talking to Harvey.

if (not GetBoolean(Harvey, "teleported")) {
  if (not GetBoolean(player, "teleported")) {
MoveObjectHere (Harvey)
  }
  else {
    DisableTurnScript (Harvey Follows)
  }
}
else {
  DisableTurnScript (Harvey Follows)
}

mrangel
05 Jul 2020, 00:04

Are you sure there's not another script enavbling it again?

That looks valid; I can't give any more suggestions without looking at the game.


Kaejer
08 Jul 2020, 14:48

Currently the only way to begin the script is by speaking with Harvey.

There are multiple ways to get the "teleported" flags, which I confirm in the debugger happen and Harvey stops following, but when you lose that flag he starts to follow again even if I don't speak with him. During the time where he no longer follows, the turn script is still set as enabled = true.

I even tried having a turn script that's active 100% of the time that disabled the turn script "Harvey Follows" every turn and it doesn't disable it. The only thing I can think of is Turn Scripts reenable themselves in the background at the end unless something outside of transcripts turns them off.


mrangel
08 Jul 2020, 18:30

Can you share the game so I can take a look at it?


Kaejer
09 Jul 2020, 20:18

Unfortunately, I cannot because it has private information on it. I've just done a workaround where the location where the teleport lands has a script that disables the Turn Script before entering the room.