• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

adding -1 ac for each charge used

Korpah

Member
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
 
You can script it to check the armors total value - uses and then store that in the armor's value field.
 
You can script it to check the armors total value - uses and then store that in the armor's value field.

Thanks for your time and reply

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
 
User.Tracker means "show me on the tracker list". Keep looking for what means "our tracker is set to X".
 
User.Tracker means "show me on the tracker list". Keep looking for what means "our tracker is set to X".

did some more digging cause i want it to work haha

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? :)
 
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
 
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?
 
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?

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

so this "masterpiece" of code does the trick. *fireworks and all* been banging me head over it for a few hours but i have the persistence feat :cool:

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.
 
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

can be boiled down to
Code:
if (field[gUserEquip].value = 1) then
hero.child[ArmorClass].field[tACArmor].value -= field[trkUser].value
endif

:rolleyes::D

@mathias thanks for letting lose some clue's :) (better then the straight up answer) took me a while but we have results!
 
Last edited:
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
Note that grIsEquip is preferable to gUserEquip in this case - if you're polymorphed, and the item melds into your form and can't be used anymore, gUserEquip will stay =1 if the item was equipped before you turned on the polymorph, but gIsEquip will be set = 0, so that the item properly turns itself off while polymorphed.
 
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
Note that grIsEquip is preferable to gUserEquip in this case - if you're polymorphed, and the item melds into your form and can't be used anymore, gUserEquip will stay =1 if the item was equipped before you turned on the polymorph, but gIsEquip will be set = 0, so that the item properly turns itself off while polymorphed.

Thanks that is helpful! as its indeed for a class that can polymorph

and <> means bigger or smaller then the value after it?
 
thanks that clarifies it

Wow, I just realized (6 years in) the intent behind choosing that symbol combo because of your post above. If something is "greater or lesser than" the only thing it can not be is equal. Thanks!
 
Wow, I just realized (6 years in) the intent behind choosing that symbol combo because of your post above. If something is "greater or lesser than" the only thing it can not be is equal. Thanks!

not sure if its ment sarcastically (if it is kinda odd)
but if it ain't, guess we learn something new everyday :cool:
 
No sarcasm, just pleasant surprise. I am doing a seminar on the basics of coding at Gencon next week and now I will be better able to explain.
 
No sarcasm, just pleasant surprise. I am doing a seminar on the basics of coding at Gencon next week and now I will be better able to explain.

ok great, no offense ment of course!

Fro this trial and error script i learned allot so that's great how fast i got an answer that led me to the creation of a good script.
 
Back
Top