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


Joined: 14 Sep 2009
Posts: 6

PostPosted: Mon Sep 14, 2009 5:35 pm   

Capture Variables from Trigger For Status Bar
 
I am so noobie at this it is impossible to be more noobie. Help would be much appreciated. :)

I am trying to put prompt into the status line.

The trigger is as below: hp, movement, stun, position, speed, armed/unarmed, language, accent, time

> HP: 120 - MV: 150 - ST: 300 / standing - walking - unarmed / sirihish - southern - early morning

I created the variable and the trigger to capture it, however, I am fumbling, so I couldn't even get to the status line stage. For some reason, MV is getting the HP number, and POS and others are all wrong, too.

What I have done so far:

#CLASS 0
#VAR HP {120}
#VAR MV {120}
#VAR ST {150}
#VAR POS {standing|sitting|resting|sleeping}
#VAR SPD {walking|running|sneaking} {}
#VAR ARM {armed|unarmed}
#VAR LAN {sirihish|bendune}
#VAR ACC {northern|southern|tribal}
#VAR TIM {before dawn|dawn|early morning|late morning|high sun|early afternoon|late afternoon|dusk|late at night}

#TRIGGER {^> HP: (%1) - MV: (%2) - ST: (%3) / (%4) - (%5) - (%6) / (%7) - (%8) - (%9)} {#VAR HP %1;#VAR MV %2;#VAR ST %3;#VAR POS {%4};#VAR SPD {%5};#VAR ARM {%6};#VAR LAN {%7};#VAR ACC {%8};#VAR TIM {%9}}

Should I just give up trying to do it on my own, or it can still be salvaged? :)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Sep 15, 2009 1:34 am   
 
First, change all your %1...%99 used in the trigger pattern. %1...%99 in trigger patterns is the same as *, and maybe even has a few bugs. Replace the appropriate numbers with the appropriate wildcards. %d = numbers, %w = letters, %a = letters and numbers, etc. Details can be found under the Pattern Matching helpfile.

From what I can see there's nothing else wrong with your trigger, but you are assigning specific values to your stringlist variables. If you want to keep the stringlists, you're going to need different variables.
_________________
EDIT: I didn't like my old signature
Reply with quote
VelvetSin
Newbie


Joined: 14 Sep 2009
Posts: 6

PostPosted: Tue Sep 15, 2009 2:52 am   
 
Thanks for the help. Please kindly bear with me as I am less than novice here. ^_^ So after reading the helpfile, I changed the trigger to how my understanding has.... changed. I'm not sure I understand the bit about different variables. Is there an easier fix to the problem? An example or helpfile please? I've no idea how to go around the problem. Thanks!

#VAR HP {120}
#VAR MV {120}
#VAR ST {150}
#VAR POS {standing|sitting|resting|sleeping}
#VAR SPD {walking|running|sneaking} {}
#VAR ARM {armed|unarmed}
#VAR LAN {sirihish|bendune}
#VAR ACC {northern|southern|tribal}
#VAR TIM {before dawn|dawn|early morning|late morning|high sun|early afternoon|late afternoon|dusk|late at night}

#TRIGGER {^> HP: (&*d1.HP) - MV: (&*d2.MV) - ST: (&*d3.ST) / (&*w4.POS) - (*w5.SPD) - (*w6.ARM) / (*w7.LAN) - (*w.ACC) - (*w.TIM)}
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Tue Sep 15, 2009 3:34 am   
 
I think you misunderstood what he meant. Try this.

Code:
#VAR HP {120}
#VAR MV {120}
#VAR ST {150}
#VAR POS {standing|sitting|resting|sleeping}
#VAR SPD {walking|running|sneaking} {}
#VAR ARM {armed|unarmed}
#VAR LAN {sirihish|bendune}
#VAR ACC {northern|southern|tribal}
#VAR TIM {before dawn|dawn|early morning|late morning|high sun|early afternoon|late afternoon|dusk|late at night}

#TRIGGER {^> HP: &%dHP - MV: &%dMV - ST: &%dST / &%wPOS - &%wSPD - &%wARM / &%wLAN - &%wACC - &%wTIM}


Look at Introduction to Triggers and Introduction to Variables
_________________
Asati di tempari!
Reply with quote
VelvetSin
Newbie


Joined: 14 Sep 2009
Posts: 6

PostPosted: Tue Sep 15, 2009 11:40 am   
 
Oh~

I knew I am clueless. -_- Thank you much.

I have a slight new problem though. The TIM variable only captures the one word, like before, early, late, high, and not the entire string. What did I miss to make it recognize two words and the space in between them? Thanks.
Reply with quote
VelvetSin
Newbie


Joined: 14 Sep 2009
Posts: 6

PostPosted: Tue Sep 15, 2009 11:51 am   
 
Before I even got pass the other problem, here is another newbie question:

#STAT {> HP: @HP - MV: @MV - ST: @ST / @POS - @SPD - @ARM / @LAN - @ACC - @TIM}


For my status line, it shows up exactly as > HP: @HP - MV: @MV - ST: @ST / @POS - @SPD - @ARM / @LAN - @ACC - @TIM.

Did I use the wrong character to represent variable?
Reply with quote
shalimar
GURU


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

PostPosted: Tue Sep 15, 2009 12:51 pm   
 
You are using the correct one... unless you changed the default special character in preferences.
_________________
Discord: Shalimarwildcat
Reply with quote
VelvetSin
Newbie


Joined: 14 Sep 2009
Posts: 6

PostPosted: Tue Sep 15, 2009 3:51 pm   
 
Thank you so very much for the help!

My prompt may be simple, but I am so very proud of my first step!
Reply with quote
VelvetSin
Newbie


Joined: 14 Sep 2009
Posts: 6

PostPosted: Tue Sep 15, 2009 4:27 pm   
 
OK...

Then I realized I have to #sub or #gag the prompt line.

#TRIGGER {^> HP: &%dHP - MV: &%dMV - ST: &%dST / &%wPOS - &%wSPD - &%wARM / &%wLAN - &%wACC - &%wTIM}{#SUB {%a}}

Ideally, would prefer to leave spaces in lieu of the old prompt. Did I get it right? But it still shows up.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Sep 16, 2009 4:36 am   
 
heh, you got it right all the way up to the #sub brackets. %a is a pattern-matching wildcard, which are really only relevant in a trigger pattern, a %match() function, or the older pattern-matching operator (=~ or ~=, I forget which it is).

To replace the prompt with spaces, you can either do it literally:
Code:

"                                                                          "


or via the %repeat() function: %repeat(" ",25)
_________________
EDIT: I didn't like my old signature
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