Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game

Notices

Reply
 
Thread Tools Display Modes
Korpah
Junior Member
 
Join Date: Apr 2016
Posts: 19

Old August 7th, 2017, 10:05 AM
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
Korpah is offline   #1 Reply With Quote
Minous
Senior Member
 
Join Date: May 2015
Posts: 830

Old August 7th, 2017, 10:57 AM
You can script it to check the armors total value - uses and then store that in the armor's value field.
Minous is offline   #2 Reply With Quote
Korpah
Junior Member
 
Join Date: Apr 2016
Posts: 19

Old August 7th, 2017, 11:00 AM
Quote:
Originally Posted by Minous View Post
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
Korpah is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old August 7th, 2017, 11:38 AM
User.Tracker means "show me on the tracker list". Keep looking for what means "our tracker is set to X".
Mathias is online now   #4 Reply With Quote
Korpah
Junior Member
 
Join Date: Apr 2016
Posts: 19

Old August 7th, 2017, 11:59 AM
Quote:
Originally Posted by Mathias View Post
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?
Korpah is offline   #5 Reply With Quote
Korpah
Junior Member
 
Join Date: Apr 2016
Posts: 19

Old August 7th, 2017, 12:37 PM
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
Korpah is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old August 7th, 2017, 12:41 PM
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?
Mathias is online now   #7 Reply With Quote
Korpah
Junior Member
 
Join Date: Apr 2016
Posts: 19

Old August 7th, 2017, 01:03 PM
Quote:
Originally Posted by Mathias View Post
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

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.
Korpah is offline   #8 Reply With Quote
Korpah
Junior Member
 
Join Date: Apr 2016
Posts: 19

Old August 7th, 2017, 01:14 PM
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


@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
Korpah is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old August 7th, 2017, 01:16 PM
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.
Mathias is online now   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:38 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.