• 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

Help on Script writing

I'm trying to go a little deeper in the editor functions, and attempting to make custom abilities that can effect the calculated fields. I can't really code (though can puzzle through VBA and SQL macros here and there), but I'm trying to get better and thought this a great opportunity, but I could use some help.

I'm creating the Trailgaunt from the back of Pathfinder Comics #11. I was using the Bestiary Monster Creator for the most part, but was building custom Racial Special abilities to choose within the builder. I've got all of them done (just text based) except for "Vengeful Strike", which acts sort of like a favorite enemy bonus. Here's the text:

"A Trailgaunt particularly hates living Varisians. The undead gains a +2 bonus on all attack rolls made against Varisians, as well as on any Perception or Survival checks made against Varisians"

So in setting up the ability, I have it checked to Show in Activated Abilities List, with the name as "vs. Varisians". It looks like this created the field "actName" with a value of "vs. Varisians". What I'd like to do is build the Eval Scripts such that when the box is checked, it adds in the +2 to Attack, Perception, and Survival.

I've figured out that the names of those fields to modify are called [hero.child[skPercpe] [hero.child[skSurvival] and [hero.child[Attack] (from playing around w/ the favorite enemy scripts), but I'm stumped on what to do next. Any help (and if you have the time, a brief explanation of the why) in how to do this?
 
What you are needing is the situational macro as the bonuses apply only to Varisians

Take a look at other things that apply a situation modifier for code examples but here is a basic code example to reference.

Code:
#situational[chosen save,bonus text,source's name]

chosen save is the chosen save. bonus text is the text you want to add to that saving throw, and source's name is the name of the ability that's applying the effect. You'll almost always use field[name].text for this.
 
Ok, first pass at writing it and I got an error... here was the script:

#situational[hero.child[skPercep], "+2 vs. Varisians", field[actName].txt]

and it gave me an error for invalid use of a reserved word in script.

One other question... would this just be adding in the text when I hover over the related skill? My hope was instead to have the check mark in the in play tab which then actually modifies the skill and attack checks... would the situational code above do this?
 
Ok, first pass at writing it and I got an error... here was the script:

#situational[hero.child[skPercep], "+2 vs. Varisians", field[actName].txt]

and it gave me an error for invalid use of a reserved word in script.
field[actName].txt is not valid. Use field[name].text

The Numerator;198390 One other question... would this just be adding in the text when I hover over the related skill? My hope was instead to have the check mark in the in play tab which then actually modifies the skill and attack checks... would the situational code above do this?[/QUOTE said:
Situational text adds text to the skill as a reminder. It will not actually adjust the values.

Pre-levels/4000:
Code:
~ If not activated get out now!
doneif (field[abilActive].value = 0)

#skillbonus[skSurvival] += 2
#skillbonus[skPercpe] += 2
hero.child[Attack].field[Bonus].value += 2

So the above is looking at the "activated" field which is a boolean that is either 1 for on or 0 for off. So if we are not activated the script ends and does nothing else.

If we are on we use a Macro (ie those with #) in front to give a skill bonus of 2 to Survival and Perception. Then as we get a "bonus" to attack we transition from the hero to the "Attack" thing and then look for the "Field" called Bonus and give it 2.

Hope that helps.
 
Back
Top