Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - d20 System

Notices

Reply
 
Thread Tools Display Modes
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 25th, 2012, 09:27 PM
I will use this thread to place some of my standardized coding for the d20 system for those who are interested in seeing 1) how things can be done for their own games and 2) provide a better understanding of how to code in HL. There may be some things that I do that are a bit unconventional, but when I get something to work in this way, it's usually because it becomes more streamlined, efficiently reduces repetitive code, or is a more common sense approach to the problem. I will update this with a variety of code and methods over time, so keep an eye on this thread as I will try to consistently update it.

One last note. This thread is for those that want to edit how their own game operates, and strictly refers to things that can be standardized in the Editor. This in no way is a guide to how one makes use of the character creation process in HL.

Now let's get started.
Kendall-DM is offline   #1 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 25th, 2012, 10:00 PM
Standardizing Spell-Like Abilities

One of my biggest concerns about Spell-Like abilities has been that the current method of creating them (in d20, Pathfinder has a system that actually has a tab for them, jelly) is very time consuming. Making each ability a Special with a charge attached to it just seems like alot of clutter. Creatures that have a vast number of SLAs create a glut on the Tactical Console (or even the In Play tab). After a great deal of experimentation, I came up with a method in which I only had to make one Special (the description of the SLA itself, with the list of spells) and then bootstrap the actual spells to it. It is still time consuming, because you have to make copies of the actual spells themselves to bootstrap to the SLA Special, but I streamlined it so that it's just a bit of copy and paste for the code. Here is the process.

First, you'll need two pieces of code. On my computer, I have this code in a text file in the background while I have HL open. Whenever I need it, I copy & paste it into the Editor.
Code:
<<Post-Attributes (Users) 5000>>
~ Livename the spell-like ability.   
if (field[sCastLeft].value = 99) then
  field[livename].text = field[name].text & " (at will)"
else
  field[livename].text = field[name].text & " (" & field[sCastLeft].value & "/day)"
endif

~ Check against daily castings.
field[sCastLeft].value -= field[sCastCount].value
Code:
<<Pre-Levels (Users) 10000>>
~ We need to have a caster level for spell-like abilities.
perform hero.assign[Hero.Caster]
Next, once you have these in a easy to access text file, you will need the spells. Note, once you make a spell available as a SLA, it can be reused by any other creature with a SLA (essentially, you don't have to make a new version, it counts for all SLAs no matter which creature has it). So, for each spell in the SLA of the creature, make a copy of that spell on the Spell tab, choosing the spell for the Sorcerer, then Bard, then Cleric, then any other spell class, in that order of priority (essentially, SLAs are closer to spontaneous casters than any other) until you find the spell. Use the copy button on the spell, give it an ID appropriately (I use sRacexxxx as the ID, but maybe you would use sSLAxxxx or something similar). Now go to tags and remove the sClass.<Class> tag from the spell (it will now list a Source of "-None-". Then copy and paste the first piece of code into an eval script with the supplied timing. Do this for each spell on the SLA list fo the creature (unless you've already done the spell previously).

Go to the Special tab, and create the SLA for the creature (you will have to make an SLA Special for each individual creature unfortunately). I always call the ability "Spell-Like Abilities" and select the Source as the creature race and designate the Ability Classification. I fill out the description as the creature has it (without the DCs), as in this example for a Drow.
Code:
1/day - {i}dancing lights{/i}, {i}darkness{/i}, {i}faerie fire{/i}; Caster level equals the drow's class levels. The save DCs are Charisma-based.
From there, copy & paste the second code above into the eval script with the specified timing. The tedious part is next, you now have to bootstrap each spell to the SLA Special, and for each spell that is bootstrapped click on the Fields... in the spell's bootstrap and insert sCastLeft with the number of times per day it can be cast in the Value box (enter 99 if the ability is at will).

Once that is done, you can bootstrap the SLA onto the creature it was made for. Now the SLAs will appear in the Spells list and no longer uses the Charges list to clutter up your Tactical Console.

Standardizing the SLAs in this way has cut waaay down on the amount of time it takes me to make the SLAs for creatures. The more spells I create for the SLAs reduces the amount of time I spend on future SLAs, since the spell I'm looking for can be re-used in any SLA, so the more I make, the less I have to make later. I tend to only make the ones I need (so I don't do every spell, just the spells I need).

One other note, there are some Supernatural abilities that often duplicate the effect of a spell. I don't recommend creating them the same way as SLAs, as they are better suited for making them Specials with Charges. Supernatural abilities are not spells. Stay tuned for more.

Last edited by Kendall-DM; January 26th, 2012 at 09:29 AM. Reason: Added a title for better organization.
Kendall-DM is offline   #2 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 26th, 2012, 09:40 AM
Standardizing Racial Bonuses

One trick I learned early on, is that many racial bonuses (usually circumstantial) find a home on more than one creature. Obviously, Elves tend to share the same racial skill bonuses, but sometimes a skill bonus is duplicated on more than one unrelated creature. To alleviate this, I started rewording the ability to say "You gain..." rather than the "A drow gains...". In this way, I am able to repeat using the ability between creatures without having to worry about making a whole new Special that does the same thing. I just make sure that the Source is left with "-None-" and assign a SpecSource for the creature that it is bootstrapped to. Furthermore, I use the following standard code for these bonues.
Code:
<<First 500>>
doneif (field[hIsOn1].value = 0)

~ Add our racial bonuses.
~ Code your bonuses here. Example: #skillbonus[kHide] += 4
Then I make sure the Show in Charges is checked and place "Active" in Charge Effect 1 box. Now you can add these bonuses in when the situation calls for it.

Things I have done this with, as an example of why I've done it this way, are: bonues to hit certain creatures, bonuses to AC against certain creatures, bonuses to saves, bonuses to skill checks in certain environments, and so forth.
Kendall-DM is offline   #3 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 26th, 2012, 09:54 AM
Standardizing Improved Grab

I have moved away from making an Improved Grab for every creature that has it. I know that each creature uses its Improved Grab differently from each other, but since you would have to code each instance of the Improved Grab anyhow, why not just code it on the creature itself by modifying it's descriptive text. That is what I did.

First off, I have this code tucked away on my background text file.
Code:
<<First (Users) 5000>>
~ Describe our improved grab ability.
hero.child[xImprGrab].field[CustDesc].text = "
<<place your creature specific descriptive text here>>{br}{vert 7}" & hero.child[xImprGrab].field[descript].text
Ok, now make a Special for Improved Grab, giving it whatever id you'd like. Go to the SRD for d20 and copy and paste the Improved Grab generic descriptive text (also found in the back of the MM). Give it an ability classification of Extraordinary and save/test it (don't script anything here, just save the generic description of the ability itself without the specifics of what natural attack needs to hit).

When a creature has this bootstrapped now, you can copy and paste the above coded text into your creature, filling in the descriptive part with the specifics needed for the creature to activate the improved grab (I usually just copy and paste from the d20SRD site). As a side note, I also tried doing this in the summary text (xSumm field), but found out quickly that most specifics on a creature for Improved Grab can be pretty long at times (the Behir comes to mind), so I just added it to the description instead.

There is alot of leeway on the timing for this, since it is not accessing anything critical to the timing. In essence, I just place this with something that I've already done code for as long as it is at or after First 5000.

Last edited by Kendall-DM; January 26th, 2012 at 10:15 AM.
Kendall-DM is offline   #4 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 26th, 2012, 10:15 AM
Standardizing a Breath Weapon

Once again, instead of making a breath weapon Special for each individual creature that has one, I instead made one Special that all creatures can access. Also, there is alot of flexibility with the code I'm providing, as each creature will determine it's breath weapon in a different way, so again, much like Improved Grab, I coded the specifics on the creature itself as part of its descriptive text. Here is the code on the background text file.
Code:
<<Post-Attributes (Users) 15000
~ Describe our breath weapon (usually this is CON).
DC = 10 + round(hero.tagcount[Classes.Race] / 2, 0, -1) + hero.child[aCON].field[aModBonus].value

hero.child[xBrthWpn].field[CustDesc].text = "<<place your creature specific descriptive text here>>{br}{vert 7}" & hero.child[xBrthWpn].field[descript].text

hero.child[xBrthWpn].field[xSumm].text = "<<describe the creature specific range, damage, and area of the effect>>"

hero.child[xBrthWpn].field[livename].text = hero.child[xBrthWpn].field[name].text & " (Reflex DC " & DC & " half)"

hero.child[xBrthWpn].field[hName1].text = "<<use this only if you have number of rounds needed before using it again>>"
Create your Breath Weapon Special, again copy and paste the generic ability description for it from the d20SRD site or the back of the MM, and make sure the Show in Special and Show in Charge is checked and the Ability Classification is Supernatural (leave the Source blank). Don't worry about putting something in the summary box, it will get overwritten anyhow. Save and test.

Here is where it gets a little tricky. Every creature's Breath Weapon is slightly different. Sometimes a breath weapon does a standard amount of damage, such as from a Behir or a Chimera. In these cases, its easy. Some breath weapons use a save other than Reflex, just be sure to edit that in the xSumm of the code. And some have variable dice for breath weapons. How you decide to code this in the creature's script specifically is up to you. This is just a way to standardize a breath weapon that can be used across creatures without having to make multiple ones in the Special tab.

Last edited by Kendall-DM; January 27th, 2012 at 11:42 AM.
Kendall-DM is offline   #5 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 26th, 2012, 10:34 AM
Standardizing Creature Types & Subtypes

Unfortunately, there is no hard and fast rule for this. I will just tell you what I did (which works for me, may not for everyone) for quickly getting types of creatures up and running. On the d20SRD site, and in the MM, creature types and subtypes have a series of traits (which, generally, though not always, are standard for those types of creatures). For example, animals have low-light vision (I don't enforce everything on the list, such as INT of 1 or 2), and that's about it needs. So I made a tAnimal (for Animal Type) Special that does two things. First, it bootstraps the Low-Light Vision, then I add a Type.Animal tag to the Special, and then assign the tag to the hero using the following code snippet in its eval script.
Code:
<<First 10000>>
~ Assign type to hero.
perform hero.assign[Type.Animal]
Next, under Source I create a new tag, which I called typeAnim and gave it the name "Animal". On the bootstrapped Low-Light Vision, I then SpecSource the ability to typeAnim.

So, with this method, you can now just bootstrap the tAnimal to the creature that is an animal, and you get the Low-Light Vision on the creature. Obviously, for animals its not that bad, since you really one need to bootstrap the one thing (Low-Light Vision) which is no different than bootstrapping the one thing (tAnimal), however some creature types have multiple bootstraps (such as Undead) that is much easier to create the tUndead type with all the bootstraps, and then when you make an undead creature, you can just bootstrap the tUndead to the creature and it brings them all along without you having to look for them each time you make one. Also, I've got some scripting I do with undead, like removing the CON score and so forth, but I won't go into the specifics here. It's just the way I standardized a process that was time consuming.

Furthermore, you can do the same with subtypes, such as Dwarf, Elf, Orc, Angel, Baatezu, etc. There is a mechanic in place for that to, as I id them as sDwarf (for subtype Dwarf for example) and add the tag Subtype.Dwarf. Type and Subtype are accepted tags for HL, and are references to the types and subtypes of a creature.

I've gone into far more complication than this, but I won't go into those details. I just wanted to show that such a thing can be standardized, and thus can save alot of time looking for bootstraps for creatures. You can even bootstrap on the Simple Weapon Proficiency for things like Humanoid (fSimple). Anyhow, that's creature typing in a nutshell, hope you will find it useful.
Kendall-DM is offline   #6 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 27th, 2012, 10:00 AM
Standardizing Constrict

This one is a bit tricky, because of the way I'm doing it. Essentially, I wanted to make the Constrict appear as damage, and so I made it into an attack, replacing the melee attack bonus with the grapple bonus. Here are the pieces of repeatable code you need for the text file in the background.
Code:
<<Final Phase 10010>>
~ Adjust constrict attack value.
hero.child[<<choose a blunt natural attack>>].field[wAttack].value = hero.child[Attack].field[tGrapple].value
Code:
<<Final Phase 500001>>
~ Describe our constrict ability.
hero.child[xConstrict].field[xSumm].text = "Deal " & hero.child[<<chosen natural weapon>>].field[wDamageTbl].arraytext[0] & " damage on a successful grapple."
hero.child[xConstrict].field[CustDesc].text = "<<descriptive text which states this creature deals... >> " & hero.child[<<chosen natural weapon>>].field[wDamageTbl].arraytext[0] & " points of damage with a successful grapple check. <<remaining descriptive text>> {br}{vert 7}" & hero.child[xConstrict].field[descript].text
First you create the Constrict special, using just the description of it from the d20SRD or the back of the MM, with a standard summary. Since this will all be placed in the attack tab, and the description added to from the creature itself, you don't have to do anything more than give it the Extraordinary Ability Classification. Save it and test it.

Now, when you create the creature, choose a natural weapon that does bludgeoning damage. Under the bootstrap of this attack, click on Fields... and add a livename with a Value of "Constrict". That chosen natural attack id is what goes into the code above at the specified places. The timing is crucial if you want your descriptive text to display the damage that is dealt by this special attack under Specials. And that's pretty much it.

Note, nothing is really too standard here, as sometimes the constrict comes with an additional attack (such as rake for the Behir). Just remember to add it into the summary and descriptive text.

You can do the same thing with Rake attacks, since Rake attacks are on the natural attack list. In this case though, I have no code, I just have a standardized general description of how rake operates (again, from d20SRD or the back of the MM) and just have Rake in the attack tab. Just be sure to make the Rake a primary attack, since it almost always gets the full attack bonus.
Kendall-DM is offline   #7 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 27th, 2012, 10:25 AM
Standardizing Poison

The method I describe here can also apply to disease, or any number of similar effects. What you do is, you make a poison Special, generalized as per the d20SRD or the MM, and use the following code.
Code:
<<Post-Attributes (Users) 15000>>
~ Set our saving throw DC for poison.
var DC as number
foreach pick in hero from BaseRace
  DC = 10 + round(each.field[rHitDice].value / 2, 0, -1) + hero.childfound[aCON].field[aModBonus].value
nexteach
field[livename].text = field[name].text & " (Fort DC " & DC & " neg.)"
Put the above code in the eval script for the poison Special. Then put the following script onto the creature itself.
Code:
<<First 5000>>
~ Describe our poison damage.
hero.child[xPoison].field[xSumm].text = "<<short description, such as: Injury, 1d6 Str intial and secondary damage."
Of course, if the short description does not suffice, you can still append to the CustDesc as described in previous coding posts above. Pretty simple.
Kendall-DM is offline   #8 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 27th, 2012, 10:34 AM
I think this gives a general idea on how to approach the variety of things that can be standardized. Things I didn't cover are Disease, Rage, Rend, Smite, Summon, Swallow Whole, Trip, etc. that are all effects that, while different for each creature, are basically handled the same way each time. What standardization does, is make your job a bit easier, but also makes the work down the road less complicated. I started doing this because, I needed a way to indicate is something had Improved Grab (for Multigrab from Savage Species) without having to search for all the different types each creature gets and without having to remember to place a user tag on each one. Now I can just pre-requisite it with a reference (in my files) to xGrab. By the same token, Smite was handled similarly so that I could have an easier way to pre-requisite Extra Smiting. And so forth.

There are other projects I am working on the standardize abilities that are extremely tricky to code. Like Change Shape and Alternate Form. While I haven't succeeded yet, I feel I can get these to work with a drop down list to change the creature's form temporarily through a charge activation. Anyhow, that's standardization in a nutshell. Good luck!
Kendall-DM is offline   #9 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Overland Park, Kansas
Posts: 1,217

Old January 27th, 2012, 11:41 AM
Oh, stupid me. I was looking at an older text file when I pasted here. Replace the following snippets of code...
Code:
foreach pick in hero from BaseRace
  DC = 10 + round(each.field[rHitDice].value / 2, 0, -1) + hero.childfound[aCON].field[aModBonus].value
nexteach
... with this much more efficient code...
Code:
DC = 10 + round(hero.tagcount[Classes.Race] / 2, 0, -1) + hero.childfound[aCON].field[aModBonus].value
Kendall-DM is offline   #10 Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:52 AM.


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