|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Fri Aug 16, 2019 11:51 am
SWITCH and TRIGGER |
My CLASS hierarchy is:
Code: |
L010-019
L010
L011
L012
L013
L014
L015
L016
L017
L018
L019
|
My trigger pattern is:
Code: |
You raise a level! You are now level (%d) |
Which then checks (%1) to enable a level-based class and subclass. The subclass for each level contains spells, skills, triggers, etc for a character when levelling up. The reason I am trying this is that there are also buttons that enable and this is supposed to be a way of automatically controlling the placement of buttons and availability of skills/spells for combat/healing, etc. ..and it is a lot neater than just having (possibly) 1 class for each level up to 201 in a flat structure. Although, in the end, I may just revert to that if this has issues.
Code: |
#SWITCH (%1)
((>=1) AND (<=9)) {T+ L001-009;T+ L%1}
((>=10) AND (<=19)) {T+ L010-019;T+ L%1}
((>=20) AND (<=29)) {T+ L020-029;T+ L%1}
((>=30) AND (<=39)) {T+ L030-039;T+ L%1}
((>=40) AND (<=49)) {T+ L040-049;T+ L%1}
((>=50) AND (<=59)) {T+ L050-059;T+ L%1}
((>=60) AND (<=69)) {T+ L060-069;T+ L%1}
((>=70) AND (<=79)) {T+ L070-079;T+ L%1}
((>=80) AND (<=89)) {T+ L080-089;T+ L%1}
((>=90) AND (<=99)) {T+ L090-099;T+ L%1}
((>=100) AND (<=119)) {T+ L100-119;T+ L%1}
((>=110) AND (<=129)) {T+ L110-119;T+ L%1}
((>=120) AND (<=139)) {T+ L120-129;T+ L%1}
((>=130) AND (<=149)) {T+ L130-139;T+ L%1}
((>=140) AND (<=159)) {T+ L140-149;T+ L%1}
((>=150) AND (<=169)) {T+ L150-159;T+ L%1}
((>=160) AND (<=179)) {T+ L160-169;T+ L%1}
((>=170) AND (<=189)) {T+ L170-179;T+ L%1}
((>=180) AND (<=199)) {T+ L180-189;T+ L%1}
((>=190) AND (<=201)) {T+ L190-201;T+ L%1}
|
The trigger fires but does not compile.
Debugger output:
Code: |
0.0008 | c Aardwolf | [1] Aardwolf Comline : start :
0.0009 | a Aardwolf |You raise a level! You are now level 153
0.0006 | f Aardwolf | Pattern: You raise a level! You are now level (%d) : (%1=153)
0.0010 | a Aardwolf |ERROR: Trigger "You raise a level! You are now level (%d)" fired but did not compile
0.0017 | d Aardwolf | [1] Aardwolf Comline : stopped |
The switch looks perfectly fine to me...but obviously is not.
Can anyone shed some light on my mistake?
Thanks in advance. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Fri Aug 16, 2019 1:46 pm |
Its your #SWITCH syntax, the way you use it only works when comparing against a list of literal values, with all those ranges, you need to use %1 in each of those expressions.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Fri Aug 16, 2019 3:30 pm |
Thanks for that. However...
...You did not notice (as I did not until it worked but failed) that the class commands lacked the '#'. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Fri Aug 16, 2019 10:00 pm |
I see it now, heh.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Sat Aug 17, 2019 8:30 am |
:) Thanks, man. Are you a coder by profession?
Anyway, I'd appreciate your insights on my attempts to populate a database. Another thread.
If you have a spare minute. |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Sat Aug 17, 2019 1:02 pm |
I can help, sure.
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Tue Aug 20, 2019 7:46 am |
This thread for the database: Attempts to use a database - even silently!
Also, I have decided to try this, it kind of ties in with the SWITCH command to enable certain classes depending on player level:
Currently, I have a multistate button which has 4 states: CURE LIGHT (Level 1), CURE SERIOUS (Level 20), CURE CRITICAL (Level 40) and HEAL (Level 60).
In the heat of combat, having to click and select one or the other is a bit of a chore so... I have these events set at various points:-
If you recall the CLASS structure outlined above
Code: |
L001-009
L1FIX (event)
L001
L002
...
L009
L010-019
...
L020-029
L20FIX (event)
...
L030-039
...
L040-049
L40FIX (event)
...
L050-059
...
L060-069
L60FIX (event)
...
etc |
Each event has:-
#IF ((%gmcp.char.status.level>=1) AND (%gmcp.char.status.level<=19)) {fix='cure light'}
Type of statement. (I suppose I should also #T- the previous events just to be safe.)
I want to change the button to just (script) cast @fix when pushed. Where @fix is one of the heal types.
Is this a viable thing? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Tue Aug 20, 2019 12:11 pm |
I would stick the switch into the button itself, it can figure out at click what level you are and respond accordingly.
There is also little need to set the lower boundary in this example as a switch can only perform the first action it qualifies for.
Code: |
#SWITCH (%gmcp.char.status.level<=19) {cast cure light}
(%gmcp.char.status.level<=39) {cast cure serious}
(%gmcp.char.status.level<=59) {cast cure critical}
{cast heal}
|
|
|
_________________ Discord: Shalimarwildcat |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Wed Aug 21, 2019 7:06 am |
Ah! But the character doesn't get 'cure light' until Level 3
AND bear in mind that 3 is also <=20, 40 and 60; 3 and 20 are <=40 and <=60; 3, 20, 40 are <=60. So if you suggest that the switch will operate on the first case it qualifies for then the SWITCH NEEDS upper and lower boundaries to clarify which command needs to run at a specific level otherwise it will always run at level 3 and then quit. I could, I suppose actually use specifics. Eg., 3, 20, 40 and 60 as one must logically go through each to reach the next. However, there may be a danger in that the client might not display the button if it gets started where a character is at a level between these numbers.
I tried it this way also... If you go back up here to the SWITCH statement with all the options to turn classes on.
I implemented separate classes for each restorative action. L3FIX, L20FIX, L40FIX and L60FIX. These are sub-classes under each particular level subclass. Thus L20FIX = L020-029/L20/L20FIX
I included into the switch choices
(%1=20) {#T- L3FIX;#T+ L20FIX}
(%1=40) {#T- L20FIX;#T+ L40FIX}
(%1=60) {#T- L40FIX;#T+ L60FIX}
Similar for L40 and L60. I assumed (possibly incorrectly) that, as each class had a unique name, I should not have to include a full path. However, I tried various methods:
Eg.,
#T+ L20FIX
#T+ L20/L20FIX
#T+ L020-029/L20/L20FIX
#T+ /session/character/L020-029/L20/L20FIX
but the code failed to turn off the previous (lower level) class and startup the higher one. I also tried having separate FIX buttons and gave them each a UNIQUE ID. The then appeared in the package editor tree as (eg) L20FIX:L20 but all that happened was each successive button fired up but didn't shut down the previous one.
Am I trying to run before walking here? |
|
|
|
shalimar GURU
Joined: 04 Aug 2002 Posts: 4672 Location: Pensacola, FL, USA
|
Posted: Thu Aug 22, 2019 3:45 am |
so add in a (<3) {#NOOP}
And it doesnt matter if a given choice will qualify for more than one option in the switch, so long as your expressions are ordered logically.
The first match exits out of the whole switch.
You only need to worry about both bounds if you are listing them not in numeric order. |
|
_________________ Discord: Shalimarwildcat |
|
|
|
hpoonis2010 Adept
Joined: 18 Jun 2019 Posts: 279
|
Posted: Thu Aug 22, 2019 8:11 am |
Thanks a bundle. I appreciate your assistance.
Some of the documentation is lacking. Some of the follow up comments in the help files have gone unanswered by the developers.
It is a shame as the software is useful but, given that the price has not varied one cent since launch, it is disappointing that users/customers are being charged full tit with zero support other than (it seems) yourself.
It raises a good point for software piracy. |
|
|
|
|
|