Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
Gumbytie
Senior Member
 
Join Date: Jun 2010
Location: Florida
Posts: 246

Old August 3rd, 2023, 01:06 PM
I ask this because of this thread: http://forums.wolflair.com/showthread.php?t=30998

Caped wrote this in response to question 3.

Quote:
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.
Gumbytie is offline   #1 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,561

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
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:22 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.