Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Savage Worlds (http://forums.wolflair.com/forumdisplay.php?f=59)
-   -   Another scripting question. (http://forums.wolflair.com/showthread.php?t=57672)

dartnet February 12th, 2017 07:38 AM

Another scripting question.
 
How would you script it so lets say an edges needs Knowledge: Science, Navigation, or Occult at a d6?

SeeleyOne February 12th, 2017 10:48 AM

Ah, this is a reason why I stopped making players fill in their Knowledge skills six years ago. I figured out what Knowledge skills were needed, by definition being those that are asked for by an Edge, and I made it be a skill. Then I modified Scholar to account for it. I also added in a few more. Not all of them get used every single campaign, but they are there and it makes times like this really easy. The other reason is that it is annoying to have to fill out the knowledge field every time. Plus, I can easily have a race add a specific knowledge.

So, I would script them like any other three skills.

You get to go through the validation rigamarole and make it look for those three skills, and if it has them, add to the count. Offhand, I think that Tactician does it for Knowledge: Battle. You would copy that, and make three parts to look for those instead of Knowledge: Battle.

You are lucky that it is for an "or". If it was an "and", you get to have three versions of the script, one per knowledge skill.

CapedCrusader February 12th, 2017 04:25 PM

How about this?

Code:

      var totalcount as number
      totalcount = 0
      foreach pick in hero where "thingid.skKnow"
          if (compare(lowercase(eachpick.field[domDomain].text),"science") = 0) then
            if (eachpick.field[trtFinal].value >= 3) then
              totalcount += 1
              endif
          endif
          if (compare(lowercase(eachpick.field[domDomain].text),"occult") = 0) then
            if (eachpick.field[trtFinal].value >= 3) then
              totalcount += 1
              endif
          endif
          if (compare(lowercase(eachpick.field[domDomain].text),"navigation") = 0) then
            if (eachpick.field[trtFinal].value >= 3) then
              totalcount += 1
              endif
          endif
        nexteach
      validif (totalcount >= 1)

A little clunky, I'll admit, but it should work. And if you wanted to check if it was two of them, change the (totalcount >= 1) to (totalcount >= 2), or 3 for all 3.


All times are GMT -8. The time now is 04:22 PM.

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