Jump to content

Need help re: .cre's


Recommended Posts

It seems if you add extra memorized spells (via WRITE_SHORT 0x2b4) to a creature which has one or more effects, the effects aren't pushed down, and try to use the same bytes as the new spells. You can move the effect slots with WRITE_SHORT 0x2c4, but then the effects data remains in the original spell slot, and you get a load of gibberish for the effects values. I'm sure there's some fancy WeiDU ninjary to get around this, so would anyone care to share? :)


Trying to fix this problem also raised another problem. How the heck do you correctly change the "Type" field of a .cre's effect? I can modify "Signature", "Version", "Targettype", "Duration", etc, etc correctly, but trying to insert anything into "Type" results in something completely different than I intended.

Link to comment

Aha, so basically something like


    READ_LONG 0x2c4 "effects_offset"
   WRITE_SHORT 0x2c4 ("effects_offset" + 0x24)
   INSERT_BYTES "effects_offset" 36


Thanks :). This still leaves the second problem, though it's not so urgent any more

Link to comment

I'd say you probably want to edit it as hex or as binary instead of text.


So, instead of trying to change it to WRITE_ASCII "Movementrate bonus (126)", you might want to change it into WRITE_SHORT 0x7e or WRITE SHORT 0b01111110. :)

Link to comment

OMG, you don't have to use binary. Decimal or hex should be good enough.

Course of events:

Insert bytes

Write effect data (all fields need to be updated)

Update effect count in header

Update other offsets that come after the effects (if any)


Btw, isn't it easier to use ApplySpellRES from script?

Link to comment

I did want to add an effect to the creature (immunity to standard thief traps to be precise) :). I managed to do that fine, it was modifying one of the fields that was causing problems.


However, I've since realised the creature already had an item that granted it various effects, so it would be a lot easier just to add the effect to that :).

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...