Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds


Thread Tools Display Modes
Prev Previous Post   Next Post Next
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,003

Old November 21st, 2017, 08:45 PM
Hi all!

Yet another scripting question.

I have the below thing (and a couple others similar). When I add the item from the table_dynamic table, the cursor goes into 'wait, processing' spinny mode and it takes 30 seconds to a minute to add to the hero. I'm guessing it's a delay with the foreach or due to the lastpos check.

Is there a better way to script this?
  <thing id="exp17Wild" name="Exp. and Wis.: Wild Card" description="There are moments when everything comes together and an opportunity presents itself. You’re hero knows how to make the most of just such a moment; choose one Wild Card Edge, regardless of requirements." compset="HeroJrny">
    <fieldval field="usrCandid1" value="component.Edge &amp; EdgeType.Wildcard"/>
    <usesource source="SavRiftC"/>
    <tag group="RiftsHJ" tag="ExpWis"/>
    <tag group="ChooseSrc1" tag="Thing"/>
	<eval phase="Setup" priority="5000"><![CDATA[
	var mychoice as string
	if (field[usrChosen1].ischosen <> 0) then
      #resmax[resEdge] += 1

	  mychoice = "Edge." & field[usrChosen1].chosen.idstring
	  foreach pick in hero where mychoice
	    perform eachpick.assign[thing.skipprereq]
	<evalrule phase="Validate" priority="5000" index="2" message="Selected Hero&apos;s Journey professional Edge needs to be chosen" summary="Edge missing."><![CDATA[
	  var mychoice as string
	  var heroedges as string
	  heroedges = hero.tagids[Edge.?,"|"] 
	  if (field[usrChosen1].ischosen <> 0) then
	    mychoice = "Edge." & field[usrChosen1].chosen.idstring

      validif (lastpos(heroedges, mychoice)  >= 0)
TCArknight is online now   #1 Reply With Quote

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 06:59 AM.

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