Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > Hero Lab Discussion
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
javadragon
Member
 
Join Date: Aug 2010
Posts: 50

Old June 11th, 2014, 04:29 AM
I am working with alientude's beast/plant/elemental shape files. There are some things that I want to edit/add to his files to make it more complete. The big thing that I want to add to each beast/plant/elemental shape is the polymorph size change table:

Code:
~ adjust the stats for size changes per polymorph spell
~ hero.tagis[Size.Tiny]
if (herofield[tSize].value = -4) then
    hero.child[aSTR].field[Bonus].value += 6
    hero.child[aDEX].field[Penalty].value -= 6
~ hero.tagis[Size.Diminutive]
elseif (herofield[tSize].value = -3) then
    hero.child[aSTR].field[Bonus].value += 6
    hero.child[aDEX].field[Penalty].value -= 4
~ hero.tagis[Size.Tiny]
elseif (herofield[tSize].value = -2) then
    hero.child[aSTR].field[Bonus].value += 4
    hero.child[aDEX].field[Penalty].value -= 2
~ hero.tagis[Size.Large]
elseif (herofield[tSize].value = 1) then
    hero.child[aSTR].field[Penalty].value -= 4
    hero.child[aDEX].field[Bonus].value += 2
    hero.child[aCON].field[Penalty].value -= 2
~ hero.tagis[Size.Huge]
elseif (herofield[tSize].value = 2) then
    hero.child[aSTR].field[Penalty].value -= 8
    hero.child[aDEX].field[Bonus].value += 4
    hero.child[aCON].field[Penalty].value -= 4
~ hero.tagis[Size.Gargantuan]
elseif (herofield[tSize].value = 3) then
    hero.child[aSTR].field[Penalty].value -= 12
    hero.child[aDEX].field[Bonus].value += 4
    hero.child[aCON].field[Penalty].value -= 6
~ hero.tagis[Size.Colossal]
elseif (herofield[tSize].value = 4) then
    hero.child[aSTR].field[Penalty].value -= 16
    hero.child[aDEX].field[Bonus].value += 4
    hero.child[aCON].field[Penalty].value -= 8
endif
However, I do not want to add this logic to each and every shape. I am wondering if I can create a method/function in file so that I can just call this method/function like I do for SizeChange?
javadragon is offline   #1 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old June 11th, 2014, 09:39 AM
In a word, no. There are the built in calls, but I'm not aware of any way to design your own function call.
Kendall-DM is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old June 11th, 2014, 09:56 AM
Here's the page in the authoring kit wiki that describes the Procedure elements: http://hlkitwiki.wolflair.com/index.php5?title=Procedure_Element_(Data)

(If the link fails to work, edit the address to add a close parentheses - the link autodetect on this forum doesn't include those in auto-detected links, and my manual creation of the link might not work correctly)

You'll need to create it by editing the XML - there's no editor tab for them at this time.
Mathias is offline   #3 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 11th, 2014, 12:33 PM
@javadragon several things to help or know.

1) I am working on a new version of the Beast Shape adjustment that is going to do allot of what your doing plus I think more. I will have a new tab in the editor for easily setting up new animals with a few mouse clicks and choices. Then the Beast Shape adjustment will have a drop down that lets you select the animal and sets all the correct values based on which Beast Shape you are using. I am 90% done and then I had planned to pass it off to Bodrin who volunteered to do the data entry for some of the animals. I hope with the addition of a Editor Tab and help it should be really easy for most groups to add new animals if they wish.

2) If you wish for examples of some Procedures to work off of the community packages have a bunch. My adjustment addon if you install it and open the .user file with a textpad/notepad++ you will find several procedures at the very top of the XML. Also note the Paths of War and Community Bestiary make heavy use of procedures also.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #4 Reply With Quote
javadragon
Member
 
Join Date: Aug 2010
Posts: 50

Old June 11th, 2014, 06:17 PM
ShadowChemosh,

I am intrigued by your work.

I was working on code to know what level of Beast Shape you were casting to automatically add the abilities to the animal automatically. This way there would be 1 entry per animal instead of multiple for an animal that gets abilities at different spell levels. However, it sounds like you are doing a lot more. It seems that I should stop and wait for your work.

I will take a look at the links you and Mathias sent me to learn more and I look forward to seeing your work.

Thank you all for such quick responses.
javadragon is offline   #5 Reply With Quote
javadragon
Member
 
Join Date: Aug 2010
Posts: 50

Old June 12th, 2014, 04:56 PM
Another sub question to this, as I cannot find this on the page. Can/how do I pass values or variables to a procedure?

I see that for SizeChange I do this:
Code:
sizemod = -1
call SizeChange
I am assuming that somehow sizemod, which is being defined locally in the beast shape, is somehow being passed into the SizeChange. I have tried just using the variable that I want to use in the procedure without declaring it, but that has failed me.
javadragon is offline   #6 Reply With Quote
javadragon
Member
 
Join Date: Aug 2010
Posts: 50

Old June 12th, 2014, 06:11 PM
Nevermind, I think just declaring the variable in the procedure (as well as before calling it) allows the value to be set. I thought the double declaration would be an error, but I guess not.
javadragon is offline   #7 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 12th, 2014, 09:44 PM
Quote:
Originally Posted by javadragon View Post
Nevermind, I think just declaring the variable in the procedure (as well as before calling it) allows the value to be set. I thought the double declaration would be an error, but I guess not.
Yep that is how you do it. Yea its a bit strange if your use to other programming languages but it works.

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #8 Reply With Quote
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old June 14th, 2014, 08:14 AM
Wait... you can do procedures by adding them to the XML? Argh! I could have really used this knowledge some time ago. I've got a bunch of duplicated code that I could have just added procedures for.

Is there any way to make a procedural call occur automatically based on tag criteria? I notice that several things in HL are leveraged this way, and I would love to be able to do that as well.

Also, is there a way to add to tag component lists, or to add new tag components? I though someone some time back said it could be done, but now I can't recall for sure.
Kendall-DM is offline   #9 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old June 16th, 2014, 10:11 AM
Quote:
Originally Posted by Kendall-DM View Post
Wait... you can do procedures by adding them to the XML? Argh! I could have really used this knowledge some time ago. I've got a bunch of duplicated code that I could have just added procedures for.
Yep they work out really well for exactly this.

Quote:
Originally Posted by Kendall-DM View Post
Is there any way to make a procedural call occur automatically based on tag criteria? I notice that several things in HL are leveraged this way, and I would love to be able to do that as well.
You could sort of do this in Pathfinder but not d20. The way LW is doing it is adding the scripts/procedure directly to the Component and so when a component becomes live like a "BaseRace" those scripts fire.

In Pathfinder I would recommend using a Mechanic to simulate this idea as the mechanics could have scripts with "doneif" that stop them from firing unless a tag is found on the hero.

Quote:
Originally Posted by Kendall-DM View Post
Also, is there a way to add to tag component lists, or to add new tag components? I though someone some time back said it could be done, but now I can't recall for sure.
If you mean new "tag" Groups then yes I am not 100% sure what you mean by "tag component" as in HL terms those are separate entities.

So lets say you wanted to add a new group of tags like "Kendall.?" it can be done using a .1st file and outside the editor.

Here is a basic example where I add a new group called PathOfWar:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<document signature="Hero Lab Structure">
<!--

March 1, 2013 - Tim Shadow
-Broke out the tags to its own .1st file to make maintenance easier.

-->
<!-- ============================================== -->
<!-- CUSTOM GROUPS AND TAGS FOR PATHS OF WAR        -->
<!-- ============================================== -->
  <!-- Path of War custom tags -->
  <group id="PathOfWar" name="Path of War">
    <value id="Config"      name="Configurable"/>
    <value id="selDisc"     name="Configurable"/>
    <value id="Manuever"    name="Manuever"/>
    <value id="ManueverOn"  name="Manuever Readied"/>
    <value id="Class"       name="Class"/>
    <value id="Stance"      name="Stance"/>
    <value id="StanceOn"    name="Stance Activated"/>    
    <value id="StanceUp"    name="Stance Allowed Up"/>
  </group>
</document>

Hero Lab Resources:
Pathfinder - d20pfsrd and Pathfinder Pack Setup
3.5 D&D (d20) - Community Server Setup
5E D&D - Community Server Setup
Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources.
Created by the community for the community
- Realm Works kickstarter backer (Alpha Wolf) and Beta tester.
- d20 HL package volunteer editor.
ShadowChemosh is offline   #10 Reply With Quote
Reply


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 01:57 PM.


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