|
boblinski Novice
Joined: 05 Dec 2005 Posts: 49 Location: New Zealand
|
Posted: Tue Jan 30, 2018 9:48 am
#if check on a string var |
Hey guys,
What I'm wanting to do is create a system which records the status of my "wielding" status... (nothing/nothing, nothing/shield, nothing/offhand, mainhand/nothing,,mainhand/shield,mainhand/offhand)
The strings that I think are relevant are:
You wield (*).
You dual wield (*).
You wear (*) as a shield.
You stop using *.
I had then thought to do a trigger for each with something like:
#ADDI mainhand_list (%1)
#ADDI offhand_list (%1)
The problems I am having.. is checking IF it is on the list.. #if (@offhand_list = {%1}) {}{} doesnt seem to be working for me.
What I then want to be able to do is if I get disarmed, I want it to detect if it was the weapon from my mainhand or my offhand and re-wield it... but if they disarm my shield I want it to 'wear' not wield the shield.
Also, when the it adds a weapon to the mainhand_list or offhand_list etc I want to be able to set that weapons specific "call signs" for example... "a silver longsword with a white hilt" I may want referred to as "silver longsword".
Sorry this is such a mess..If someone could give me a couple of pointers to start me off then I'll ask some more specific questions once I have a little play around! |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4691 Location: Pensacola, FL, USA
|
Posted: Tue Jan 30, 2018 6:07 pm |
Some of the text from the game itself would be useful here.
Do you tend to change weapons a lot in this game?
I rather assume so by the fact you want to keep track of a list of them, and not just the current one(s).
And if you want to test to see if a given item is in a list use:
%ismember(%1, @someList)
The best way to do 'call signs' as such, would be a DB reference variable.
#ADDKEY callSign {a silver longsword with a white hilt} {silver longsword}
Then you can reference the short form via the long form with:
%db(@callSign, %1)
#TR {You can't wield (*).} {wear %db(@callSign, %1)}
#TR {You wield (*).} {rightHand=%1}
#TR {You dual wield (*).} {leftHand=%1}
#TR {You wear (*) as a shield.} {leftHand=%1}
Put it all together for something like:
Code: |
#TR {Your (*) is disarmed!} {
#SWITCH (%1) (@rightHand) {rightHand=""} (@lefthand) {leftHand=""}
#LOCAL $this
#IF (%ismember(%1, %dbkeys(@callSign))) {$this=%db(@callSign, %1)} {$this=%1;#SAY {$this ... may need its own callSign!}}
get $this
wield $this
} |
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
|
|
|
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
|
|