• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

How are gear and location connected?

Nightfox

Well-known member
So I've been playing around with another problem. I think I could solve several of my puzzles if i could just figure out how to identify when/where things are connected.

Example 1: you put your cloak into your backpack. In Hero Lab the gear "cloak" shows as being in location "backpack". I've searched through floating windws for tags and fields for both the gear and the location but can't find any reference for the other. Thearetically hero lab would have to have some way to crossreference the items.

Example 2: as an adventurer you can end up with a lot of gear. Thankfully, being a powerful adventurer, you can also end up with henchmen, cohorts, and your own residences (castle, tower, mansion, or safe house). On the dashboard the hirelings and mounts reference back to the hero, but I still can't find that crosseference.

One thing i'm trying to do is leave gear in a safehouse. Since it is not on the hero, i don't want it to show on the character sheet. But it is still their gear, so I still want it to show in hero lab. This should be a simple matter of assigning the tag Helper.NoOutGear but i need a way to reference the effected gear.
 
When you make a Custom Location under gear, it is a container that you can put items in. This location can be a safehouse. Anything that is put into that location does not appear on the character's encumbrance. Getting it to not output is something else.

These items are dynamic custom items managed by the internal code of HL. I'm not sure there is a tag or field that can be manipulated. I have a feeling the items are in no way connected to the container. What I think is happening, is that HL is retrieving the name and weight of the object, appending the name to the contents field and adding the weight to the weight field, then subtracting the weight from the character's encumbrance. Then vice versa when you return the item to the character. I don't think it ever establishes a connection to the container.

Now, that said, I think you are correct. There should be an option to remove the items not on the character so they are not output. I just don't know if you can do that directly with scripting. You might try putting the Helper.NoOutGear tag on the gCustTop thing in the Gear editor, making your own version of course to replace it. Unfortunately, I think this will only cause the custom location to be excluded, not the things you keep in the custom location.

Two things you might try. You can try making a new minion, call it Location, automatically give it 99 in its Strength stat and 1 in all others. Then just assign all stored items there. There would be a bit more to it, but you get the gist. the second option is to make a parser, to parse the custom location contents field until it reaches a semi-colon, then do a search among the items in the character's inventory for names that match it, then assign the Helper.NoOutGear tag to each thing it finds. It would be a beast to program, and it would probably use up alot of computer resources on searching, but it would also work. This assumes there in an actual contents field (I haven't looked myself).

Another option is to petition LW to add the ability to exclude items in custom locations from appearing in output, a checkbox if you will. Otherwise, I'm not entirely sure you could get the items on the character that are in a custom container to actually not be output.
 
Last edited:
You might try putting the Helper.NoOutGear tag on the gCustTop thing in the Gear editor, making your own version of course to replace it. Unfortunately, I think this will only cause the custom location to be excluded, not the things you keep in the custom location.

You are correct. The first thing I did was jump in the editor and add a couple of safe houses with the tag Helper.NoOutGear. The safe house doesn't show in the character sheet, but any gear left there still does.

Two things you might try. You can try making a new minion, call it Location, automatically give it 99 in its Strength stat and 1 in all others. Then just assign all stored items there.

I've been afraid that I might have to go this route. At this point, the party owns 2 inns, a brothel, a mansion, a villa outside the city, and controlling interest in several small businesses. The dashboard is going to get really crowded.

the second option is to make a parser, to parse the custom location contents field until it reaches a semi-colon, then do a search among the items in the character's inventory for names that match it, then assign the Helper.NoOutGear tag to each thing it finds.

This sounds waaaay to complicated. And if I am interpreting this correctly I don't think it would work the way I'd want it too. Just about every location has at least a couple cure potions. I can't have all of them hidden considering our party doesn't have a primary healer.

Here's another side of the same problem. One of the items in the party is a warhorse bridle and saddle. When activated, the rider gets a +5 bonus to ride and the mounted combat feat. The item is mostly coded, except I'd prefer to have it associated with the warhorse, but confer the bonus to the rider. Again, I can't find any links in tag or field between hero and minion except for the minion's dashboard entry.
 
Here's another side of the same problem. One of the items in the party is a warhorse bridle and saddle. When activated, the rider gets a +5 bonus to ride and the mounted combat feat. The item is mostly coded, except I'd prefer to have it associated with the warhorse, but confer the bonus to the rider. Again, I can't find any links in tag or field between hero and minion except for the minion's dashboard entry.

You can transition from a minion to its master, which is a container. So just code the saddle with the master container transition that gives the master the bonuses. Make sense?

Not sure to get the feat assignment bootstrapped to the hero though, that's much trickier.
 
Last edited:
A transition is a way to indicate the container you want to add changes to. So, for example, a hero is a container you can transition to and change things on the current hero. That's hero.child[kRide].field[BonComp].value. Instead of hero, you want the current hero's (the minion's) master to get the bonus. Therefore, you transition to the master as master.child[kRide].field[BonComp].value to grant the bonus appropriately. You might want to do a doneif (hero.isminion <> 0) to make sure the current hero is a minion before it attempts to assign things to a master container (at least I think that is the code for checking isminion, you might need to doublecheck that).

This doesn't work for bootstrapping a feat to the master though, so I'm not too sure what to do there. You may just have to manually add it is my guess, and you can do that by giving the master a free bonus feat, I think there's a field that determines the number of feats available and taken. Just root around in the debugging fields.

If you need more help, let me know and I'll actually try to get you some working code.
 
Last edited:
doneif (hero.isminion <> 0) to make sure the current hero is a minion before it attempts to assign things to a master container (at least I think that is the code for checking isminion, you might need to doublecheck that).

hero.isminion is correct, with one small change; this should be doneif(hero.isminion = 0).
Here is what I have so far.

Code:
Post-attribute 5000/1

if (field[gIsEquip].value <> 0) then

   ~ if equipped, our mount gets an enhancement to AC
   hero.child[ArmorClass].field[BonEnhance].value += 1

   ~If we are not on a mount, stop here!
   doneif (hero.isminion = 0)

   ~Show that we are selectable.
   field[hTotal].value = 3
   perform assign[Helper.ShowCharge]
   field[hName1].text = "Mounted Mastery"
   ~Give master the bonus for the masterwork military saddle
   master.child[kRide].field[ModCirc].value += 3


   ~If active, rider gets bonus to ride.
   if (field[hIsOn1].value <> 0) then
      if (master.childlives[fMountCom] <> 0) then
      master.child[kRide].field[BonComp].value += 10
      else
      ~ if no mounted combat, then +5 and mounted combat
      master.child[kRide].field[BonComp].value += 5
      perform master.child[Totals].assign[HasFeat.fMountCom]
      endif
   endif
endif


So far it seems to work. I'm sure it could use some fine tuning, but I wanted to make sure it would run first.

I haven't done any rooting around for how to actually give a bonus feat yet, but I was hoping to trick the system into believing the master has the feat by assigning the tag HasFeat.fMountCom. Unfortunately other feat prerequisites don't seem to find it (yes I know you can't use an item to qualify for a feat, I'm just using feats to test if it is going through properly). Does the HasFeat tag have to be somewhere specific to be found?
 
Try just assigning it to the hero, as in master.assign[HasFeat.fMountCom]. I'm pretty sure that won't work, but what the hey, it's worth a shot. I've been wrong before.
 
Just assign it to the top level of the master... again, so simple, and it works! Well, as much as we expected it to. Though the feat does not show on the hero's list, with the tag assigned any other abilities function as though the hero had the feat. For the saddle, I've added a special to show in the mount's special list which copies the text of Mounted Combat. That's one puzzle solved, for now.

Back to the other problem. Is there a way to assign a tag to any gear that is placed in a particular container or location. I'd like to think there has to be something that can be done with the Gizmo or Gear buttons, but I am not familiar with either.
 
Here's a crazy idea, and I'm not sure how exactly to go about it (if it is even possible).
I may be misinterpreting how this works, but I think gearholder is a transition similar to master. Therefore, something along the lines of:

Code:
foreach pick in hero from MyGear
     if (gearholder.tagis[gType.Location] <> 0) then
     perform eachpick.assign[Helper.NoOutGear]
     endif
nexteach

Now, this doesn't work (at least not at Final Phase 1000, 5000 or 10,000) but then, I'm mostly just muddling my way through it. I'm not too familiar with the structure of "foreach" yet, so I may be missing something.

Does anyone have any ideas on how to tweak this code to get it to work?
or another way to perform a similar task?
 
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.
 
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.php5/Pick_Context#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.
 
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.
 
Back
Top