Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFHack oddity  (Read 1188 times)

Dastardly Jack

  • Bay Watcher
    • View Profile
DFHack oddity
« on: May 21, 2014, 05:01:52 pm »

So I'm messing around with DFHack and creating some items (Using the createitem command, obviously) and I decided to make myself a crutch. (My adventurer's missing a leg from when he fought a dragon, and crawling everywhere is annoying) but strangely enough it immediately crashed the game. In fact, it crashes every time I try to spawn a crutch. And it's not just my game, either, I downloaded another copy just to test it out. The command I'm inputting is "createitem NONE:ITEM_NONE_CRUTCH OAK 1"

Any ideas on how I can get around this? And before you say so, no I cannot find one in a store somewhere. Trust me, I've tried.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: DFHack oddity
« Reply #1 on: May 21, 2014, 05:57:05 pm »

That is not the raw code for a crutch item, it should be.... I forget.
Try CRUTCH:NONE, that might work, if not take a look at the wiki.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack oddity
« Reply #2 on: May 21, 2014, 06:24:50 pm »

Look up the crutch token instead of trying to guess it...

Dastardly Jack

  • Bay Watcher
    • View Profile
Re: DFHack oddity
« Reply #3 on: May 21, 2014, 06:39:32 pm »

Er... I did look it up.

Anyways, nevermind. I figured it out myself after some guessing. Turns out you just type "createitem ITEM_CRUTCH material #"

Who knew?
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack oddity
« Reply #4 on: May 21, 2014, 06:40:00 pm »

... it's CRUTCH:NONE. That's what the article I just linked said.

Dastardly Jack

  • Bay Watcher
    • View Profile
Re: DFHack oddity
« Reply #5 on: May 21, 2014, 06:42:21 pm »

Right, but that crashed the game. In fact, any item with the NONE bit on it that I tried to spawn crashed the game. (Backpacks included.)
But when I got rid of the 'NONE' subtype in the command, it worked perfectly.

So, that's pretty neat.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack oddity
« Reply #6 on: May 21, 2014, 07:53:58 pm »

No, NONE:ITEM_NONE_CRUTCH did. Does CRUTCH:NONE?

Dastardly Jack

  • Bay Watcher
    • View Profile
Re: DFHack oddity
« Reply #7 on: May 21, 2014, 08:07:56 pm »

Yes, if it included NONE in any way it crashed the game. Oh, and since the problem has been solved, I'm done with this particular thread.

Oh, by the way, I messed up earlier. The command that DID work was actually

"createitem CRUTCH material #" without the ITEM_ in there at all. Weird.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack oddity
« Reply #8 on: May 21, 2014, 08:08:48 pm »

Because ITEM_ isn't necessary... pretty much ever, actually. Toady only uses it as convention.

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: DFHack oddity
« Reply #9 on: May 22, 2014, 08:15:19 am »

Typing CRUTCH:NONE doesn't make it crash - I just tried, and it reports "Unrecognized item type" because DFHack's Items module contains a bug which makes it return an error if you try to specify a subtype for an item that doesn't use subtypes (even if that subtype is NONE, as used in the raws).

Trying to specify an item type of NONE (e.g. NONE:WHATEVER) will definitely crash the game, because DFHack's Items module also claims that "NONE" is a valid item type and createitem doesn't contain logic to filter it out.

Both of the above bugs should be fixed for the next release.

Because ITEM_ isn't necessary... pretty much ever, actually. Toady only uses it as convention.
Actually, the ITEM_ is only used in subtypes defined in the raws, and CRUTCH is an item type (which is entirely hardcoded).
« Last Edit: May 22, 2014, 08:19:59 am by Quietust »
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.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: DFHack oddity
« Reply #10 on: May 22, 2014, 09:48:35 am »

Yeah, that's what I meant, but I did forget to mention that it's a convention for subtypes.