Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: New creature causing crashes  (Read 2425 times)

Kuli

  • Bay Watcher
  • Born-Again Zefonist
    • View Profile
New creature causing crashes
« on: March 13, 2008, 05:45:00 pm »

Well, I'm a total modding newbie.  I had a cool idea for a new creature - a cursed sword that was animated through foul magic.  I wanted it so that you could kill the thing, then use its corpse as a new weapon.  That way you would actually get a reward for an adventure mode quest for once.

I made the thing, generated a world, and eventually got a quest to go kill Fima Morningmeadow the haunted sword.  I find the thing, exchange a few blows, then the game crashes.  I tried again a few times and very consistently the game would crash after a few rounds of combat.

I look to you more experienced DF modders for assistance.  Where do you think I went wrong?  Here's the creature entry:

code:
[CREATURE:SWORD_HAUNTED]
   [NAME:haunted sword:haunted swords:haunted sword]
   [TILE:'/'][COLOR:7:7:1]
   [SEMIMEGABEAST]
   [GENPOWER:5]
   [BUTCHERABLE_NONSTANDARD]
   [FANCIFUL]
   [CANOPENDOORS]
   [PREFSTRING:deadliness]
   [BODY:BASIC_SWORDBODY]
   [FLIER]
   [NOT_BUTCHERABLE]
   [NOPAIN][EXTRAVISION][NOBREATHE][NOBLEED][NOSTUN][NONAUSEA][NOEMOTION]
       [RECKLESS][NOSTUCKINS][SEVERONBREAKS][NOSKULL][NOSKIN][NOBONES][NOMEAT]
       [NOTHOUGHT][NOEXERT]
   [BUILDINGDESTROYER:2]
   [DAMBLOCK:10]
   [NOFEAR]
   [SIZE:10]
   [ATTACK:MAIN:BYTYPE:BLADE:cut:cuts:1:2:SLASH][ATTACKFLAG_WITH]
   [ATTACK:MAIN:BYTYPE:BLADE:stab:stabs:1:3:PIERCE][ATTACKFLAG_WITH]
   [EQUIPS]
   [DIURNAL]
   [BIOME:ANY_LAND]
   [ITEMCORPSE:SWORD:NO_SUBTYPE:METAL:SILVER]
   [ITEMCORPSE_QUALITY:5]
   [NO_DRINK][NO_EAT][NO_SLEEP]
   [NO_GENDER]
   [MATERIAL:METAL:SILVER]
   [SWIMS_LEARNED][SWIM_SPEED:2500]

This part should be okay.  I pretty much just copied the Bronze Colossus entry, changed the size, attacks, and corpse item, then added the [FLIER] tag.  I figured [FLIER] would be necessary since it doesn't have any legs.  There isn't a [LEVITATE] tag or anything like that is there?

I suspect the problem is with its body_default entry, because here is where I don't really know what I'm doing.

code:

[BODY:BASIC_SWORDBODY]
[BP:UB:blade][UPPERBODY][HEAD]
[BP:LB:hilt][CON:UB][LOWERBODY][STANCE]

The theory was that the hilt would control movement, so damaging it would be like damaging another creature's feet or legs.  Thus the [STANCE] tag.  The blade acts as the head so that the creature dies when the blade is destroyed.

So guys, how can I make a sword-creature that works?

[ March 13, 2008: Message edited by: Kuli ]

Logged
"The power of Zefon compels you!"

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: New creature causing crashes
« Reply #1 on: March 13, 2008, 05:54:00 pm »

Anything with a [STANCE] tag is technically a leg, so you don't need a [FLIER].

As to your problem, I think it's your Itemcorpse. There is no TYPE entitled SWORD, according to the wiki. Although I've had faulty itemcorpses before, they've never crashed the game, though I've never had a faulty TYPE section before...

The only thing I can think of offhand would be [ITEMCORPSE:WEAPON:SWORD:METAL:SILVER]. The wiki doesn't have anything listed under SUBTYPE (where the SWORD is in that token I just showed you), but it's worth a shot, and if it doesn't work at least it *shouldn't* crash your game this time.

If that doesn't work either, try taking the itemcorpse off temporarily and see what happens.

Oh, and yeah, look at the errorlog.

[ March 13, 2008: Message edited by: Untelligent ]

Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Dwarmin

  • Bay Watcher
  • Where do we go from here?
    • View Profile
Re: New creature causing crashes
« Reply #2 on: March 13, 2008, 06:01:00 pm »

What does your errorlog say? You might find the problem there.
Logged
Dwarmin's fell gaze has fallen upon you. Sadly, Your life and your quest end here, at this sig.

"The hats never coming off."

Kuli

  • Bay Watcher
  • Born-Again Zefonist
    • View Profile
Re: New creature causing crashes
« Reply #3 on: March 13, 2008, 06:07:00 pm »

well, let's see...

Unrecognized Item Token: SWORD
Unrecognized Item Token: SWORD
Unrecognized Item Token: SWORD
Unrecognized Item Token: SWORD

Okay, I imagine that has something to do with it.  Heh.

Oh, I see.  The game is crashing when it dies because there's no such thing as a "sword."  It has to be a short sword or a scimitar, or something like that.  I think replacing the itemcorpse SWORD with SWORD_LONG shoud do it, right?

This also means it's dying way too easily.  Better make it stronger too.

[ March 13, 2008: Message edited by: Kuli ]

Logged
"The power of Zefon compels you!"

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: New creature causing crashes
« Reply #4 on: March 13, 2008, 06:15:00 pm »

I doubt that'd work. As I said in my last post, I don't know about the other three, but I'm VERY SURE you need to replace SWORD with WEAPON.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Kuli

  • Bay Watcher
  • Born-Again Zefonist
    • View Profile
Re: New creature causing crashes
« Reply #5 on: March 13, 2008, 06:17:00 pm »

Oh, the sword has to be the subtype of the itemcorpse weapon.  Gotcha.

Thanks a lot for your help.

Logged
"The power of Zefon compels you!"

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: New creature causing crashes
« Reply #6 on: March 13, 2008, 06:17:00 pm »

The proper syntax is [ITEMCORPSE:WEAPON:ITEM_WEAPON_SWORD_LONG:METAL:SILVER], assuming you need a silver longsword. The subtype is the item ID.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: New creature causing crashes
« Reply #7 on: March 13, 2008, 06:22:00 pm »

^ Yeah, I had a feeling my guess about the subtype was wrong in some way.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Helmaroc

  • Bay Watcher
    • View Profile
Re: New creature causing crashes
« Reply #8 on: March 13, 2008, 06:24:00 pm »

Would you mind posting the working file? It sounds like an interesting creature.
Logged

Kuli

  • Bay Watcher
  • Born-Again Zefonist
    • View Profile
Re: New creature causing crashes
« Reply #9 on: March 13, 2008, 07:28:00 pm »

Hooray, I got it to work!  Thanks, everyone.

I wonder why the sword has the grey background, though?  Anyone know how I might get rid of it?

A successful death.  No crashes.  Considering I cut the hilt off, I probably shouldn't get an intact sword, but oh well.  Gameplay above realism, I always say.

Helmaroc, I'll post the final creature when I've tweaked it a bit.  Right now the haunted sword is much too easy to kill.

Logged
"The power of Zefon compels you!"

Wiles

  • Bay Watcher
    • View Profile
Re: New creature causing crashes
« Reply #10 on: March 13, 2008, 07:35:00 pm »

change his colour from 7:7:1 to 7:0:0 (light grey) or 0:0:1 (dark grey) to make it grey without a background.

EDIT or 7:0:1 if you wanted it white

[ March 13, 2008: Message edited by: Wiles ]

Logged

Kuli

  • Bay Watcher
  • Born-Again Zefonist
    • View Profile
Re: New creature causing crashes
« Reply #11 on: March 13, 2008, 07:39:00 pm »

Thanks.  I wasn't sure what the color-related numbers meant.  I just copied the color from silver the metal.
Logged
"The power of Zefon compels you!"

Gaulgath

  • Bay Watcher
  • ♪ Gold gold gold gold ♪
    • View Profile
Re: New creature causing crashes
« Reply #12 on: March 13, 2008, 07:49:00 pm »

Haha! Very unique monster. I suppose it earned its name (in the screenshot) from killing a past adventurer?
Logged

Kuli

  • Bay Watcher
  • Born-Again Zefonist
    • View Profile
Re: New creature causing crashes
« Reply #13 on: March 13, 2008, 07:56:00 pm »

It gets a name because it has the [SEMIMEGABEAST] tag.  Just like minotaurs and ettins and other such beings.  I was tempted to use [MEGABEAST], but thought it might be weird to have a fortress get invaded by a floating sword.
Logged
"The power of Zefon compels you!"