Lone Wolf Development Forums  

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

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
EightBitz
Senior Member
 
Join Date: May 2013
Posts: 1,458

Old September 18th, 2017, 02:10 AM
I'm trying to work through an issue with a set of picks where each additional pick has a higher cost than the previous one.

The first pick costs 4 points, then each additional pick costs an extra 2 points, cumulatively. So pick1 costs 4 points, pick2 costs 6 points, pick3 costs 8 points, etc.

I tried to get clever with the following bit of scripting, but it didn't work as intended.
Code:
~adjust the resource appropriately
      var schcount as number
      var cost as number
      foreach pick in hero where "component.School"
      	schcount += 1
      	nexteach
      cost=2+(schcount*2)
      hero.child[resCP].field[resSpent].value += cost
Instead of increasing the cost for each successive pick, in increased the cost for each existing pick as well. Pick1 would cost 4 points, but if I added a second pick, they would cost 6 points each. And if I added a third, they would cost 8 points each.

In retrospect, this behavior makes sense. It still leaves me confused, though, as to how to make this work.
EightBitz is offline   #1 Reply With Quote
 


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 04:40 PM.


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