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


Joined: 23 Aug 2010
Posts: 3

PostPosted: Mon Aug 23, 2010 10:08 am   

variables (slow man explainations please)
 
Hey guys,
I am an old Zmud user and am having trouble converting over.
I use very simple variable defining triggers:
Main script:
Pattern: You wield a (%w)
Command: #variable wep %1

Support trigger:
Pattern: You FUMBLED your weapon.
Command: wield @wep

As an example. The variable is created but how do I set the command to tell the variable to assign what %w to the variable. In Zmud this worked perfect, but I am having trouble converting it over to Cmud. Thanks.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Aug 23, 2010 2:35 pm   
 
That code should work fine in Cmud. Check for typos. If you can't figure it out, copy the actual code here into the forum with the following procedure:
In the Package Editor, click on the trigger, so that it displays the code in the window on the right.
At the bottom of that window, click the XML tab, to see the XML version of the code.
Highlight the entire code, including the <trigger> and </trigger> lines, and type CTRL-C to copy it into your clipboard.
In a reply to this thread, type: [code]
Then type CTRL-V to paste the code.
Then type: [/code]
Do this for both triggers, and submit it. This will allow us to see the raw code, including the pattern and options.
Reply with quote
snapzilla
Newbie


Joined: 23 Aug 2010
Posts: 3

PostPosted: Mon Aug 23, 2010 2:44 pm   
 
Wield trigger (this trigger works):
<trigger priority="40" id="4">
<pattern>You FUMBLED your weapon.</pattern>
<value>wield @wep</value>
</trigger>

@wep set trigger (I have it disabled so I can manually imput the @variable):

<trigger priority="50" enabled="false" id="5">
<pattern>You wield a %w</pattern>
<value>#variable wep %1</value>
</trigger>
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Aug 23, 2010 4:27 pm   
 
In the second trigger, you need to put () around the %w to capture it. So it should be this:
Code:
<trigger priority="50" enabled="false" id="5">
<pattern>You wield a (%w)</pattern>
<value>#variable wep %1</value>
</trigger>

The same was true in zMUD so I don't see how this would have worked in zMUD and not CMUD unless it's just a typo. The () around %w is needed in both programs.
Reply with quote
snapzilla
Newbie


Joined: 23 Aug 2010
Posts: 3

PostPosted: Mon Aug 23, 2010 4:47 pm   
 
Oh ya. I had them on, but for some reason it didn't work. It seems to work now... not sure what it was.
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