View Single Post
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,556

Old August 4th, 2023, 08:07 AM
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

_
Currently In Development: Savage Pathfinder, SWADE Fantasy Companion
Future Development: SWADE Super Powers Companion, SWADE Sci-Fi Companion
_
Currently Running: Savage Unity Inc. (homebrew multiverse theme)
Setting Files Supported: Deadlands: Reloaded, Flash Gordon, Gaslight, Hellfrost, Interface Zero 2.0, Seven Worlds, Slipstream, Solomon Kane
Future Setting Files: Savage Judge Dredd
CapedCrusader is offline   #2 Reply With Quote