• 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

Good practice on a Script question

dungeonguru

Well-known member
So I copied a script from a monster that was adding (Humanoid Form Only) to the non-natural weapons and noticed that SRD weapons don't have a livename/sbname on all weapons? Not sure if it's a glitch or intentional but it causes an issue on the statblock where the weapon is listed with just the name " (Humanoid Form Only)."

Is it good practice to call out the base weapon name directly? The script examples are below (both are run in Rendering phase):

OLD SCRIPT (doesn't work):
foreach pick in hero from BaseWep where "!wGroup.Natural"
eachpick.field[livename].text &= " (Humanoid or Hybrid Form Only)"
eachpick.field[sbName].text = eachpick.field[livename].text
nexteach​

MY SCRIPT (works OK):
foreach pick in hero from BaseWep where "!wGroup.Natural"
eachpick.field[livename].text = eachpick.field[name].text & " (Humanoid Form Only)"
eachpick.field[sbName].text = eachpick.field[livename].text
nexteach​
 
I've had the same issue at times when using '&='. Like you, when I use the method you did it works.

I went with the old adage, if a method works, go with it. :)
 
This is all based on "timing" your script is running too early and Livename has not been set yet.

In addition I would not do a foreach loop with the amount of CPU it requires to just set a name. Why can't you just set the names when you bootstrap?
 
I was just commenting on the use of '&='.

I quite agree with ShadowChemosh on this. When bootstrapping I'd go to the fields section of the bootstrapped item. I'd add the field - livename and then the new name.
 
In addition I would not do a foreach loop with the amount of CPU it requires to just set a name. Why can't you just set the names when you bootstrap?

I was working on a shapeshifter and I'm lazy enough to want the PC to do the heavy work. I would rather put this into the eval script, so that later when I copy 4 or 5 of the same creature and then go back and give them each different weapons, I don't have to use the Adjustments tab to modify an attack new names and new damages - just go to gear and pick shortsword for one and give another a club. Or (heaven help me), I give a copy of my files to one of my less technical players to keep track of his new lycanthrope PC...

Now for the bite attack the same race gets - that livename gets the "(in beast mode only)" added to the end of the livename/sbName and that's done in the bootstrap rather than a script.
 
Last edited:
Back
Top