PDA

View Full Version : Hit a dead end, due to lack of coding knowledge


Archmage
May 15th, 2010, 12:18 PM
Hi there, im trying to enter a template that a friend of mine uses in his game into hero labs, I have this temple on my inquisitor character. Adding its "Change Form" ability and it spell resistance gave me a few troubles.

It`s supposed to have an uncapped spell resistance of 11+hd, i looked at the half fiend and entered the same script used there, but the spell resistance only increases by 1 per 3 hd. so i changed it in the script to 12+ hd and now it works fine, but it still "feels" wrong, and i doubt it works fully as intented, also the cap is still there.

Also, I have looked at the change form ability of the werewolf, and the werewolf template itself, and copy pasted, and tried to change and lots of other stuff, but since i have no knowledge of coding/scripting I don`t get the "change form ability" to work properly.

This is what it is suposed to do:

I just want it to display a box under activated abilities that denotes that it is a supernatural ability and gives: +1 tentacle attack, 20% Concealment,50% Fortification and -1 to all enemy attacks against me. These bonuses should only be displayed in the specials tab when i have the alternate form toggled on (checked in checkbox) but i can only get it to either: Always show, or when i toggle it i get an error and nothing happens.

Could anyone enlighten me on what to do? :P

- THanks

Mathias
May 17th, 2010, 08:24 AM
Before you work on the activation, could you please try your hand at adding all those abilities to the template without activation? Please ask if you run into any trouble on those, and once that's done, I'll help you set up the activation.

Archmage
May 17th, 2010, 10:55 AM
Thanks for the reply!, I have tried to add the abilities to the template as racial abilities in the following way:

-1 to enemy attacks: It just says -1 to enemy attacks in the specials tab. It doesen`t modify anything, as i don`t believe there is a way to track this in herolabs? I mean there is no "enemy attack mod tab" and its not a game so its something i need to track myself.

+1 tentacle attack is easy enough.

50% fortification I just added as an ability that says I get 50% fortification, If i try to add it as an effect it says It can`t find a valid item. (Since its normally a item property).

20% concealment is added in the same way, it just says that I have 20% concealment, is there a way so that it also ticks of a "concealed" condition?

Spell resistance: Im in need of help on adding this sadly.


Now I just want the abilities to go "invisible/visible" when i deactivate/activate the checkbox. Any help on that would be great thanks :P

Mathias
May 17th, 2010, 11:13 AM
For spell resistance, note that the Half-Fiend template grants an SR of CR+10, not Hit Dice + 10

The Drow race has an SR of 11+HD, I'd suggest you copy that instead.

Archmage
May 17th, 2010, 11:15 AM
Ah... how stupid of me not to notice hehe :o, thanks for the heads up :P

Mathias
May 17th, 2010, 11:38 AM
Looking at one of the lycanthrope templates in the editor, you'll see that one of the things they bootstrap is "Change Forms" - looking at that lycanthrope template in the regular Hero Lab window, you'll see that in the Activated Abilities list on the In-Play tab, the checkboxes to switch between normal, hybrid, and animal forms are on the "Change Forms" ability.

So, find that "Change Forms" ability on the Racial Special tab, and copy it.

Unlike this version, you don't need 2 different forms, so you can delete the "Activation #2 Name" - you will want to rename the "Activation Name"

Looking at the Eval Script for the Change Forms ability, most of the script deals with the fact that only one of the abilities can be active at once.

The important part you'll need is this line:


perform hero.assign[Hero.LyHybrid]


That places the Hero.LyHybrid tag on the hero.

Okay, let's create a new tag that can mark the activation of this ability. Leave the script window, and find the next-to-the-last option "User Tags". You'll edit that, and create a new tag, for example "MyTemplate" (figure out a name and Id that better relates to whatever you're trying to add).

User tags added that way are created in the Custom tag group - so you've just created the Custom.MyTemplate tag.

Now, you can use that tag in the script;


if (field[abilActive].value <> 0) then
perform hero.assign[Custom.MyTemplate]
endif


That means that if the ability is active, assign this tag to the hero. (the template and all its specials will look for that tag). Keep the timing of the script where it was, at First/0. Save this copy of the Change Forms ability with a new name, new Unique Id, and some new description text, and then press "Test Now!" (if you have made any copies of anything in the editor and not given them a new unique Id, delete them before testing or you'll get an error).


Now, to make use of that tag. Start by going to your template, and adding your variant of Change Forms to the bootstraps list on the template.

Now, re-open one of the lycanthrope templates, and look at the bootstraps button. You'll see that for many of the things listed there, including the natural attacks, the "Condition" button is highlighted.

Click on one of those Condition buttons, and you'll see that they use a timing of First/100 (after the script on the Change Forms ability that sets the tag), and an expression of "Hero.LyHybrid" (or "Hero.LyAnimal | Hero.LyHybrid" for the abilities that are gained in hybrid or animal forms).

On your template, go into the bootstraps list, and for each ability/tentacle attack that's only available while active, enter a new condition. Use a timing of First/100, like the Lycanthrope, and for the body of the condition, enter


Custom.MyTemplate


Save and Test your template (don't forget to delete the copied lycanthrope template before testing), and you should now have activation working for your template.

Archmage
May 17th, 2010, 01:24 PM
Thank you :). I appreciate it I really do, this had me quite frustrated!. And I learned some new tricks ;).

If you haven`t already this should be added to some sort of turtorial!.

Keep up the good work with herolabs!