Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Pathfinder Roleplaying Game
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
athelu
Member
 
Join Date: Aug 2008
Posts: 74

Old April 25th, 2016, 10:30 AM
Hello,

I would like to be able to prevent certain races in my game from being able to take certain classes. my search-fu did not reveal anybody else looking to accomplish this. Any help?
athelu is offline   #1 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old April 25th, 2016, 11:18 AM
You have two ways of doing this:

a) You overwrite the existing classes or Race using Replace Thing ID and setup Pre-Req scripts that gives an error/warning message. This has the advantage of looking really nice in the selection process and getting the warning message to your players as they are picking races/classes. The really bad part is by using Replace Thing ID will cause issues with any class/race outside of CORE (cause of copyright). You will also run into issues down the road because any "fixes" to the replaced classes/races by LW will not longer be available to you and your players.

b) Create a new Mechanic and bootstrap new Simple Things to the Mechanic. Have each Simple Thing represent a single "Race" and then setup Pre-Req so that if Race X is taken with Class Y to give a warning message. Note the issue is that the message will ONLY appear "After" a player has taken both the class/race combo. The good side of this is you won't have to worry about copyright races/classes. WAY easier to maintain and setup and future fixes to classes/races will still happen for you and your players.

And assuming NOTHING above makes any sense to you I would recommend reading the Glossary of Terms for the Editor. Then check out FAQ#2 for all the places to learn about the editor including YouTube videos.

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   #2 Reply With Quote
athelu
Member
 
Join Date: Aug 2008
Posts: 74

Old April 25th, 2016, 12:52 PM
Thanks for the help. I am aware of these tools in the editor, but as of yet have not needed to use them.

Taking a look at one of the examples I found, I have the following:

if (hero.tagis[israce.rdwarf] = 1)

This however gives me an error saying "group israce not defined"

Last edited by athelu; April 25th, 2016 at 01:50 PM. Reason: did more testing
athelu 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 April 25th, 2016, 01:46 PM
Quote:
Originally Posted by athelu View Post
if (hero.tagis[race.dwarf] <> 0)
The basic syntax is correct but HL cares about capitalization. So its "Race.rDwarf". "rDwarf" is the unique id of the Dwarf Thing.

Macros are your friend here and you can do:
Code:
if (#hasrace[rDwarf] = 0) then
Quote:
Originally Posted by athelu View Post
this should evaluate the current portfolio to see if the race is set to dwarf (I think).
What I am unsure of, is if I have built the field/content correctly. When I use the "findthing" button, and locate the race, it gives me something different (rDwarf). so, should I be using rDwarf? or is that a different way to reference the object?

I am wondering where I may find the canonical naming for these. Or better yet, even a list of the actual fields on the character. I have done a bit by picking out examples that already live in the system to lean some naming syntax for my custom items, but when it comes to some of the core items for the game system I am not sure where to find them.
All this is covered in the videos or FAQ#9. Basically turning on and using debug tools.

Quote:
Originally Posted by athelu View Post
Outside of that and returning to the question at hand. You suggested that I create a simpleThing ( I think this is the Simple tab). There are a number of options - and I see you suggested using Pre-Reqs to perform this. I assume there is a reason this is preffered, and not the eval scripts, or Eval Rule?
Figured its easier to setup if each Race is its own Simple Thing. I say Pre-Req as they are easy to use instead of Eval Rules. You don't need the added power of Eval Rules. And we are doing pre-req logic so Eval Scripts won't help you.

This is allot of the basic information you would get from the videos.


Quote:
Originally Posted by athelu View Post
Should I create a Pre-req for each class combination for the race, or would it be ok to just use a single if statement to test all of the possible offending classes?
On each Simple Thing I would do one Pre-Req per Class/Race combo.

In example lets assume Elfs can't be Inquisitor's
Code:
#hasrace[rElf] + hero.tagis[Classes.Inquisito] <> 2
Then you can add multiple Pre-Req like the above to take into account each situation.

To explain the above code some:
#hasrace[rElf] - This is a macro that tests for the presence or absence of the Race.rElf tag on the hero (ie character). The macro returns a Boolean of true (1) or false (0).

+ - We want to add the results of our two "functions" together to see if they are "both" true (ie 2).

hero.tagis[Classes.Inquisito] - Test for the presence or absence of the Classes.Inquisito tag on the hero. This function returns a Boolean of true (1) or false (0).

<> 2 - A Pre-Req is always setup to display the "error" on a condition that is not valid. If we are NOT 2 then we will not display what is in the "message" section of the pre-req.

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
athelu
Member
 
Join Date: Aug 2008
Posts: 74

Old April 25th, 2016, 02:20 PM
Thanks, this helps a lot. I have started digging through the videos and have started using the debug tools which has gotten me a bit further.

Interestingly enough though I get "unspecified error parsing script" when trying what you put in the code block.

You mentioned this is a macro, which is great. The documentation also said macros could be found on the Menu, but this does not appear to be the case anymore. Is there someplace where all the Macros are listed?

Also - is there preference in using fields vs tags? I see in my testing that many of these overlap and I could go to either a tag or field for the information.
athelu is offline   #5 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old April 25th, 2016, 03:11 PM
Quote:
Originally Posted by athelu View Post
Interestingly enough though I get "unspecified error parsing script" when trying what you put in the code block.
Hmmm. I am not any where near HL so its possible I told you the wrong section to put the script into. I can double check once I am home. Some times I mix up the names...

Quote:
Originally Posted by athelu View Post
You mentioned this is a macro, which is great. The documentation also said macros could be found on the Menu, but this does not appear to be the case anymore. Is there someplace where all the Macros are listed?
Yeah I think the list was removed. I use a google sheet that AndrewD2 put together HERE. He does a good job of keeping it updated.

Quote:
Originally Posted by athelu View Post
Also - is there preference in using fields vs tags? I see in my testing that many of these overlap and I could go to either a tag or field for the information.
That is sort of a complex question. Tags are very powerful and should be used more than a field on average. But many times the value you need is easier to use a field. It sort of depends on WHERE you are running.

In example if I know I am writing a script on a Class Ability that is bootstrapped to a class I can simply access the field[xAllLvl].value to get the classes level. This is preferred because then the Class Ability is more generic and could be bootstrapped to a several different classes. In addition its less CPU to count the Classes.? tag on the hero.

Sorry don't have a really good answer to this one....

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   #6 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old April 25th, 2016, 09:01 PM
Quote:
Originally Posted by ShadowChemosh View Post
Code:
#hasrace[rElf] + hero.tagis[Classes.Inquisito] <> 2
Yeah my bad! The above type of Pre-Req script goes on a "Expr-Reqs" section not the "Pre-Reqs" section. Expr-Reqs are the short simple way of doing error checking. You put in the basic script above and a "Message" and away you go.

For Pre-Reqs you would write the above like:
Code:
validif (#hasrace[rElf] + hero.tagis[Classes.Inquisito] <> 2)
Or like this:
Code:
~ Default to valid
@valid = 1

~ If we are an Elf and Inquisitor we are invalid
If (#hasrace[rElf] + hero.tagis[Classes.Inquisito] = 2) then
  @valid = 0
endif
Basically a Pre-Req gives you more power and flexibility in doing error checking as you can write full script logic with If/Then/Elseif logic.

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   #7 Reply With Quote
athelu
Member
 
Join Date: Aug 2008
Posts: 74

Old April 26th, 2016, 08:48 AM
ew. kinda stinks that things are handled differently in the various tools. Can I use the validif with then statements as well? or do I just drop to a if then?
athelu is offline   #8 Reply With Quote
athelu
Member
 
Join Date: Aug 2008
Posts: 74

Old April 26th, 2016, 08:54 AM
ew. kinda stinks that things are handled differently in the various tools.

Can I use the validif with then/else statements as well? or do I just drop to a if statement instead?

And the message box is triggered when the state is determined to NOT be valid, correct? So any statement I create that does not meet the test results displays the message box. Just want to make sure I am understanding this correctly.

So here, 1=true, 0=false.

Code:
~ Default to valid
@valid = 1

~ If we are an Elf and Inquisitor we are invalid
If (#hasrace[rElf] + hero.tagis[Classes.Inquisito] = 2) then
  @valid = 0
endif
and the @ lets us declare a variable on the fly, that we can update, correct? Is this variable persistent for the time the characters is open? Or only during the time the check is performed? are these global variables that could be updated by other scripts/checks? Just trying to understand if I should be clearing them out or not.
athelu is offline   #9 Reply With Quote
AndrewD2
Senior Member
 
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975

Old April 26th, 2016, 10:47 AM
@valid is a special variable predefined in Hero Lab. There is also @ispick which is 1 if the item is on the character and 0 if it hasn't been selected yet.
AndrewD2 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:49 AM.


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