Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Pathfinder Roleplaying Game (http://forums.wolflair.com/forumdisplay.php?f=62)
-   -   Doing multiple copy scripts in feats. (http://forums.wolflair.com/showthread.php?t=60335)

DeltaMasterMind March 10th, 2018 01:26 PM

Doing multiple copy scripts in feats.
 
I am attempting to script this in a feat:
Quote:

~ Improve our maneuverability based on how many copies of this feat we have.
field[abValue].value = field[xCount].value
if (field[abValue].value = 1) then
perform hero.childfound[xFly].tagreplace[Maneuver.Clumsy,Maneuver.Poor]
elseif (field[abValue].value = 2) then
perform hero.childfound[xFly].tagreplace[Maneuver.Poor,Maneuver.Average]
elseif (field[abValue].value = 3) then
perform hero.childfound[xFly].tagreplace[Maneuver.Average,Maneuver.Good]
elseif (field[abValue].value >= 4) then
perform hero.childfound[xFly].tagreplace[Maneuver.Good,Maneuver.Perfect]
endif
I noticed I cannot use xCount in feats so what other options do I have here?

Aaron March 10th, 2018 03:18 PM

Use a foreach to count the number of copies of the feat.

DeltaMasterMind March 10th, 2018 03:33 PM

Would someone please write up that code and post it here? I am not sure how to use the foreach in that way specifically. Thanks for the suggestion otherwise Aaron.

ShadowChemosh March 10th, 2018 10:38 PM

Quote:

Originally Posted by DeltaMasterMind (Post 264147)
Would someone please write up that code and post it here? I am not sure how to use the foreach in that way specifically. Thanks for the suggestion otherwise Aaron.

I would actually just count the Ability tags to know how many times the feat was taken.

Like this:
Code:

~ Improve our maneuverability based on how many copies of this feat we have.
field[abValue].value += hero.tagcount[Ability.XXXXXXXX]

if (field[abValue].value = 1) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Clumsy,Maneuver.Poor]
elseif (field[abValue].value = 2) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Poor,Maneuver.Average]
elseif (field[abValue].value = 3) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Average,Maneuver.Good]
elseif (field[abValue].value >= 4) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Good,Maneuver.Perfect]
endif

Just replace XXXXXXXX with the Unique ID of your Feat.

DeltaMasterMind March 11th, 2018 06:49 AM

Quote:

Originally Posted by ShadowChemosh (Post 264170)
I would actually just count the Ability tags to know how many times the feat was taken.

Like this:
Code:

~ Improve our maneuverability based on how many copies of this feat we have.
field[abValue].value += hero.tagcount[Ability.XXXXXXXX]

if (field[abValue].value = 1) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Clumsy,Maneuver.Poor]
elseif (field[abValue].value = 2) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Poor,Maneuver.Average]
elseif (field[abValue].value = 3) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Average,Maneuver.Good]
elseif (field[abValue].value >= 4) then
  perform hero.childfound[xFly].tagreplace[Maneuver.Good,Maneuver.Perfect]
endif

Just replace XXXXXXXX with the Unique ID of your Feat.

Thank you so much for that Shadow!

DeltaMasterMind March 11th, 2018 10:25 AM

While I did have some success with the tagcount, I found issue with it at the timings I needed to have it work. So I ended up using the foreach to simulate the effect of the tagcount. I had to do it in the First 23xx range, but the later scripts used the tagcount flawlessly. Just updating my findings.

ShadowChemosh March 11th, 2018 11:32 AM

Quote:

Originally Posted by DeltaMasterMind (Post 264194)
While I did have some success with the tagcount, I found issue with it at the timings I needed to have it work. So I ended up using the foreach to simulate the effect of the tagcount. I had to do it in the First 23xx range, but the later scripts used the tagcount flawlessly. Just updating my findings.

Why would you need to run that early? Nothing in your script requires that?

ShadowChemosh March 11th, 2018 11:38 AM

Looking at your script again I would also not use tagreplace[] as its not really needed. xFly is designed to use the BEST maneuverability rating regardless of how many tags are on it.

Just need this:
Code:

~ Improve our maneuverability based on how many copies of this feat we have.
field[abValue].value += hero.tagcount[Ability.XXXXXXXX]

if (field[abValue].value = 1) then
  perform hero.childfound[xFly].assign[Maneuver.Poor]
elseif (field[abValue].value = 2) then
  perform hero.childfound[xFly].assign[Maneuver.Average]
elseif (field[abValue].value = 3) then
  perform hero.childfound[xFly].assign[Maneuver.Good]
elseif (field[abValue].value >= 4) then
  perform hero.childfound[xFly].assign[Maneuver.Perfect]
endif

Which goes back to my idea of nothing in here requires early timing. Its always better to get away from early timing if you can.

DeltaMasterMind March 11th, 2018 12:47 PM

The feat says this:
{b}Benefit{/b}: Your fly speed increases by 10 feet and your maneuverability by one step.
This feat can be taken multiple times.
{b}Special{/b}: This feat can be taken more than once. If you have this feat more than once, you gain run as a bonus feat, but can only apply it to flight unless you buy it normally.

The reason for the early timing is for the bootstrap condition which I must contend with.
So you suggest just to change it to assign instead of replace since my timing comes before it's own correct?

ShadowChemosh March 11th, 2018 12:56 PM

Quote:

Originally Posted by DeltaMasterMind (Post 264214)
The reason for the early timing is for the bootstrap condition which I must contend with.

What bootstrap? Fly is on every character in the world. I am guessing your bootstrapping xFly if that is the case no need. Just assign the fly speed in the script.

Quote:

Originally Posted by DeltaMasterMind (Post 264214)
So you suggest just to change it to assign instead of replace since my timing comes before it's own correct?

Assuming your bootstrapping xFly as the reason for early timing. Then make your script as this and you can set pretty much any time before Final:

Code:

~ Improve our maneuverability based on how many copies of this feat we have.
field[abValue].value += hero.tagcount[Ability.XXXXXXXX]

~ Give fly speed of XXft based on the abValue2 setup on feat
#applybonus[abValue,hero.child[xFly],field[abValue2].value]

if (field[abValue].value = 1) then
  perform hero.childfound[xFly].assign[Maneuver.Poor]
elseif (field[abValue].value = 2) then
  perform hero.childfound[xFly].assign[Maneuver.Average]
elseif (field[abValue].value = 3) then
  perform hero.childfound[xFly].assign[Maneuver.Good]
elseif (field[abValue].value >= 4) then
  perform hero.childfound[xFly].assign[Maneuver.Perfect]
endif

I use #applybonus[] to set the HIGHEST Fly speed. Meaning if two scripts run for #applybonus with 60ft of movement and 30ft of movement you end up with 60ft of fly speed not 90. :)


All times are GMT -8. The time now is 12:10 PM.

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