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
Murph
Newbie


Joined: 04 Dec 2005
Posts: 5

PostPosted: Sun Dec 04, 2005 9:37 pm   

Easier way to do spell watching tiggers?
 
Hello!

I have triggers that keep my staus bar update with which spells i have on me.

For each spell, i have a trigger for when it's casted on me "You can suddenly see invisible stuff" that does a #VAR SeeInvis on and a "Suddenly... you can't see invisible stuff" that does a #VAR SeeInvis off

Is there a more efficient way to do this with like.. lists or anything?

--Murph
Reply with quote
Guinn
Wizard


Joined: 03 Mar 2001
Posts: 1127
Location: London

PostPosted: Sun Dec 04, 2005 11:35 pm   
 
I'm not sure if this would end up any better (and don't have zMud installed to test it) but you could try using a single variable to store all the effects.

So for 'You can suddenly see invisible stuff', effects.seeInvis = 1
For 'You can suddenly see really big things', effects.seeReallyBig = 1

Then you'd want to use #LOOPDB to go through all the values (%val) in each record (%key) in the variable and display them in the status bar if the value = 1.

Might be someone can provide some working code to get you started.

Something like
#LOOPDB @effects {#IF (%val = 1) {#show %key %cr}}

Which (hopefully) would go through each value in @effects and display the matching key followed by a new line.

Again, I'm not sure if this is necessarily 'better', but it's definately another way of doing things, and it'd cut down on the number of variables used, and it'd also mean that if you had any new effects to add in you'd not need to change the #STWIN contents, you'd just need to make the trigger to add a new pair to the variable.

Good luck
Reply with quote
Slaem
Apprentice


Joined: 20 Sep 2005
Posts: 135

PostPosted: Mon Dec 05, 2005 6:21 am   
 
I use string lists for affects and display the values in the status bar. I do an #ADDITEM for the affect name when I get an "affect on" line and a #DELITEM when I get an "affect off" line. I color my status bar green for good affects and red for bad affects.
_________________
Show your love.
Support Zugg Software!
Donate to zugg@zuggsoft.com with PayPal Send Money.
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