schleicher on 11/10/2015 at 16:15
Hi
I have the problem, that, as example, a door has to set a goal as fulfilled, if I opened that door the first time.
But everytime, when I open/close the door, the goal-state toggles between 1 and 0. Even worse: I have more
doors, that all have to set the same goal_state to 1. I open door 1: goal_state is 1. I open door 2: goal_state
flips back to 0.
As example for this goal: "Enter area". Since I entered that area, the goal_state have to stay at 1.
My setup:
Door:
-------
Script: StdLever
Locked-Ability: Set to true
A Controldevice, that is linked to an QuestVarTrap.
All doors have that setup and are linked to the same QuestVarTrap.
QuestVarTrap:
----------------
Its QuestVar is set in this way: =1:goal_state_2
How can it be, that this command toggles ? My understanding is actually,
that it is not important, how often that command is called: set goal_state_2 to 1
should everytime have the same effect ?!
If this is not avoidable: Can I switch that QuestVarTrap to inactive? Or delete/destroy
it after it is called the first time ? If this "central goal-trigger" is gone, it should no
longer affect the goal_state of all doors, that are linked to it.
fibanocci on 11/10/2015 at 16:30
There's a irreversible flag. TOW will set it.
You can also destroy your trigger after completion or set Script--> trap control flags to once, no off .
schleicher on 11/10/2015 at 17:27
Quote Posted by fibanocci
There's a irreversible flag. TOW will set it.
I tried quest_create_mis goal_irreversible_2, 1
But this had no effect !
Quote:
You can also destroy your trigger after completion or set Script--> trap control flags to once, no off .
This works (trap control flags), Thank you.
But just for understanding: Is my idea wrong, that set a value should everytime has the same effect, instead of toggle
the value ? Is this a DromEd-Glitch or is there a reason for that ?
Yandros on 12/10/2015 at 01:38
1. You should use the TrigDoorOpen script on the door instead of StdLever. If you aren't already aware of (
http://thiefmissions.com/telliamed/scripts.html) this link, you should bookmark it as a great resource for all the LGS scripts in gen and convict.
2. The _irreversible flag won't work on an objective you're managing manually, meaning using a QVTrap to set it. It will only work with standard goal types managed via the VictoryCheck script (which should be on your starting point), like goto room objectives (which is typically how it is used, so that such a goal doesn't uncheck when the player leaves a target room).
3. The reason the state of the objective is being toggled is because the StdLever script (and the TrigDoorOpen script if you switch to it) send alternating TurnOn and TurnOff signals to the QVTrap. It's just responding to them as designed. So the solution, as you found, is to use TrapControlFlags or to destroy the QVTrap once it's triggered - the flags are more elegant and robust, though. I use RelayTraps with Once, NoOff set in the flags so often that I have an archetype for it under RelayTrap. (Mine actually use NVRelayTrap, but that's neither here nor there.)
schleicher on 12/10/2015 at 15:47
Thank you, for explaining this. The script-list I've found some days ago. Though there is much to learn :-)