Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old January 4th, 2013, 12:46 PM
I've been looking at how to handle either/or situations for a pre-requisite and it looks like the best way is with a script. One example I found was for a Blood and Guts edge that has a Message set to "Fighting d10, Shooting d10 or Throwing d10 required." and a Pre-req code of:

Code:
        validif (#traitfound[skFighting] >= 5)
        validif (#traitfound[skShooting] >= 5)
        validif (#traitfound[skThrowing] >= 5)

        if (@ispick <> 0) then
          altpick.linkvalid = 0
          endif
Now it seems to me that the"validif" statements would be all that's needed. Does anyone know what the if statement at the end is for?

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #1 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old January 4th, 2013, 01:15 PM
I think what it does is check for the first one and if found, it valids that pick and ends if not it goes to the alt pick which is the second one and if the second one isn't found moves on to the third, but that is just a guess as to the way it looks to me.
jbearwillis is online now   #2 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old January 4th, 2013, 01:24 PM
Except that it would have already dropped through all of those before getting to the if statement.

It seems instead like the if is if any of those was a valid pick then set "altpick.linkvalid" to 0 otherwise none of the above was satisfied to set that to 1 (or true, if you will.) I guess I'm just not sure what altpick.linkvalid is even supposed to be used for. The wiki is just not clear enough on it for me to figure out why someone would write it this way. I'm just not seeing what was being alternately picked here, I guess?

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #3 Reply With Quote
jbearwillis
Senior Member
 
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797

Old January 4th, 2013, 01:37 PM
Yes the wiki is a little confusing on how it reads to me, but I'm not really a coder, so I get lost a lot when I go looking for something, All I know is that it works because I used it on one of my edges LOL, though I would like to know why some of this codes work - it would be nice.
jbearwillis is online now   #4 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old January 4th, 2013, 01:39 PM
Well, I've used the validif lines in stuff before without the additional if part and it all seemed to work just fine so that's why I was wondering what the extra if statement was supposed to be for.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #5 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,552

Old January 7th, 2013, 10:59 PM
I hate to say it, but I don't know.
CapedCrusader is offline   #6 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old January 8th, 2013, 05:02 AM
I may stick with not bothering to add the extra lines then. I suppose if any of us start seeing problems from not using them then that might tell us why someone else had decided to use them.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #7 Reply With Quote
rob
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 8,232

Old January 8th, 2013, 05:12 AM
The lines at the bottom provide different handling for "picks" versus "things". If the item is a pick (i.e. has been added to the character by the user), whatever it's linked to is marked as invalid. This causes it to be highlighted in red within the UI.

If the item is a thing (i.e. presented in list for the user to select and add, but not yet added), then the logic is not applied. The reason for this is "altpick" is only supported on picks (what a surprise!), so attempts to use it on a thing will report an error.

So the net effect of the logic is to make sure that any linked pick is properly flagged as invalid and therefore highlighted in red for the user.

Hope this helps!
rob is offline   #8 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old January 8th, 2013, 05:17 AM
I think I see. So it's likely good practice to add the code for error trapping? I may have to go back and do that one some of my data files, then.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #9 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 08:08 AM.


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