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 ]
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 ]
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 ]
Thanks a lot for your help.
(http://i5.photobucket.com/albums/y181/kulihooray/kulisword1.jpg)
I wonder why the sword has the grey background, though? Anyone know how I might get rid of it?
(http://i5.photobucket.com/albums/y181/kulihooray/kulisword2.jpg)
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.
EDIT or 7:0:1 if you wanted it white
[ March 13, 2008: Message edited by: Wiles ]