Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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) |
#1 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
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.
|
#2 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
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. |
#3 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,550
|
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 |
#4 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
I understand that there are abilActive and grIsEquip fields, but i was under the impression they were essentially read-only during the eval phases.
|
#5 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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. |
#6 |
Senior Member
Volunteer Data File Contributor
Join Date: Aug 2009
Posts: 1,550
|
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 |
#7 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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. |
#8 |
Senior Member
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819
|
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 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) |
#9 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Look at the things you're finding with your
Code:
foreach pick in hero where "component.SPCPower" Reminder: that should be written as: Code:
foreach pick in hero from SPCPower |
#10 |
|
|