• 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

Deactivate an Ability?

That works fine as far as not giving any errors as well (should I be using that instead of "foreach pick in hero where "(component.Skill | component.Attribute)"" which also works?) but it still doesn't make a difference to the -4 part. When selected as either a Minor or a Major activating it will give me -4 to everything when it should only give me -4 when it's selected as a Minor Hindrance, as a Major it shouldn't be doing anything. One interesting thing I did notice was on the quick test I did I made a character where the only super power I gave him was level 5 agility (didn't even touch the base stats) which gave it Agi of d12+1, but when checking the Allergy on the In Play tab everything else takes a -4 like it should, but that d21+1 doesn't get modified at all. That could just be a timing thing, though (or maybe related to the stuff you were talking with SeeleyOne about? It does work correctly if I change the timing of this script to Traits/5000, for example.)

Here's how it looks currently, at Pre-Traits/5000
Code:
trustme
var modifier as number
modifier = 4

if (tagis[User.HindMajor] <> 0 ) then
      modifier = 0
endif

if (field[abilActive].value <> 0) then
   foreach pick in hero where "(Skill.? | Attribute.?)"
      eachpick.field[trtRoll].value -= modifier
   nexteach
endif
 
Last edited:
Although, actually, I just realized since the current form isn't going to do anything if the Hindrance is Major then I should just replace that "modifier = 0" line with "done" instead. Which I tried, BTW, but the same -4 thing is happening which tells me that the user selecting of a Major Hindrance either is read at a later timing OR it is not tagged as User.HindMajor.
 
I have found that, as you mentioned, that the timing is later. If it is not going to directly affect a trait, but to add on top of it, or reference it, later on it works better in Traits.
 
1. OOC - Why trustme on this one?
2. Try using "if (field[hinMajor].value <> 0 ) then". It looks like the Hindrances with User-Definable Severity don't get assigned the HindMajor tag. I'm going to look into that right now.
3. Put your check for abilActive inside the loop so you only check items that fit the criteria.
4. Yes, that timing issue will be fixed in the next update.

Code:
var modifier as number
modifier = 4

if (field[hinMajor].value <> 0) then
      modifier = 0
endif

foreach pick in hero where "(Skill.? | Attribute.?)"
  if (field[abilActive].value <> 0) then
      eachpick.field[trtRoll].value -= modifier
      endif
  nexteach
 
OK, I've added code that will add/delete that User.HindMajor tag to match the User-Selectable Severity level.

Also, #3 above may be superfluous. I was bouncing between a couple of windows and may have been addressing something that was already solved.
 
On 1 I used trustme because you said I should try that in an earlier post in this thread. It probably isn't relevant now since I'm not going to do the deactivate thing.

Other than that your code definitely works, Thanks!
 
Back
Top