• 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

Doing multiple copy scripts in feats.

DeltaMasterMind

Well-known member
I am attempting to script this in a feat:
~ 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?
 
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.
 
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.[B]XXXXXXXX[/B]]

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.
 
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.[B]XXXXXXXX[/B]]

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

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. :)
 
No, in the Special if the character has the feat taken TWICE then they get Run (custom) as a free feat. So the free feat is bootstrapped.
If not for that I would agree with all the above reasoning and no I do not have xFly bootstrapped as I am aware that is not needed, plus this feat can only be taken after the player takes the racials which gives Flight to the character anyhow.

Edit: However I did adjust the tagreplace with assign.
 
Last edited:
No, in the Special if the character has the feat taken TWICE then they get Run (custom) as a free feat. So the free feat is bootstrapped.
If not for that I would agree with all the above reasoning and no I do not have xFly bootstrapped as I am aware that is not needed, plus this feat can only be taken after the player takes the racials which gives Flight to the character anyhow.

Edit: However I did adjust the tagreplace with assign.
If you must have timing that early then yes you will need foreach loop instead to do the counting. Sorry I guess I missed those details somewhere in the posts above. :o

Still a little surprised because Ability.? tags are often added to the hero very early in First but maybe its still not early enough.
 
Well if I could get around the timing restriction of Bootstrap conditionals then yeah this would have been a breeze. The latest I can play at is 2380 I am currently using 230x. Yeah I did a test with two field values adding together one from the foreach and one from the tagcount and the foreach was the only one posting at that timing. I do appreciate it though, thank you.
 
Could you instead drop the bootstrap conditional (so the bonus feat would be added with the first instance of the ability) but add a script disabling the bonus feat if there are less than 2 copies of the ability? This would probably prevent the character from getting the Run feat from another source, but might be easier done this way?
 
Could you instead drop the bootstrap conditional (so the bonus feat would be added with the first instance of the ability) but add a script disabling the bonus feat if there are less than 2 copies of the ability? This would probably prevent the character from getting the Run feat from another source, but might be easier done this way?

While that is a good idea I am not that good with disable tags outside of a direct tag check via script. I assume a perform command using assign[Helper.FtDisable] is what I would use here to hide the bootstrapped feat until they meet the condition to prevent that script from running. Not 100% on how all the disable tags work in the background (assuming they do have there own background scripts).
 
Back
Top