Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
iosman
Beginner


Joined: 06 May 2019
Posts: 10

PostPosted: Sat Aug 03, 2019 1:35 pm   

Trigger not clearing vars before next trigger fills them
 
Hello,

I have not been able to reproduce this in a shorter, contrived script. This is an old script of mine.. I think I've been using it since zmud 5.55 days. These days I would probably write something like this differently, but the old adage about not fixing unbroken things takes precedent. I was surprised though, when it wouldn't work in CMUD.


PostPosted: Sun Jul 08, 2007 1:04 am

[1.34] Trigger not clearing vars before next trigger fills them

I have not been able to reproduce this in a shorter, contrived script. This is an old script of mine.. I think I've been using it since zmud 5.55 days. These days I would probably write something like this differently, but the old adage about not fixing unbroken things takes precedent. I was surprised though, when it wouldn't work in CMUD.


Quote:
#TR {{A|An} (%w) tattoo on the (%w) (%w).} {#ADDITEM %2%3tatts %1}
#TR {{A|An} (%w) tattoo on the (%w).} {#ADDITEM %2tatts %1
#CO 12 //this is just for purpose of testing
#sh head: @headtatts torso: @torsotatts //also for testing}

#AL tatl {#SAY %cr
#SAY You have these tattoos:
#SAY Head: %replace(@headtatts, "|", " & ")
#SAY Torso: %replace(@torsotatts,"|"," & ")
#SAY Left Arm: %replace(@leftarmtatts, "|", " & ")
#SAY Right Arm: %replace(@rightarmtatts, "|", " & ")
#SAY Left Leg: %replace(@leftlegtatts, "|", " & ")
#SAY Right Leg: %replace(@rightlegtatts, "|", " & ")}

#TR {You have the following tattoos:} {#SH --- Clearing Tatts ---
headtatts=%null
torsotatts=%null
leftarmtatts=%null
rightarmtatts=%null
leftlegtatts=%null
rightlegtatts=%null}


I type "tattoos", the stringlist should be populated by the triggers, and "tatl" shows me a summary of what I have.
Quote:
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]tattoos

You have the following tattoos:
A brazier tattoo on the head. (50 uses left)
A tentacle tattoo on the right arm. (24 uses left)
A prism tattoo on the right arm. (5 uses left)
A web tattoo on the right leg. (44 uses left)
A moss tattoo on the left leg.
A tree tattoo on the torso. (35 uses left)
A bell tattoo on the head. (37 uses left)
A boar tattoo on the left arm.
A cloak tattoo on the torso. (29 uses left)
A shield tattoo on the left arm. (45 uses left)
A moon tattoo on the left leg.
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]
--- Clearing Tatts ---
head: brazier torso:
head: brazier torso: tree
head: brazier|bell torso: tree
head: brazier|bell torso: tree|cloak

The deepening dusk yields to impenetrable darkness as night claims the land.
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]

You have these tattoos:
Head:
Torso:
Left Arm:
Right Arm:
Left Leg:
Right Leg:

You can see above that the trigs are all firing, and even the string lists being systematically filled correctly. Yet they are apparently also being cleared afterwards.

If I modify one of the triggers slightly, to:

Quote:
#TR {You have the following tattoos:} {headtatts=%null
torsotatts=%null
leftarmtatts=%null
rightarmtatts=%null
leftlegtatts=%null
rightlegtatts=%null
#SH --- Clearing Tatts ---}

Just to make the change clear, I moved the #show command from line 1 to the bottom. Now, the output changes when I enter "tattoos" and then "tatl".

Quote:
tattoos

You have the following tattoos:
A brazier tattoo on the head. (50 uses left)
A tentacle tattoo on the right arm. (24 uses left)
A prism tattoo on the right arm. (5 uses left)
A web tattoo on the right leg. (44 uses left)
A moss tattoo on the left leg.
A tree tattoo on the torso. (35 uses left)
A bell tattoo on the head. (37 uses left)
A boar tattoo on the left arm.
A cloak tattoo on the torso. (29 uses left)
A shield tattoo on the left arm. (45 uses left)
A moon tattoo on the left leg.
H:3223 M:3934 E:13830 W:18570 B:100% [eb lr]
--- Clearing Tatts ---
head: brazier torso:
head: brazier torso: tree
head: brazier|bell torso: tree
head: brazier|bell torso: tree|cloak


You have these tattoos:
Head: brazier & bell
Torso: tree & cloak
Left Arm: boar & shield
Right Arm: tentacle & prism
Left Leg: moss & moon
Right Leg: web


I'm not sure why, but placing a #sh command at the end of the trig forces it to be completed, almost like the old #priority? I have tried to duplicate this with a contrived and simplistic script, but cannot. Thoughts?


thanks,
iosman


Last edited by iosman on Fri Aug 09, 2019 1:58 pm; edited 1 time in total
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4671
Location: Pensacola, FL, USA

PostPosted: Tue Aug 06, 2019 9:38 am   
 
Honestly, looking at this, I can't see any glaring issues.
Its sounds more like a possible corruption issue.

You can either try exporting to XML, and recreate your package from that.
Or just recreate it from scratch using the newer methods you have learned over the years.
Seems it seems to be broken now, that old adage doesn't really apply.
_________________
Discord: Shalimarwildcat
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net