Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit

Notices

Reply
 
Thread Tools Display Modes
adimar
Junior Member
 
Join Date: Dec 2017
Posts: 7

Old November 15th, 2018, 01:15 AM
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>
adimar is offline   #1 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old November 15th, 2018, 05:01 AM
This: (http://forums.wolflair.com/showthread.php?t=61101) might be what you're looking for....

I've not got time at the moment to test this, but this might work
Code:
perform hero.addpick[tabCyberwr,field[usrChosen1].chosen.idstring]
Let me know how it turns out...

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #2 Reply With Quote
adimar
Junior Member
 
Join Date: Dec 2017
Posts: 7

Old November 15th, 2018, 05:34 AM
Quote:
Originally Posted by TCArknight View Post
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

adimar is offline   #3 Reply With Quote
TCArknight
Senior Member
 
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321

Old November 15th, 2018, 07:42 AM
Quote:
Originally Posted by adimar View Post
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...

Working on -
  • (SWADE) WIP Savage Rifts
  • Savage Rifts (Deluxe): Update link in This post
  • Star Trek Adventures: Update link in This post
TCArknight is offline   #4 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old November 15th, 2018, 08:31 AM
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.
Mathias is online now   #5 Reply With Quote
adimar
Junior Member
 
Join Date: Dec 2017
Posts: 7

Old November 15th, 2018, 09:01 AM
Quote:
Originally Posted by Mathias View Post
...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 by adimar; November 15th, 2018 at 09:24 AM. Reason: /thought of another option
adimar is offline   #6 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,207

Old November 15th, 2018, 12:08 PM
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.
Mathias is online now   #7 Reply With Quote
adimar
Junior Member
 
Join Date: Dec 2017
Posts: 7

Old November 16th, 2018, 02:29 AM
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
adimar is offline   #8 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 10:19 AM.


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