• 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

Armor as a container

Gumbytie

Well-known member
I ask this because of this thread: http://forums.wolflair.com/showthread.php?t=30998

Caped wrote this in response to question 3.

3. You could create the armor as a container, and "store" the mods in the armor. The armor could have a validation script to check how many items are in the container and give a warning if it exceeds the limit.

Okay, that is cool. I can easily create armour as a container. How does one go about writing a validation script to "count" items linked/attached/out into it?

I can think of any existing Edge that does something like that, so not sure of a good starting example.
 
I think the answer to both of your questions lies in the foreach loop. Here's an example where it goes through the weapons attached to a Vehicle and removes the weight - this code is part of each vehicle. Foreach can go against the hero or a specific item that contains other items like a Vehicle (a gizmo).

Code:
        foreach pick in gizmo where "component.WeaponBase"
          eachpick.field[gearWeight].value = 0
          nexteach

Here's one that goes against the hero and adds a damage bonus to each weapon.
Code:
      foreach pick in hero where "component.WeaponBase"
        eachpick.field[wpDmgBonus].value += 1
        nexteach
 
Back
Top