Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [SOLVED] What makes "foreign" armour foreign?  (Read 2123 times)

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
[SOLVED] What makes "foreign" armour foreign?
« on: April 24, 2016, 10:46:41 am »

I'm trying to add a new piece of armour to the game. I've got the reactions all set up and can make it just fine, it works a treat in arena mode, etc, but my dorfs don't want to equip it (or even add it to armor stockpiles!). When I try and set it up in the military equip screen this armour is displayed with (foreign) on the end, which I assume is the cause. I copied most of this armor's stuff over from dresses, and it's set up just fine in the entity, so there's nothing "weird" about it. How do I make it un-foreign? Why is it foreign in the first place?

Item raw:
Spoiler (click to show/hide)
entity entry:
Spoiler (click to show/hide)
« Last Edit: April 25, 2016, 06:43:55 am by Roach »
Logged
How do I do it? Prune juice.

scamtank

  • Bay Watcher
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #1 on: April 24, 2016, 10:54:05 am »

Most entity changes don't stick to games in progress. Stuff like permissions are checked from the files only once during worldgen and then they're fixed, unless you're good at punching and kneading the memory structures with DFHack.
Logged

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #2 on: April 24, 2016, 11:11:03 am »

Ah, yeah, I should've mentioned: I've been genning new worlds after changes, so they should be working.
Logged
How do I do it? Prune juice.

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #3 on: April 24, 2016, 11:53:00 am »

Any armor that is not defined in the entity is seen as foreign to them, though I don't think that should technically prevent them from wearing it if its the right size.

Have you tried setting the 'replace clothing' option in the equipment screen?
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #4 on: April 24, 2016, 12:38:37 pm »

Any armor that is not defined in the entity is seen as foreign to them
But that's the thing, it is defined in the entity. Dunno why it's still "foreign". Breastplates are defined just the same and they don't get marked as such.

Have you tried setting the 'replace clothing' option in the equipment screen?
Yep, then they just walk around in the buff.
Logged
How do I do it? Prune juice.

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #5 on: April 24, 2016, 12:45:02 pm »

No solutions regarding the foreign question, but I think I've worked out why they can't wear the things: for some reason DFHack spawns the "large" version of the armour rather than the normal ones, which dorfs can wear. Any idea why this is so?
Logged
How do I do it? Prune juice.

vjmdhzgr

  • Bay Watcher
  • Hehehe
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #6 on: April 24, 2016, 01:03:21 pm »

Have you checked the errorlog? It might help here.
Logged
Its a feature. Impregnating booze is a planned tech tree for dwarves and this is a sneak peek at it.
Unless you're past reproductive age. Then you're pretty much an extension of your kids' genitalia

Grimlocke

  • Bay Watcher
  • *kobold noises*
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #7 on: April 24, 2016, 02:09:49 pm »

Hmm, you can still try [ARMOR:ITEM_ARMOR_ALNISRATH:FORCED]. Keep in mind that this may cause your entity to never use any armor that is on the same bodypart and clothing layer, if those are still marked with COMMON, UNCOMMON or RARE.

DFhack probably spawns a human-sized armor, which is the default size for any clothing piece created with a reaction. The game making them the right size from fortress mode reactions is a fairly recent addition, probably whatever you are using to spawn stuff form DFhack hasn't got this functionality yet (or maybe it does, check the help command?).
Logged
I make Grimlocke's History & Realism Mods. Its got poleaxes, sturdy joints and bloomeries. Now compatible with DF Revised!

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #8 on: April 24, 2016, 02:19:36 pm »

DFhack probably spawns a human-sized armor, which is the default size for any clothing piece created with a reaction. The game making them the right size from fortress mode reactions is a fairly recent addition, probably whatever you are using to spawn stuff form DFhack hasn't got this functionality yet (or maybe it does, check the help command?).
Figured it out - turns out when you use DFHack's createitem, which spawns a given item at a selected unit's feet, DFHack automatically figures out the right size for that unit and adjusts appropriately. In other words, the reason I was getting the wrong size of armor is because DFHack was attempting to create clothing that would fit my one-humped camel. Selected a dwarf, it worked out fine.

This still does not solve the "problem" of the armor being marked as (foreign), however -- not that it matters anymore, but I want to know all the same.

Hmm, you can still try [ARMOR:ITEM_ARMOR_ALNISRATH:FORCED]. Keep in mind that this may cause your entity to never use any armor that is on the same bodypart and clothing layer, if those are still marked with COMMON, UNCOMMON or RARE.
I'll give this a punt and post how it goes.
Logged
How do I do it? Prune juice.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: What makes "foreign" armour foreign?
« Reply #9 on: April 24, 2016, 04:22:07 pm »

Figured it out - turns out when you use DFHack's createitem, which spawns a given item at a selected unit's feet, DFHack automatically figures out the right size for that unit and adjusts appropriately. In other words, the reason I was getting the wrong size of armor is because DFHack was attempting to create clothing that would fit my one-humped camel. Selected a dwarf, it worked out fine.
The way "createitem" works is that DFHack defines a temporary custom reaction (which takes no ingredients and produces the item you specified) and then has the selected unit perform that reaction - that's why you need to select a unit in order to use the command. Automatically selecting the correct armor size is something Dwarf Fortress happens to do for us, which is why we use that particular method.
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #10 on: April 24, 2016, 05:45:51 pm »

The way "createitem" works is that DFHack defines a temporary custom reaction (which takes no ingredients and produces the item you specified) and then has the selected unit perform that reaction - that's why you need to select a unit in order to use the command. Automatically selecting the correct armor size is something Dwarf Fortress happens to do for us, which is why we use that particular method.
Well isn't that neat. Didn't know how DFHack's guts worked, thanks for info.

Setting entity token for the armor to FORCED changed nada. I've also discovered that though createitem spawns armor that's sized up for urist just fine, dwarves refuse to put it on, or even put it in a stockpile. I've also discovered that contrary to what I thought, it doesn't show up in the listing of armor I can make in the forge. This is frustrating - the same setup for breastplates works just fine on all counts. Is foreign vs non-foreign hardcoded?

If so I think there may be leeway for worming my armor in via having it replace dresses.
Logged
How do I do it? Prune juice.

scamtank

  • Bay Watcher
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #11 on: April 24, 2016, 06:30:07 pm »

Try giving it an ARMORLEVEL token that's on par with normal armor. Right now it's defaulting to zero (civilian grade).

You could've also just stuck the permission line in completely the wrong entity, too.
Logged

Roach

  • Bay Watcher
  • [IMMOLATE][LIKES_HUGGING]
    • View Profile
Re: What makes "foreign" armour foreign?
« Reply #12 on: April 25, 2016, 06:43:20 am »

Try giving it an ARMORLEVEL token that's on par with normal armor. Right now it's defaulting to zero (civilian grade).
This worked! You da man, instantly fixed and worn - thank you.

From the wiki:
Quote
[ARMORLEVEL is] The garment's general purpose. Defaults to 1 for shields, 0 for everything else. Class 0 items [like this armor was] are claimed and used by civilians as ordinary clothing and are subject to wear.
No wonder this didn't work.
Logged
How do I do it? Prune juice.