Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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 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) |
#1 |
Senior Member
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797
|
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.
|
#2 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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) |
#3 |
Senior Member
Join Date: Dec 2009
Location: Independence, Mo
Posts: 797
|
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.
|
#4 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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) |
#5 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,552
|
I hate to say it, but I don't know.
|
#6 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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) |
#7 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 8,232
|
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! |
#8 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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) |
#9 |
|
|