Lone Wolf Development Forums  

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

Notices

Reply
 
Thread Tools Display Modes
Kendall-DM
Spy
 
Join Date: Jan 2011
Location: Van Nuys, California
Posts: 1,220

Old July 10th, 2012, 06:03 PM
If gearholder is really a container, you should be able to do the foreach on the gearholder and not the hero.

Code:
foreach pick in gearholder from MyGear
No sure that will work, but give it a shot. I didn't even know there was a container transition called gearholder to tell the truth.
Kendall-DM is offline   #11 Reply With Quote
Nightfox
Senior Member
 
Join Date: Dec 2011
Posts: 100

Old July 10th, 2012, 11:24 PM
Damn, still no joy. gearholder is aparently invalid syntax for the foreach statement.
You can thank Mathias for gearholder.
http://forums.wolflair.com/showthread.php?t=21663

http://hlkitwiki.wolflair.com/index....xt#transitions

I tested the gearholder transition by creating an item, "monkeys", and add the eval line:

Code:
gearholder.field[livename].text = "Barrel of Monkeys"
Sure enough, when monkeys go into a container it becomes a Barrel of Monkeys. Strangely enough, I am having trouble reversing it.

Code:
field[livename].text = field[livename].text & " in a " & gearholder.field[livename.text
This returns " in a " (final phase) or " in a Barrel" (validation phase)
This makes me think that there is a timing issue here as well.

Based on what it says in the hlkitwiki, I think it has to be used from the point of view of the gear inside the container (like master has to be used from the minion side). That is why I thought the way to go would be to look at each piece of gear and see if the container it was in had the Location tag.
Nightfox is offline   #12 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old July 11th, 2012, 05:49 AM
Since there isn't a transition in the reverse direction for gearholder, here's something that may work:

Code:
 
foreach pick in hero from MyGear
  if (eachpick.isgearheld <> 0) then
    if (eachpick.gearholder.uniqindex = uniqindex) then
      ~do whatever
      endif
    endif
  nexteach
Don't record uniqindex - that will change depending on what's currently on the hero and the order they were all added and deleted in, but if the uniqindex of the holder of the item you've found is the same as the uniqindex of yourself, you know you're what's holding that item.
Mathias is offline   #13 Reply With Quote
Nightfox
Senior Member
 
Join Date: Dec 2011
Posts: 100

Old July 12th, 2012, 11:11 AM
Thank you Mathias! This is working perfectly.
Nightfox is offline   #14 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 12:29 AM.


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