Welcome to the Builder Academy

Question Detaching triggers

More
25 Mar 2018 01:18 #7797 by Sascha
Detaching triggers was created by Sascha
I'm wondering if I'm doing something wrong with detaching triggers? The help file says this:
Code:
Detach removes a trigger to one instance of a mob/obj/room, for testing or other purposes. The command only removes the trigger temporarily, until the room/obj/mob is reloaded via reboot, zreset, load.

I have a room where after a condition is met, the trigger on the room detaches itself. That part works fine. But the trigger does not come back when the zone resets, either via the regular reset time or via zreset. The trigger only comes back if I go into redit for the room, hit S for script, and then quit out.

In this example, the trigger is in place:
Code:
[22016] Just Inside the Gate [ NO_MOB ] [ Field ][T 22099] A sprawling encampment stretches north to northeast from inside the gate that separates the camp from the forest outside. A barricade surrounds the camp as far as the eye can see, tall enough that it would give an Ogier pause before trying to climb it. To the south is a checkpoint in the barricade that has tall hinged gates that look scarred from years of use. [ Exits: n s ]

Now, the condition has been met and the trigger is detached:
Code:
[22016] Just Inside the Gate [ NO_MOB ] [ Field ] A sprawling encampment stretches north to northeast from inside the gate that separates the camp from the forest outside. A barricade surrounds the camp as far as the eye can see, tall enough that it would give an Ogier pause before trying to climb it. To the south is a checkpoint in the barricade that has tall hinged gates that look scarred from years of use. [ Exits: n s ]

But then at reset it does not come back:
Code:
510H 110M 92V > zpurge Purged zone #220: Zone 220 - Tutorial - Trolloc camp setting. [ (GC) Vivienne purged zone 220 (Zone 220 - Tutorial - Trolloc camp setting) ] 510H 110M 92V > The sun rises in the east. 510H 110M 92V > zreset Reset zone #220: Zone 220 - Tutorial - Trolloc camp setting. [ (GC) Vivienne reset zone 220 (Zone 220 - Tutorial - Trolloc camp setting) ] 510H 110M 92V > l [22016] Just Inside the Gate [ NO_MOB ] [ Field ] A sprawling encampment stretches north to northeast from inside the gate that separates the camp from the forest outside. A barricade surrounds the camp as far as the eye can see, tall enough that it would give an Ogier pause before trying to climb it. To the south is a checkpoint in the barricade that has tall hinged gates that look scarred from years of use. [ Exits: n s ] 510H 110M 92V >

And if I go into redit it does come back:

Code:
510H 110M 92V > redit -- Room number : [22016] Room zone: [220] 1) Name : Just Inside the Gate 2) Description : A sprawling encampment stretches north to northeast from inside the gate that separates the camp from the forest outside. A barricade surrounds the camp as far as the eye can see, tall enough that it would give an Ogier pause before trying to climb it. To the south is a checkpoint in the barricade that has tall hinged gates that look scarred from years of use. 3) Room flags : NO_MOB 4) Sector type : Field 5) Exit north : 22008 , B) Exit northwest : -1 6) Exit east : -1 , C) Exit northeast : -1 7) Exit south : 22023 , D) Exit southeast : -1 8) Exit west : -1 , E) Exit southwest : -1 9) Exit up : -1 A) Exit down : -1 F) Extra descriptions menu S) Script : Set. W) Copy Room X) Delete Room Q) Quit Enter choice : s Triggers Attached: 1) [22099] Boss battle to escape at room 22023 N) Attach trigger X) Detach trigger Q) Quit Enter choice : q -- Room number : [22016] Room zone: [220] 1) Name : Just Inside the Gate 2) Description : A sprawling encampment stretches north to northeast from inside the gate that separates the camp from the forest outside. A barricade surrounds the camp as far as the eye can see, tall enough that it would give an Ogier pause before trying to climb it. To the south is a checkpoint in the barricade that has tall hinged gates that look scarred from years of use. 3) Room flags : NO_MOB 4) Sector type : Field 5) Exit north : 22008 , B) Exit northwest : -1 6) Exit east : -1 , C) Exit northeast : -1 7) Exit south : 22023 , D) Exit southeast : -1 8) Exit west : -1 , E) Exit southwest : -1 9) Exit up : -1 A) Exit down : -1 F) Extra descriptions menu S) Script : Set. W) Copy Room X) Delete Room Q) Quit Enter choice : q Do you wish to save your changes? : y Room saved to disk. 510H 110M 92V > l [22016] Just Inside the Gate [ NO_MOB ] [ Field ][T 22099] A sprawling encampment stretches north to northeast from inside the gate that separates the camp from the forest outside. A barricade surrounds the camp as far as the eye can see, tall enough that it would give an Ogier pause before trying to climb it. To the south is a checkpoint in the barricade that has tall hinged gates that look scarred from years of use. [ Exits: n s ]

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

Please Log in or Create an account to join the conversation.

More
28 Mar 2018 22:32 #7824 by thomas
Replied by thomas on topic Detaching triggers
This might be a regression. It is supposed to reattach based on the configuration in the zone file.

What do you see in zedit in this room?

Please Log in or Create an account to join the conversation.

More
28 Mar 2018 23:44 #7826 by Sascha
Replied by Sascha on topic Detaching triggers
Hi Thomas,

This is what zedit shows for this room:

Room number: 22016 Room zone: 220
1) Builders : Vivienne
Z) Zone name : Zone 220 - Tutorial - Trolloc camp setting
L) Lifespan : 30 minutes
B) Bottom of zone : 22000
T) Top of zone : 22099
R) Reset Mode : Reset when no players are in zone.
F) Zone Flags : NOBITS
M) Level Range : <Not Set!>
[Command list]
0 - <END OF LIST>
N) Insert new command.
E) Edit a command.
D) Delete a command.
Q) Quit
Enter your choice :

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

Please Log in or Create an account to join the conversation.

More
29 Mar 2018 14:40 #7841 by thomas
Replied by thomas on topic Detaching triggers
I feared that was what you'd respond :)

We have two ways of attaching a trigger to a room.

Either, we attach through redit, like you do above, or through zedit, like this:
Code:
[Command list] 0 - Attach trigger name here... [12099] to room

And, set up like this, the trigger will reattach on zone reset - after all, the list in zedit is the basis for the zone reset code.

So, the next question, can we make the other trigger reset as well? Not as easily, no.
I think we might need to add the lines to the zone file when we edit a room trigger list, and vice versa.

The point here is that the list in redit shows a snapshot, so to speak, and the snapshot is saved/loaded on reboot. The zedit list shows a preferred state to return to on zone reset. Once we remove the script attached to the room, there is no record of it ever existing until the next time we load the world files (through redit or copyover).

The "correct" way of doing it would probably be to make redit save to the same list as in zedit, before existing commands for that room, and not save scripts directly on the room.

I've created an issue on github dealing with this: github.com/tbamud/tbamud/issues/47
The following user(s) said Thank You: Sascha

Please Log in or Create an account to join the conversation.

More
30 Mar 2018 00:14 #7850 by Sascha
Replied by Sascha on topic Detaching triggers
Meanwhile, with this explanation and by changing affected rooms, this now works as intended. I would not have figured this out with the help files... :) Thank you, Thomas!

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

Please Log in or Create an account to join the conversation.

More
03 Apr 2018 15:57 #7872 by Sascha
Replied by Sascha on topic Detaching triggers
The messy problem with this is that when attaching via zedit, the trigger attaches over and over and over again. The zone had been empty overnight and this morning there were twelve of the same triggers attached to the room. Does this hurt anything? I have no idea. Sure is spammy on the eyes, though.

Will you stand against the coming Storm? After the Breaking: STORMRIDERS MUD - atbmud.dune.net port 4000

Please Log in or Create an account to join the conversation.

Time to create page: 0.205 seconds