Senior Member
Join Date: May 2013
Posts: 1,458
|
A loooooong time ago, I posted a validation script that used if/then/elseif logic which assigned a value of either @valid=0 or @valid=1.
You admonished me for writing a validation script in that manner, and told me to use validif instead. You asked me where I got the idea to write such a funky script, and while I assured you I got it from an official example, I could not (at the time) recall where, nor did my searches net any results. However, I can now present you with this: http://hlkitwiki.wolflair.com/index....alidate_Script Scroll to the bottom. I just wanted you to know that I'm not crazy. :-p (Well, I am, but just not on this point.) |
#1 |
Senior Member
Join Date: Aug 2013
Posts: 123
|
Quote:
|
|
#2 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
I still use @valid for logic but I admit its usually for more complex IF statements or ones I have to validate multiple values. If its simple I do prefer the validif() as its easy.
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. |
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
I'm not sure exactly what I said in whatever you were originally referring to, but if I recommended validif as opposed to if () then @valid = 1 endif, it was not intended to admonish - I intended it to save you typing while you work. What you've linked to here is a teaching script - this script is showing all of its work, so the reader can see the whole process of how @valid works, instead of just seeing the validif ().
Maybe you're referring to something else I don't recommend doing - there are several places in d20 (some of which made it into Pathfinder), where a prereq starts with @valid = 0 Which is just setting a value to what the value was already set as a default, which makes that line of code redundant. Last edited by Mathias; September 19th, 2017 at 01:16 PM. |
#4 |
Senior Member
Join Date: May 2013
Posts: 1,458
|
Quote:
Well ... because I read the wiki. :-p |
|
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
Quote:
Like Mathias said old script logic in d20 uses @valid allot. Heck it also uses the result = logic instead of perform but both will work. Something that is easy to forget is how frustrating it is to learn scripting. This is what myself and those teaching need to keep in mind. But human nature is such that once you climb that hill you sort of forget the pain of the climb. 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
Join Date: May 2013
Posts: 1,458
|
Quote:
I can imagine what things are like from your side of the table. I'm sure you field a lot of questions where even though it's the first time that particular person is asking, it's the 1000th time for you. I get that. I also get that you don't want yourself and other LWD coders to fall into the trap of being the effective co-author of everyone's pet project. So, don't take me too seriously here. Just having some fun. :-) |
|
#7 |
|
|