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
WarChild
Novice


Joined: 15 Jul 2001
Posts: 31
Location: USA

PostPosted: Sat Dec 01, 2001 8:42 am   

Trigger, Counting and Speed
 
I need some advice on a counter trigger. There are several spells that we have to draw a charge off of a stone to cast (spellweavers). Different types of spells we have draw off of different gem-stone types. The gem stones we need to recharge, when we do they have 50 points.
I currently have a trigger so when I cast say, diamond mail (which uses the earth stone) it moves just that stones count to 49.. and so on.
Then I started to think that maybe instead of having each spell triggered on its own to remove a charge from whatever type of stone it uses that it would be faster to do this...

Pattern: You begin weaving &SpellName

Cmds:
#if (@SpellName = "diamond mail") {#math E_Stone {@E_Stone - 1}
#if (@SpellName = "chaos storm") {#math V_Stone {@V_Stone - 1}

My problem is everytime I cast diamond mail, it removes a count mark from both, same if I cast chaos storm.

I figure I'm missing a bracket or something but after looking at it for so long figuring it out, I'm just drawing a blank. One other way I tried it it didn't remove any markers
at all.
There is a status bar that shows me the count of each stone currently. I got tired of walking into a bad situation and finding out I should have charged it.

So which would be faster for zmud? Each one triggered on its own?
(I'm using 6.1 zmud in case that has any relivance)
Reply with quote
WarChild
Novice


Joined: 15 Jul 2001
Posts: 31
Location: USA

PostPosted: Sat Dec 01, 2001 9:49 am   
 
It figures that as soon as I give up and post the problem I stumble across the answer. So I have it working right now.. but I'm still wondering about the speed part of it..

Also was wondering if there was any way to change an #alias to a #trigger *grin*
(I know I can cut and paste it.. but am hoping theres another way. I still have zmud lockup my whole system sometimes when I jump between alias and trigger to much. Not sure if its my system or zmud causing it, but it requires a complete poweroff)
Reply with quote
Acaila
Apprentice


Joined: 30 Aug 2001
Posts: 187
Location: Netherlands

PostPosted: Sat Dec 01, 2001 3:49 pm   
 
Each one triggered on its own would be faster, but that difference would only be noticeble with a VERY LARGE list of spells to check for. On a high-end machine you probably won't ever notice it at all.

Acaila
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Dec 02, 2001 12:39 am   
 
I've seen this problem with multiple if's as well. Try declaring both conditions of the IF to see if, in fact, ZMud is getting confused.

An even better way might be to use a #CASE command, but that can get kind of cumbersome with a large list. Here's an example using just the two if's you gave.

#trigger {You begin weaving &SpellName} {
#variable Spells {diamond mail|chaos storm}
#case %ismember(@SpellName, @Spells) {#add E_Stone -1} {#add V_Stone -1} {next case} {next case}...}

li'l shmoe of Dragon's Gate MUD
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