Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
dartnet
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2007
Posts: 591

Old September 1st, 2014, 08:55 AM
How would I script this?
dartnet is offline   #1 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old September 1st, 2014, 09:07 AM
You could either do:
Code:
hero.tagis[Edge.edgTDNCO] + hero.tagis[Edge.edgTDOffic] <> 0
For every combat Edge (seems like a lot to list, though, and you'll miss any if you happen to add one later.)

Or set up a variable to act as a counter, step through Edges just like you would when stepping through Knowledge skills, and check for the Edge type (I'm not sure of the syntax on that but I can try to find it tomorrow) and increment the variable by 1 each time it finds a Combat one. Then you just set a validif for the variable being > 1 and drop out of the foreach loop.

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   #2 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old September 1st, 2014, 09:10 AM
So, you mean how to make it be "Any 2 Combat Edges"? That would need to reference an eachpick where Edge is EdgeType.Combat.

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #3 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old September 1st, 2014, 09:44 AM
OK, I got it if you mean "Any 2 Combat Edges"

Make a Pre-reqs
Message is "Requires any 2 Combat Edges."
Code:
        var total as number
        total = 0

        ~Make sure at least two Combat Edges exist.
          foreach pick in hero where "EdgeType.Combat"
              total += 1
          nexteach

        ~if we have at least two valid edges, we're valid
        validif (total >= 2)

        ~if we got here, we're invalid
        if (@ispick <> 0) then
          altpick.linkvalid = 0
          endif

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.

Last edited by SeeleyOne; September 1st, 2014 at 10:22 AM. Reason: Oops, I had left in commented-out code
SeeleyOne is offline   #4 Reply With Quote
dartnet
Senior Member
Volunteer Data File Contributor
 
Join Date: Jan 2007
Posts: 591

Old September 1st, 2014, 10:42 AM
Thanks.
dartnet is offline   #5 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old September 2nd, 2014, 11:58 AM
I think you can simplify that a bit. Maybe something like:

Code:
        var total as number
        total = 0

        ~Make sure at least two Combat Edges exist.
          foreach pick in hero where "EdgeType.Combat"
              total += 1
             if (total >= 2)
                validif (total >= 2)
                done
             endif
          nexteach

        ~if we got here, we're invalid
        if (@ispick <> 0) then
          altpick.linkvalid = 0
          endif
That "done" should get your dropped out of the code a lot quicker if it gets there. I'm also not sure you should bother including the whole "if (@ispick <> 0) then" section since is stays invalid unless it's forced valid by the validif line, but there could be some completely other reason for that of which I'm utterly unaware (which is entirely likely, mind you).

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   #6 Reply With Quote
Reply

Thread Tools
Display Modes

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:54 PM.


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