|
VelvetSin Newbie
Joined: 14 Sep 2009 Posts: 6
|
Posted: 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? :) |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
VelvetSin Newbie
Joined: 14 Sep 2009 Posts: 6
|
Posted: 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)} |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
VelvetSin Newbie
Joined: 14 Sep 2009 Posts: 6
|
Posted: 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. |
|
|
|
VelvetSin Newbie
Joined: 14 Sep 2009 Posts: 6
|
Posted: 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? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4715 Location: Pensacola, FL, USA
|
Posted: Tue Sep 15, 2009 12:51 pm |
You are using the correct one... unless you changed the default special character in preferences.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
VelvetSin Newbie
Joined: 14 Sep 2009 Posts: 6
|
Posted: 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! |
|
|
|
VelvetSin Newbie
Joined: 14 Sep 2009 Posts: 6
|
Posted: 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. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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:
or via the %repeat() function: %repeat(" ",25) |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
|
|