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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Mon Mar 18, 2002 9:40 pm   

trigger/button help
 
alright here is my settings as now..

#CLASS {Dead}
#TRIGGER {You wave your hands over the corpse and whisper 'psssshhhh'.} {#UNBUTTON 1 {Preserve Corpse} {cast preserve corpse at corpse} {} {} {} {} {} {Size} {91} {23} {} {} {} {} {} {} {} "" {} {} {}}
#TRIGGER {You get a (*)gold(*).} {#UNBUTTON 3 {Get Gold} {get gold} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}}
#TRIGGER {You chant the words 'Gravis pluma!'} {#UNBUTTON 2 {Feather Weight} {cast feather weight at corpse} {} {} {} {} {} {Size} {85} {23} {} {} {} {} {} {} {} "" {} {} {}}
#TRIGGER {R.I.P} {#BUTTON 1 {Preserve Corpse} {cast preserve corpse at corpse} {} {} {} {} {} {Size} {91} {23} {} {} {} {} {} {} {} "" {} {} {};#BUTTON 2 {Feather Weight} {cast feather weight at corpse} {} {} {} {} {} {Size} {85} {23} {} {} {} {} {} {} {} "" {} {} {};#BUTTON 3 {Get Gold} {get gold} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}}
#TRIGGER {You get a (*)corpse of (*)~(embalmed~)(*).} {#UNBUTTON 2 {Feather Weight} {cast feather weight at corpse} {} {} {} {} {} {Size} {85} {23} {} {} {} {} {} {} {} "" {} {} {}}
#CLASS 0

here is my problem...

Your swing thuds against Child doing negligible damage.
Child staggers and falls to the ground.
Child is DEAD, R.I.P.
Hp: 246/302 Sp: 188/435 Ep: 65/115
You are done concentrating on your spell.
You chant the words 'Telum mortis!'
You unleash a multi-tendrilled bolt of black lightning at Child!
Child is obliterated!
Hp: 246/302 Sp: 88/435 Ep: 65/115
Child staggers and falls to the ground.
Child is DEAD, R.I.P.

now if you look at the code you will see that when the R.I.P line comes up the three buttons will appear.. the problem is sometimes there is multiple targets with the same name and my weapon kills one and then the spell kills the next and that causes the triggers to fire twice putting up a double of each button. Now I could just eliminate this problem with better targetting I.e. cast death bolt at child 1
but where is the fun in that :) What I want is actually for the buttons to count how many R.I.P they get.. the get gold button I want to appear once and dissappear after its been pushed.. the other two I want to have do a count of the R.I.P and stay visible till all corpses have successfully been preserved and featherweighted(if feather weighting is needed)..If no feather weight is needed it clears the counter and the button vanishes when I pick up the corpses as shown in the trigger above.

So example I kill 2 children in the same fashion.. one set of buttons appears.
I press "Preserve corpse" it outputs "cast preserve corpse at corpse 1" if successful the next time I press it it outputs "cast preserve corpse at corpse 2"
the same with featherweight.
Get Gold only works after preserve corpse and is a one time button.

If I havent totally lost anyone with this and they know how to pull this off I would be appreciative to find out.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Mar 19, 2002 12:48 am   
 
The buttons aren't going to push themselves, so why don't you just install them permanently?

LightBulb
All scripts untested unless otherwise noted
Reply with quote
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Tue Mar 19, 2002 1:40 am   
 
A: No kidding the buttons don't push themselves.
B: I am running on a small monitor to begin with. I have other buttons that are set permanent and I dont need space occupied by buttons that are only needed for a short time.
C: Even if the buttons were there permanent I would like them to be able to do the r.i.p count and target corpse 1 then corpse 2 on each consecutive push.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Mar 19, 2002 2:27 am   
 
#CLASS {Dead}
#VAR CorpseCount {0}
#VAR CorpsePreserve {0}
#VAR CorpseGrab {0}
#TRIGGER {You wave your hands over the corpse and whisper 'psssshhhh'.} {#ADD CorpsePreserve 1;#IF(@CorpsePreserve=@CorpseCount) {#UNBUTTON 1;CorpsePreserve=0}}
#TRIGGER {You get a (*)gold(*).} {#UNBUTTON 3;CorpseCount=0}
#TRIGGER {You chant the words 'Gravis pluma!'} {#ADD CorpseGrab 1;#IF (@CorpseGrab=@CorpseCount) {#UNBUTTON 2}}
#TRIGGER {R.I.P} {#ADD CorpseCount 1;#IF (CorpseCount=1) {#BUTTON 1 {Preserve Corpse:%eval(@CorpseCount-@CorpsePreserve)} {cast preserve corpse at corpse %if(@CorpseCount>1,%eval(@CorpsePreserve+1))} {} {} {} {} {} {Size} {91} {23} {} {} {} {} {} {} {} "" {} {} {};#BUTTON 2 {Feather Weight:%eval(@CorpseCount-@CorpseGrab)} {cast feather weight at corpse %if(@CorpseCount>1,%eval(@CorpseGrab+1))} {} {} {} {} {} {Size} {85} {23} {} {} {} {} {} {} {} "" {} {} {};#BUTTON 3 {Get Gold} {get gold} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}})
#TRIGGER {You get a (*)corpse of (*)~(embalmed~)(*).} {#ADD CorpseGrab 1;#IF (@CorpseGrab=@CorpseCount) {#UNBUTTON 2}}
#CLASS 0

That should about cover it. If you want you could make the buttons push themselves too. The BUTTON command can do that.
Reply with quote
Solaras
Wanderer


Joined: 11 Mar 2002
Posts: 93

PostPosted: Tue Mar 19, 2002 5:00 am   
 
Thanks Vijilante for the help. It works great. There is one small problem with it and I think I can see what you tried to do but not how to fix it.. when the button is created it has the number of corpses in it example: "Preserve Corpse:2" Well the button comes up fine for both preserve and feather weight but the counter always sits on 1. At least I think thats what you were trying to do.. Its been a long week and its only Monday..
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Mar 19, 2002 3:57 pm   
 
Okay, you've got a good reason for using temporary buttons. Another suggestion: since "get gold" is only used after a successful "preserve corpse" do you really need a button for that? Couldn't you just add it to the successful "preserve corpse" (or "featherweight") trigger?

Vijilante used the same variable (@CorpseCount) in all three unbutton triggers. The unbutton trigger for Button 3 (get gold) sets it to zero. This means you need to wait until all corpses have been preserved and featherweighted before getting gold. If you need to "get gold" more than once, you'll need to change the trigger so it decrements the counter instead of zeroing it and doesn't unbutton until the count reaches zero.

Vijilante's unbutton trigger for button 2 didn't zero its counter. It should probably be:
#TRIGGER {You chant the words 'Gravis pluma!'} {#ADD CorpseGrab 1;#IF (@CorpseGrab=@CorpseCount) {#UNBUTTON 2;CorpseGrab=0}}

His R.I.P. trigger's #IF statement doesn't reference the variable properly in the condition field. It should probably be:
#TRIGGER {R.I.P} {#ADD CorpseCount 1;#IF (@CorpseCount=1) {#BUTTON 1 {Preserve Corpse:%eval(@CorpseCount-@CorpsePreserve)} {cast preserve corpse at corpse %if(@CorpseCount>1,%eval(@CorpsePreserve+1))} {} {} {} {} {} {Size} {91} {23} {} {} {} {} {} {} {} "" {} {} {};#BUTTON 2 {Feather Weight:%eval(@CorpseCount-@CorpseGrab)} {cast feather weight at corpse %if(@CorpseCount>1,%eval(@CorpseGrab+1))} {} {} {} {} {} {Size} {85} {23} {} {} {} {} {} {} {} "" {} {} {};#BUTTON 3 {Get Gold} {get gold} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} "" {} {} {}})



LightBulb
All scripts untested unless otherwise noted
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Mar 20, 2002 2:13 am   
 
Bloody typos, good thing Lightbulb is right on for those 2.

I believe the counter isn't working because the eval is being expanded when the buttons are created. I failed to take that into account. Simply adding a ~ in front of the %eval should take care of that, if not then you will have to encapsulate the entire %eval(@x-@y) in quotes.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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