Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old July 16th, 2016, 11:00 PM
I want to assign a tag to a pick after it has been purchased based on what was selected in a menu item on the buy template.

I have items that have a Quality (similar to cyberware grades in shadowrun) and I thought the best way to deal with it was with assigning a tag at the time of purchase.

I was originally thinking of doing it in the Transact Buy script but it can't done there since it's not a pick at that point. Where would I be able to still see what was selected on the template and be able to access the pick to add a tag?
ShadowWalker is offline   #1 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old July 17th, 2016, 07:50 AM
Shadowrun does that with a pick inside the cyberware's gizmo. The xactbuy script sets the value of a drop-down field on that pick, based on the cyberware grade that was set by the user in the buy template, and then a script on that pick assigns the correct tag.
Mathias is offline   #2 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old July 17th, 2016, 02:40 PM
So I created an entity, and have a bootstrap of a thing with a field for storage.
When I try accessing the gizmo.child etc I got the following error:

Quote:
Attempt to access non-existent containing entity from script
Location: Procedure 'XactBuy' near line 20
I'm guessing this means either the child doesn't exist within the gizmo or that the gizmo container doesn't exist.

the entity is:
Code:
  <entity
    id="grBuyType">
    <bootstrap thing="btBuyType"/>
  </entity>
each thing to be purchased has:
Code:
    <child entity="grBuyType">
    </child>
The code being used to set the field is:
Code:
      gizmo.child[btBuyType].field[btBuyType].value = 1

Last edited by ShadowWalker; July 17th, 2016 at 02:44 PM.
ShadowWalker is offline   #3 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old July 18th, 2016, 07:42 AM
I apologize, I was working from memory, and forgot where the script was.

There's a compset specifically for the helper picks, and those have a creation script that applies this sort of thing.

Here's the relevant lines from that creation script:

Code:
searchexpr = "Augment.Cyber & " & hero.transact.field[xactChCyb].chosen.tagids[explicit.?,"|"]

perform field[usrChosen1].setchosen[Grade,searchexpr,hero]
Mathias is offline   #4 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old July 18th, 2016, 08:44 AM
So the creation script sets the field and an eval script assigns the tag?
ShadowWalker is offline   #5 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old July 18th, 2016, 08:59 AM
Quote:
Originally Posted by ShadowWalker View Post
So the creation script sets the field and an eval script assigns the tag?
Correct.
Mathias is offline   #6 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old July 18th, 2016, 02:15 PM
Thanks got it working
ShadowWalker is offline   #7 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old July 18th, 2016, 08:42 PM
So I got it working, but I didn't like the way I was doing it.
I'm trying to change it to work with a menu of things, which is what it looks like what you posted is doing.
Grade = component or compset of the things/picks to search for
hero = container for the picks? If this is the case what if you are using things?

Last edited by ShadowWalker; July 18th, 2016 at 09:17 PM.
ShadowWalker is offline   #8 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old July 18th, 2016, 11:16 PM
In setchosen, the first argument is the Component that menu chooses from. The second argument is an expression that tells it how to pick a specific item from that compset. The third argument must be either "hero", "container", or "thing", which tells HL where to apply that expression. You'll use the same setting there as your <menu_things> in the portal for this field uses for its usepicks="XXXXX" setting (and the first argument will match the component="XXXXX" in that portal).
Mathias is offline   #9 Reply With Quote
ShadowWalker
Senior Member
 
Join Date: Jun 2014
Posts: 243

Old July 19th, 2016, 06:48 AM
Thanks again.
ShadowWalker 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 09:42 AM.


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