• 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

Adding usrChosen1 to gear (cyberware)

adimar

Member
I am currently adding some functionality to the rifts savage worlds files.
The upgrade edge lets you select a piece of cyberware and add it to your character.
I already have the drop down content but need help adding the "usrChosen1" to the cyberware list of the hero.

<thing id="edgSRUpgade" name="Upgrade" description="..." compset="Edge" summary="Add a new piece of cyberware of your choice">
<fieldval field="usrCandid1" value="component.Cyberware"/>
<usesource source="SavRiftC"/>
<tag group="ChooseSrc1" tag="Thing" name="All Things" abbrev="All Things"/>
<tag group="MinRank" tag="1" name="Seasoned" abbrev="Seasoned"/>
<tag group="EdgeType" tag="Iconic"/>
<eval phase="PreTraits" priority="5000"><![CDATA[
doneif (field[usrChosen1].ischosen = 0)
<!-- NEED TO add field[usrChosen1].chosen to cyberware list-->
]]></eval>
<evalrule phase="Validate" priority="5000" message="May only be taken once per rank" summary="May only be taken once per rank">
<![CDATA[validif (herofield[acRank].value + 1 >= hero.tagcount[Edge.edgSRUpgade])]]></evalrule>
<exprreq message="Combat Cyborg or M.A.R.S. required.">
<![CDATA[(hero.tagcount[Group.grpSRCoCyb] + hero.tagcount[Rifts.MARS]) >= 1]]></exprreq>
<exprreq message="Seasoned required.">
<![CDATA[herofield[acRank].value >= 1]]></exprreq>
</thing>
 
Code:
perform hero.addpick[tabCyberwr,field[usrChosen1].chosen.idstring]
Unfortunately I get am error:
Hero Lab was forced to stop compilation after the following errors were detected:
Syntax error in 'eval' script for Thing 'edgSRUpgade' (Eval Script '#1') on line 3
-> Script reference is invalid under the circumstances

:(
 
Unfortunately I get am error:
Hero Lab was forced to stop compilation after the following errors were detected:
Syntax error in 'eval' script for Thing 'edgSRUpgade' (Eval Script '#1') on line 3
-> Script reference is invalid under the circumstances
:(

Hmmm... what about this?
Code:
doneif (field[usrChosen1].ischosen = 0)
var thingid as string
thingid = field[usrChosen1].chosen.idstring
perform hero.addpick[tabCyberwr,thingid]

Maybe the field reference wasn’t usable and had to be a specific string value...
 
You cannot use an eval script to add a pick to the character - the cyberware will need to run its own scripts, so it cannot be created by another script - the list of all scripts to be run must be set up before any script runs, so that HL knows the order to run them in. You'll need to build a new table where the user can add this item, and then for each purchase of this edge, add +1 to the count of items available to add to that table.

An action script run from a button could do this, but the table is a cleaner interface for the user, who can take their time to look at the available cyberware, instead of just having to pick a name from a list, with no indications of what cyberware they already have and which of the available items is legal.

If you don't have access to the structure of the game system you're modifying, then I would just add instructions to the description that once the user purchases this edge, they should then buy an appropriate piece of cyberware for free. Without access to the structure, this is not an edge that can be implemented beyond having the user do things themselves.
 
...You'll need to build a new table where the user can add this item, and then for each purchase of this edge, add +1 to the count of items available to add to that table...

How is it different then <autoadd thing="eqCross" portal="grGear"></autoadd>?
I would basically do an autoadd of a dynamic thing.

10x
Adi
 
Last edited:
If this adds a specific item, then an autoadd is an option, but if you have a hundred different cyberware items, do you want a hundred versions of this edge, each for adding a different cyberware item?


Also, with an autoadd, if the user decides not to take this edge, how will you also tell them that they must then delete the cyberware? With the table, removing the edge will remove one of the slots allowed on the table, and so the user will get an error message until they reduce the count of items in the table.
 
10x Mathias.
For the edge I decided to keep the drop down without actually adding the cyber. (IMHO it's more usable.)
I used the extra table approach for another screen where multiple items need to be added and not just 1 related to a specific edge.

Adi
 
Back
Top