Member
Join Date: Aug 2008
Posts: 74
|
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? |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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. |
#2 |
Member
Join Date: Aug 2008
Posts: 74
|
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 |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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:
Quote:
This is allot of the basic information you would get from the videos. Quote:
In example lets assume Elfs can't be Inquisitor's Code:
#hasrace[rElf] + hero.tagis[Classes.Inquisito] <> 2 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. |
|||
#4 |
Member
Join Date: Aug 2008
Posts: 74
|
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. |
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Quote:
Quote:
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. |
|||
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
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) 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 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. |
#7 |
Member
Join Date: Aug 2008
Posts: 74
|
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?
|
#8 |
Member
Join Date: Aug 2008
Posts: 74
|
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 |
#9 |
Senior Member
Join Date: Mar 2007
Location: Muskegon, MI
Posts: 2,975
|
@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.
|
#10 |
|
|