Is there a command that terminates all running scripts?
From what I understand, "Exit Script" exits only the script it is imbedded in. I want to kill every script that is currently running.
Terminate All Scripts
Moderators: marionline, SDHawk
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
There isn't.
I was planning to add such a command when script multitasking is added. (I would want to consider how that interacts with script fibres before adding it.)
Could you describe what you want to use it for? Do you only want to exit the current script, and the one that called that one, and so on? Or do you also want to terminate independent scripts which are currently suspended (ie. those that were triggered separately)?
I was planning to add such a command when script multitasking is added. (I would want to consider how that interacts with script fibres before adding it.)
Could you describe what you want to use it for? Do you only want to exit the current script, and the one that called that one, and so on? Or do you also want to terminate independent scripts which are currently suspended (ie. those that were triggered separately)?
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
I have a script that occurs when the hero dies in battle. At the end of that script, I wanted to terminate all scripts in order to stop any suspended scripts that are running as part of the map, or as running on-step triggered NPCs.TMC wrote:Could you describe what you want to use it for? Do you only want to exit the current script, and the one that called that one, and so on? Or do you also want to terminate independent scripts which are currently suspended (ie. those that were triggered separately)?
I think I figured out a solution, but it brings up a question. If the hero steps on an on-step NPC (triggering a script) and has a random encounter (triggering another instead-of-encounter script), which script starts first?
In that case the instead-of-battle script gets to run first, and the NPC script runs after it finishes. I think I never got around to documenting the precedence order.
I can certainly add a script command to exit all scripts if needed. It should be pretty simple.
I just have to wonder whether it's the best solution for other people with the same problem: it seems that in general one would want a way to stop a whole set of scripts (eg. associated with a particular map) including ones that have been triggered but not started yet. Are you leaving the map when you lose a battle? It sounds like this could be accomplished with a planned feature, map-tied and npc-tied scripts.
I can certainly add a script command to exit all scripts if needed. It should be pretty simple.
I just have to wonder whether it's the best solution for other people with the same problem: it seems that in general one would want a way to stop a whole set of scripts (eg. associated with a particular map) including ones that have been triggered but not started yet. Are you leaving the map when you lose a battle? It sounds like this could be accomplished with a planned feature, map-tied and npc-tied scripts.
Last edited by TMC on Tue Jun 16, 2015 5:04 am, edited 3 times in total.
- Willy Elektrix
- Liquid Metal Slime
- Posts: 910
- Joined: Sun Aug 15, 2010 11:30 pm
The hero does leave the map when they die in battle. They are sent back to the beginning of the dungeon (another map).TMC wrote:I just have to wonder whether it's the best solution for other people with the same problem: it seems that in general one would want a way to stop a whole set of scripts (eg. associated with a particular map) including ones that have been triggered but not started yet. Are you leaving the map when you lose a battle? It sounds like this could be accomplished with a planned feature, map-tied and npc-tied scripts.
Last edited by Willy Elektrix on Thu Jun 18, 2015 12:49 am, edited 1 time in total.