|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Wed Jul 26, 2006 1:44 am
Enabling and Disabling Classes off onconnect |
Just want to be sure I'm thinking this right.
I want to enable a class through onconnect, but I want the class to disable itself once the trigger in it fires.
Should I put the #T- at the end of the trigger, or am I thinking wrong? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Jul 26, 2006 2:30 am |
Yep, at the end.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Wed Jul 26, 2006 3:48 am |
Okay. That really helped, maybe I can get an answer to this. I'm putting together a wound and scar monitor for Gemstone 4. The issue I am having is that when I heal a wound or scar, for some reason the number for the gsl code is being displayed before my prompt. Turning processing off, this is what it shows:
Code: |
You take a bite of your calamia fruit.
YUCK! That stuff tastes horrible!
GSb0004196369
Your right arm feels better.
Roundtime: 23 sec.
You only have one bite left.
GSb0004196369
|
Normal processing give me this...
Code: |
You take a bite of your calamia fruit.
Your left leg feels better.
Roundtime: 23 sec.
That was the last of it.
00041963690004196369> |
My triggers and aliases don't use anything like #SHOW or #ECHO. Trigger just assigns the GSb code to a variable then calls an alias which converts it to a binary string, then parses the string for the appropriate body part.
Oh, and to be sure I'm understood I don't want that long number before the '>', which is the prompt. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jul 28, 2006 1:37 am |
Sounds like you have a typo in your alias. Do you get any "I don't know what you're talking about" kind of messages, like you were sending bad commands to the game? When you look at the alias in the Settings Editor, is there a syntax error? If not, can you account for all the brackets (ZMud generally won't throw up a syntax error if the correct number of braces are in the wrong places)?
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Jul 28, 2006 1:46 am |
Nope, there are no errors and nothing messed up in the game. For some reason when the trigger fires it seems to suddenly want to do this. What is odd, is that it only happens with the gsl codes for wounds and scars, even the ones in the GSV code (other than at login where GSV doesn't give this odd echo).
Okay, here is the trigger for scars (as the triggers and alias for wounds and scars all are exact other than working with different variable names and the GS code)
Code: |
#TRIGGER {b} {#var scarnum "";scarnum = %gsl( b);processscars} "woundsandscars" {gsl} |
and alias processscars (only thing that matters really is what is before all the #IF statements.
Code: |
#ALIAS processscars {#var scarbin "";#var scarfull "";#var leyescar "";#var reyescar "";#var backscar "";#var abdoscar "";#var chestscar "";#var lhandcar "";#var rhandscar "";#var llegscar "";#var rlegscar "";#var larmscar "";#var rarmscar "";#var nervesscar "";#var headscar "";scarbin = @dec2bin(@scarnum);fullbinary @scarbin;scarfull = @storage2;#IF ((%copy( @scarfull, 1, 2))="00") {leyescar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 1, 2))="01") {leyescar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 1, 2))="10") {leyescar = ~<color orange>2~</color>} {leyescar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 3, 2))="00") {reyescar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 3, 2))="01") {reyescar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 3, 2))="10") {reyescar = ~<color orange>2~</color>} {reyescar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 5, 2))="00") {backscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 5, 2))="01") {backscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 5, 2))="10") {backscar = ~<color orange>2~</color>} {backscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 7, 2))="00") {abdoscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 7, 2))="01") {abdoscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 7, 2))="11") {abdoscar = ~<color orange>2~</color>} {abdoscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 9, 2))="00") {chestscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 9, 2))="01") {chestscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 9, 2))="11") {chestscar = ~<color orange>2~</color>} {chestscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 11, 2))=""00"") {lhandscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 11, 2))="01") {lhandscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 11, 2))="11") {lhandscar = ~<color orange>2~</color>} {lhandscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 13, 2))="00") {rhandscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 13, 2))="01") {rhandscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 13, 2))="11") {rhandscar = ~<color orange>2~</color>} {rhandscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 15, 2))="00") {llegscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 15, 2))="01") {llegscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 15, 2))="11") {llegscar = ~<color orange>2~</color>} {llegscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 17, 2))="00") {rlegscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 17, 2))="01") {rlegscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 17, 2))="11") {rlegscar = ~<color orange>2~</color>} {rlegscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 19, 2))="00") {larmscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 19, 2))="01") {larmscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 19, 2))="11") {larmscar = ~<color orange>2~</color>} {larmscar = ~<color cyan>3}}};#IF ((%copy( @scarfull, 21, 2))="00") {rarmscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 21, 2))="01") {rarmscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 21, 2))="11") {rarmscar = ~<color orange>2~</color>} {rarmscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 23, 2))="00") {nervesscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 23, 2))="01") {nervesscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 23, 2))="11") {nervesscar = ~<color orange>2~</color>} {nervesscar = ~<color red>2~</color>}}};#IF ((%copy( @scarfull, 25, 2))="00") {headscar = ~<color cyan>0~</color>} {#IF ((%copy( @scarfull, 25, 2))="01") {headscar = ~<color yellow>1~</color>} {#IF ((%copy( @scarfull, 25, 2))="11") {headscar = ~<color orange>2~</color>} {headscar = ~<color red>2~</color>}}}} "woundsandscars" |
function dec2bin:
Code: |
#FUNC dec2bin {%if("%1"!="0",%concat(@dec2bin(%eval(%1/2)),%mod(%1,2)))} {_nodef} "woundsandscars" |
alias fullbinary:
Code: |
#ALIAS fullbinary {storage2 = "";#VAR storage2 %1;#if (%len( @storage2)=26) {storage2 = 00000000000000000000000000} {#UNTIL (%len( @storage2)=26) {storage2 = %concat( 0, @storage2)}}} "woundsandscars" |
Hmm...if you know of a way to make fullbinary a function, please let me know. |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Fri Jul 28, 2006 11:27 am |
Code: |
#func fullbinary {%if(%len(%1)!=26,%concat(%repeat("0",26-%len(%1)),%1),%1)} |
|
|
_________________ Taz :) |
|
|
|
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Fri Jul 28, 2006 11:32 am |
You can now replace
Code: |
scarbin = @dec2bin(@scarnum);fullbinary @scarbin;scarfull = @storage2 |
with
Code: |
scarfull = @fullbinary(@dec2bin(@scarnum)) |
|
|
_________________ Taz :) |
|
|
|
Dumas Enchanter
Joined: 11 Feb 2003 Posts: 511 Location: USA
|
Posted: Fri Jul 28, 2006 12:42 pm |
grr, I need to sit down with the function library one of these days. Thanks Taz
EDIT: Oh, and that seemed to solve my problem with the GS code echoing also. |
|
|
|
|
|
|
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
|
|