• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

if/then on adding an Edge?

zarlor

Well-known member
Ok, I know this is probably something really simple that I'm just too dense to figure out, but working on the Pirates of the Spanish Main setting I've hit a wall on implementing the Admiral/General Edge. What I need to do is check if they have the Noble Edge (edgPMNoble, I have a setting specific version) and if they have it to give them 15 Fame. If they d not have it then I want to Bootstrap it in for them and add 10 Fame.

So it seems the code should look something like this:

Code:
   if (valid hero#Edge.edgPMNoble <> 0)
      perform #traitadjust[trPMFame,+,15,"Admiral"]
   else
      perform #traitadjust[trPMFame,+,10,"Admiral"]
      hero#Edge.edgPMNoble
   endif

Where edgPMNoble is the Noble Edge and trPMFame is the Fame trait.
I know I'm missing something on how to actually code that, though, so I thought I'd check and see if anyone here has some ideas.
 
Ok, I've made some progress on this... very, very slowly, but some progress. At any rate this is what I have so far:

Code:
   if (hero.tagis[Edge.edgPMNoble] <> 0) then
      perform #traitadjust[trPMFame,+,15,"Admiral"]
   else
      perform #traitadjust[trPMFame,+,10,"Admiral"]
      perform hero.assign[Edge.edgPMNoble]
   endif

All of that works except for Bootstrapping the edge. So the line perform hero.assign[Edge.edgPMNoble] doesn't give any errors, but it also doesn't seem to actually add the Edge to the portfolio, either. Both of the Fame adjustments do seem to apply correctly now, however. Anyone have some thoughts on this? It's taken a TON of reading and trial and error over the past few days just to get that far. So much of the documentation on this is a bit hard to get through, especially for someone with as relatively pitiful programming skills as I have.
 
I think but i might not be right is that you need to bootstrap the edge to that edge and then put some type of script on the edgPMNoble inside the bootstrap tab to only give it if it meets the what you want it to meet. I think that's the problem I'm having with the drop down box to work is I need a script that will either pick one or the other, but they need to be bootstrapped to that what i have set up and I don't know how to write that script. - I know this isn't much help but meet get you to think in that way.
 
Ok, I think I might need to see your drop-down box code, then. I've been working on Necropolis most recently and one of the Orders (I've set those up as Factions in Hero Lab) gives you either Boating, Driving or Piloting at d6, so it sounds like you've got figured out at least part of what I want to do. Although it sounds like we may both be stuck on trying to get something to bootstrap in with code instead of using the Bootstrap section.
 
Back
Top