Junior Member
Join Date: Apr 2016
Posts: 19
|
i'm making an modified version of the "warden of the woods" armor (for a lower lvl player)
it uses charges and for each charge used it should add -1 to AC It seems this armor doesn't do that automatically so i want to add that to my own created armor. Sadly i cannot find this option, and sadly my editing skills are limited to the basic things as i'm still learning the ropes so i was wondering if someone can give me some pointers Question: If i add an charge (under tracked resources in the inplay tab) i want it to automatically add an -1 AC penalty per charge if i add another charge it should add another if i remove an charge it should remove the ac penalty for that charge kind regards korpah |
#1 |
Senior Member
Join Date: May 2015
Posts: 830
|
You can script it to check the armors total value - uses and then store that in the armor's value field.
|
#2 |
Junior Member
Join Date: Apr 2016
Posts: 19
|
Quote:
do you have a line of code that would check this? I'm still trying to get a grasp of it all i checked some other things and formulated the script ~ If we're disabled, just get out now doneif (tagis[User.Tracker] <> 0) doneif (tagis[User.Tracker] = 1) hero.child[ArmorClass].field[Penalty].value -= 1 but that doesn't seem to work |
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
User.Tracker means "show me on the tracker list". Keep looking for what means "our tracker is set to X".
|
#4 |
Junior Member
Join Date: Apr 2016
Posts: 19
|
Quote:
if (field[trkUser].value = 1) then hero.child[ArmorClass].field[tACArmor].value -= 1 endif Although this subtracts 1 AC before its even equiped or an charge is used Am i on the right track? |
|
#5 |
Junior Member
Join Date: Apr 2016
Posts: 19
|
if (field[trkUser].value = 1) then
hero.child[ArmorClass].field[tACArmor].value -= 1 endif if (field[trkUser].value = 2) then hero.child[ArmorClass].field[tACArmor].value -= 2 endif seems to be the right script (i picked the wrong phase at first that's why it didn't worked correctly, i put it on final phase now), although i need to find a way that the above script doesn't run when the item is not equipped. so the next question is how to combine two if statements >.< if (field[gIsEquip].value = 1) then |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
Separate lines - one after the other, with the endif that matches the first one after everything that should happen if that's true.
Also, think about the amount you're subtracting - do you have another value that will be the same as the amount you want to subtract, that you could use instead of having a separate if...endif for each possible number? |
#7 |
Junior Member
Join Date: Apr 2016
Posts: 19
|
Quote:
Code:
if (field[gUserEquip].value = 1) then if (field[trkUser].value = 1) then hero.child[ArmorClass].field[tACArmor].value -= 1 endif endif if (field[gUserEquip].value = 1) then if (field[trkUser].value = 2) then hero.child[ArmorClass].field[tACArmor].value -= 2 endif endif Now regarding what you said @mathias i think i understand what you mean, (as the number i subtract is the same value that i check in the trkUser field). For now i have no clue (yet) how to do that though. |
|
#8 |
Junior Member
Join Date: Apr 2016
Posts: 19
|
so it seems i got the hang of it
Code:
if (field[gUserEquip].value = 1) then if (field[trkUser].value = 1) then hero.child[ArmorClass].field[tACArmor].value -= 1 endif endif if (field[gUserEquip].value = 1) then if (field[trkUser].value = 2) then hero.child[ArmorClass].field[tACArmor].value -= 2 endif endif Code:
if (field[gUserEquip].value = 1) then hero.child[ArmorClass].field[tACArmor].value -= field[trkUser].value endif @mathias thanks for letting lose some clue's (better then the straight up answer) took me a while but we have results! Last edited by Korpah; August 7th, 2017 at 01:18 PM. Reason: thanking Mathias |
#9 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,207
|
Here's how I'd write it:
Code:
if (field[gIsEquip].value <> 0) then if (field[trkUser].value <> 0) then hero.child[ArmorClass].field[tACArmor].value -= field[trkUser].value endif endif |
#10 |
Thread Tools | |
Display Modes | |
|
|