• 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

Syntactic thing

Line one should be var agile as number, not as A number. Also, if you're setting bonus=agile then why not just use "agile" instead by just deleting that line and using agile in your final line? And who know, maybe it's got an issue with a variable named "bonus", or something (maybe it's used elsewhere and is confusing things?)
 
Try this:

Code:
var bonus as number
bonus = 0

      if (#trait[attrAgi] > 7) then
         bonus = 6 + int(((#trait[attrAgi]-6)/2))
      else
         bonus = #trait[attrAgi]
         endif

perform #traitadjust[trTough,+,bonus,"Thin Man"]

This assumes that a d12+1 would get a +6, and a d12+2 would get a +7. I think you can get away with not needing the agile variable.
 
I thought "agile" was pointless, but since I wasn't getting any result, I figured I'd try it someone else's way. I'll give your version a try in a few minutes, CC.
 
Hmmm. This finally mostly works (it produces the right number but doesn't care whether the selection toggle is on or not).

Code:
var bonus as number
bonus = 0
bonus = #trait[attrAgi]
      if (bonus >= 6) then
         bonus = 6 + round(hero.child[attrAgi].field[trtRoll].value / 2,0,-1)
        endif

perform #traitadjust[trTough,+,bonus,"Thin Man"]

Timing perhaps? I've currently got nothing in it.
 
Last edited:
I was naughty and put "a" in the middle.

OK, I tested this and it works
Traits 5000
var bonus as number
bonus = #trait[attrAgi]

if (bonus >= 6) then
bonus = 6 + round(hero.child[attrAgi].field[trtRoll].value / 2,0,-1)
endif

perform #traitadjust[trTough,+,bonus,"Agile Toughness"]
 
OK, correction:

Code:
var bonus as number
var agile as number
bonus = 0

      if (#trait[attrAgi] > 7) then
         agile = #trait[attrAgi]
         bonus = 6 + int(((agile-6)/2))
      else
         bonus = #trait[attrAgi]
         endif

perform #traitadjust[trTough,+,bonus,"Thin Man"]

I was thinking we could get away without the extra variable, but apparently it doesn't like the #trait function in that equation.
 
This version seems to not like line 7. Same "error parsing parameter of function 1". Maybe that baroque business in the core version actually serves some kind of purpose?

Of course the one I hacked together works anyway, other than the toggle.
 
By the by, in an unrelated question, anyone know why when I'm using the "creature" object in the test portfolio, I keep getting a validation error saying "Human: This selection not permitted (all effects are ignored)." ?
 
Do you disallow humans in your setting? The Human has a Containerreq that says "!Settings.NoHumans & !hero#Hero.Creature". Apparently a creature cannot be a human.
 
Not that I know of...I was just using the Creature setup so I could make sure things were displaying properly as I put in the various aliens (who are all opposition).
 
If it's something that should be on a Toggle you need to make sure you have the "Activated by User" checkbox selected and enclose your code between...:

if (field[abilActive].value <> 0) then
[your code]
endif
 
Sure enough, that was it; you'd think the "Activated by user" toggle would just insert that somehow, but apparently not. I should have hunted around for an exemplar, but I couldn't think of a standard one.

Thanks as always, Zarlor.
 
No problem. I've been using a good bit of it lately and there's an example of it in the Common Code thread. It's just such a darned useful thing to use that activation for all kinds of things!
 
Perhaps I should start using it to run games instead of just a character editor. It does not appear to me that you can track ammo in a gun with it, though, as in have the shots be a counter in a gun.
 
True, I've never used them for measuring magazine, the default counter is just for total bullets/ammo in general. Then again the base mechanic for SWD is that reloading is a free action so it may not really matter all that much to ask for or otherwise code something like that.
 
Back
Top