Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 18th, 2017, 11:58 PM
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.)
EightBitz is offline   #1 Reply With Quote
jfrazierjr
Senior Member
 
Join Date: Aug 2013
Posts: 123

Old September 19th, 2017, 04:15 AM
Quote:
Originally Posted by EightBitz View Post
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.)
LOL.... we all know that the wiki is woefully out of date, last being updated somewhere around 8-9 years ago. Sadly, they don't have the resources to update even simple errors which have been pointed out over the years and can't or won't open up the wiki to a small subset of trusted data file authors to correct and extend the existing information.
jfrazierjr is offline   #2 Reply With Quote
ShadowChemosh
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729

Old September 19th, 2017, 12:49 PM
Quote:
Originally Posted by EightBitz View Post
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.
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.
ShadowChemosh is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 19th, 2017, 01:14 PM
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.
Mathias is offline   #4 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 19th, 2017, 01:19 PM
Quote:
Originally Posted by ShadowChemosh View Post
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.
Sure. It's just a little bit frustrating for someone who's just starting out on trying to grapple with the complexity of the authoring kit when most newb questions are met with "read the wiki", and when one does read the wiki, is asked, "why are you doing it that way when there's a better way?"

Well ... because I read the wiki. :-p
EightBitz 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 September 19th, 2017, 03:20 PM
Quote:
Originally Posted by EightBitz View Post
Sure. It's just a little bit frustrating for someone who's just starting out on trying to grapple with the complexity of the authoring kit when most newb questions are met with "read the wiki", and when one does read the wiki, is asked, "why are you doing it that way when there's a better way?"

Well ... because I read the wiki. :-p
Totally true statement. When I am teaching people at work sometimes I let in logic that is not the most streamlined. Which is the difference between using @valid and validif(). Its cleaner and shorter to use validif() but HL will work just fine if you use @valid. Nothing 'logically' wrong with @valid its just nicer to use validif().

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.
ShadowChemosh is offline   #6 Reply With Quote
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 19th, 2017, 05:30 PM
Quote:
Originally Posted by Mathias View Post
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.
Not a big deal. I just wanted to tease you a little bit. :-p

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. :-)
EightBitz is offline   #7 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 09:46 PM.


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