NiGHTMARE Posted March 27, 2005 Share Posted March 27, 2005 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
SConrad Posted March 27, 2005 Share Posted March 27, 2005 Without reading every word of this post; INSERT_BYTES . EDIT: Yeh, this involves tp2 ninjary. Link to comment
NiGHTMARE Posted March 27, 2005 Author Share Posted March 27, 2005 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
SConrad Posted March 27, 2005 Share Posted March 27, 2005 You should probably insert the bytes before writing them. How are you trying to change the type now? Link to comment
NiGHTMARE Posted March 27, 2005 Author Share Posted March 27, 2005 Good point . I've tried changing the type using both WRITE_SHORT and WRITE_ASCII. Link to comment
SConrad Posted March 27, 2005 Share Posted March 27, 2005 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
NiGHTMARE Posted March 27, 2005 Author Share Posted March 27, 2005 Well I've already tried it in hex without success, so I'll give binary a go. Link to comment
Avenger Posted March 28, 2005 Share Posted March 28, 2005 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
NiGHTMARE Posted March 28, 2005 Author Share Posted March 28, 2005 I think I must have been trying to write to the wrong byte or something, since it seems to be fine now. Link to comment
Rastor Posted March 28, 2005 Share Posted March 28, 2005 Would ADD_KNOWN_SPELL work here? Seems like it would be a little easier. Link to comment
Avenger Posted March 28, 2005 Share Posted March 28, 2005 OOps, i thought you want to add effects to the creature Adding spells could work with AddSpecialAbility("xyz") Link to comment
NiGHTMARE Posted March 28, 2005 Author Share Posted March 28, 2005 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
Recommended Posts
Archived
This topic is now archived and is closed to further replies.