Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old August 11th, 2014, 12:11 PM
I know that abilActive (which we generally use to check if a user has "activated" and ability) is essentially a read-only variable. What I'm wondering is if there is any other way to to deactivate an ability in code, based on a pick.

So something like:
Code:
   foreach pick in hero where "component.Power"
      eachpick.field[abilActive].value = 0
   nexteach

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #1 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old August 11th, 2014, 07:09 PM
Activation and Deactivation of abilities, Equiping/Unequiping of items, etc, are not something that can be scripted. Essentially, there is no 'state' capabilities in the script. Every time any ability is changed, the entire hero recalculates from the beginning, running all the scripts on all the picks, at all the appropriate timing steps.
Fuzzy is offline   #2 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 11th, 2014, 07:20 PM
Fuzzy, that's incorrect. You can create tags or use other settings to indicate whether something should be active or not and have the things that make something go inactive assign those tags/settings to the things that are inactive.

However, the Savage Worlds files have not implemented an overall system for this, the way many of our other game systems have.

zarlor, open Shadowrun 4 or 5, even if you don't have those licensed. In the editor, take a look at the scripts - start on the Qualities - that's the closest equivalent to SW's Edges, so lots of them have scripts.

Take a look at the doneif that they all (should) share at the beginning of their scripts. That setting - activated = 0 or 1, is something you can change in a script. Then, you can use the same activated = 0 doneif that Shadowrun does.
Mathias is offline   #3 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old August 11th, 2014, 08:16 PM
Actually, in this case, there is a state capability. It's stored in field[abilActive].value (0 or 1, 1 being Active). It's the field that gets used when something has "Activated by User?" set. It's the checkbox you see on the In-Play tab.
For anything designated as Equippable, it's field[grIsEquip].value (0 or 1, 1 being Equipped). This is the checkbox next to each piece of gear you can equip, mainly weapons and armor.

Does that help?

_
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   #4 Reply With Quote
Fuzzy
Senior Member
 
Join Date: Jul 2012
Posts: 416

Old August 11th, 2014, 11:03 PM
I understand that there are abilActive and grIsEquip fields, but i was under the impression they were essentially read-only during the eval phases.
Fuzzy is offline   #5 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old August 12th, 2014, 03:50 AM
Fuzzy's right, Caped. You'll get an error if you try to do the script I mentioned above that tries to write to abilActive. Specifically the error I get is "Only derived fields can generally be modified via scripts (field 'abilActive')"

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)

Last edited by zarlor; August 12th, 2014 at 04:44 AM.
zarlor is offline   #6 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old August 13th, 2014, 06:14 PM
Have you tried trustme?

_
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   #7 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old August 13th, 2014, 06:35 PM
Oh, duh. I never even thought about something like that working. Now I just have to figure out the other bits I need to do.

Thanks!

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)

Last edited by zarlor; August 14th, 2014 at 08:18 AM.
zarlor is offline   #8 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old August 14th, 2014, 08:30 AM
I'm still getting a bit stumped on this. Here's the Eval script I'm using right now at PreTraits/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 "(component.Skill | component.Attribute)"
      eachpick.field[trtRoll].value -= modifier
   nexteach

   foreach pick in hero where "component.SPCPower"
      eachpick.field[abilActive].value = 0
   nexteach
endif
First off when I have Allergy selected as a Minor Hindrance on the portfolie I'm not getting the -4 to Attribute rolls, just to Skills.

I also get an error:

"ttempt to access field 'abilActive" that does not exist for thing 'spcArmor'
Location: 'eval' script for Thing 'hinNEAller' (Eval Script #1) near line 16"

(Same error for each power in the portfolio.)

If I select this as a Major Hindrance on the character sheet I still get the -4 on skill rolls showing and the above error pops up and none of the Super Powers deactivate. No doubt it's something obvious I'm missing here (isn't it always?) but I'd sure appreciate the help if anyone can see what I'm messing up.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #9 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old August 19th, 2014, 12:09 PM
Look at the things you're finding with your

Code:
foreach pick in hero where "component.SPCPower"
search - do they have an abilActive field?

Reminder: that should be written as:

Code:
foreach pick in hero from SPCPower
It's faster for HL to execute that line of code than your original, and both will find the exact same things.
Mathias is offline   #10 Reply With Quote
Reply


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 05:45 AM.


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