Wounds

by Thorgal

Back to Mechanic's Corner.

Thorgal2004-11-26 11:05:27
How would I go about triggering the wound values for each limb to set a corresponding variable? I tried using stuff like #trigger {* @ ( %1) @ *} {headwounds=%1} ...but that didn't even get recognized, I think it has trouble with the @'s and ()"s in the lines... any suggestions?
Unknown2004-11-26 11:38:37
Your new best friend, the ~ symbol. Use that to designate it to take something as literal, and not confuse it for the symbols ordinarily used by Zmud. It basically quotes the next character, so it isn't interpreted as a wildcard

So the correct trigger would be.. #TRIGGER {~@ (%1) ~@} {#var headwounds %1}
Thorgal2004-11-26 12:16:03
Now that I have it working thanks to Anonymous, here's the whole script, it'll give you a nice set of buttons shaped like a human that indicate your limbstatus from the wounds-skill in discernment, and track the state when you chant puer.

#CLASS {bodypart damage} {enable}
#ALIAS puer {chant puer @limbheal;#t+ limbhealing}
#VAR limbheal {none} {none}
#VAR headwounds {100}
#VAR chestwounds {100}
#VAR gutwounds {100}
#VAR rightlegwounds {100}
#VAR leftlegwounds {100}
#VAR leftarmwounds {100}
#VAR rightarmwounds {100}
#TRIGGER {Your wound status is:} {#t+ wounds}
#TRIGGER "limbhealing" {As you chant the ritual of Puer over your (*), you feel your skin} {#if ("%1"="head") {#add headwounds 46};#if ("%1"="chest") {#add chestwounds 46};#if ("%1"="gut") {#add gutwounds 46};#if ("%1"="left arm") {#add leftarmwounds 46};#if ("%1"="right arm") {#add rightarmwounds 46};#if ("%1"="left leg") {#add leftlegwounds 46};#if ("%1"="right leg") {#add rightlegwounds 46};#if @headwounds>100 {headwounds=100};#if @chestwounds>100 {chestwounds=100};#if @gutwounds>100 {gutwounds=100};#if @leftarmwounds>100 {leftarmwounds=100};#if @rightarmwounds>100 {rightarmwounds=100};#if @leftlegwounds>100 {leftlegwounds=100};#if @rightlegwounds>100 {rightlegwounds=100};limbheal=none;#t- limbhealing} "" {disable}
#BUTTON 50 {@headwounds} {limbheal=head;assault=puer;assaulting} {} {} {} {} {} {Size} {30} {30} {Pos} {254} {199} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 51 {@chestwounds} {limbheal=chest;assault=puer;assaulting} {} {} {} {} {} {Size} {45} {25} {Pos} {290} {192} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 52 {@rightlegwounds} {limbheal=rleg;assault=puer;assaulting} {} {} {} {} {} {Size} {23} {44} {Pos} {334} {192} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 53 {@leftlegwounds} {limbheal=lleg;assault=puer;assaulting} {} {} {} {} {} {Size} {23} {44} {Pos} {334} {214} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 54 {} {} {} {} {} {} {} {Size} {15} {8} {Pos} {283} {207} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 55 {@rightarmwounds} {limbheal=rarm;assault=puer;assaulting} {} {} {} {} {} {Size} {23} {50} {Pos} {290} {170} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 56 {@leftarmwounds} {limbheal=larm;assault=puer;assaulting} {} {} {} {} {} {Size} {23} {50} {Pos} {290} {236} {86} {} {} {} "" {} {} {bodypart damage} {3}
#BUTTON 57 {@gutwounds} {limbheal=gut;assault=puer;assaulting} {} {} {} {} {} {Size} {45} {21} {Pos} {314} {192} {86} {} {} {} "" {} {} {bodypart damage} {3}
#CLASS 0

#CLASS {bodypart damage|wounds} {disable}

#TRIGGER {*~@*~(%1~)*~@*} {headwounds=%1;#t- wounds}
#TRIGGER {*|*|*~(%1~)*|*|*Gut*} {chestwounds=%1;#t- wounds}
#TRIGGER {*~(%1~)*~(%2~)*} {rightarmwounds=%1;leftarmwounds=%2;#t- wounds}
#TRIGGER {*|*|*~(%1~)*|*|*Rarm} {gutwounds=%1;#t- wounds}
#TRIGGER {*~(%1~)|~(%2~)*} {rightlegwounds=%1;leftlegwounds=%2;#t- wounds}
#CLASS 0
Drago2004-11-26 23:46:07
QUOTE
limbheal=gut;assault=puer;assaulting


Might wanna explain that bit, I figure assaulting is either an alias or something to stack your commands but without it person clicking that button isn't going to be getting far wink.gif

For all you lazy people, you can just replace it with chant puer -appropriate limb-

If you have puer, that is..
Daganev2004-11-26 23:56:51
I also found I had to rename the buttons to the variable name, for some reason they were all being set to 100 and causing memmory access errors.

Wonderfull diagram though I've had to play with its location and a few triggers and stuff.