Andyr Posted May 27, 2004 Share Posted May 27, 2004 In an effort to become more efficient like Cam and Idobek, I'm making some creatures for a quest using COPY_EXISTING rather than making a new one myself. Here's my code: COPY_EXISTING ~CHEVIL07.CRE~ ~override/X#VIC2PRI.CRE~ SAY NAME1 ~Threlambia~ SAY NAME2 ~Threlambia~ WRITE_LONG 0x14 400 //XP value WRITE_ASCII 0x246 ~PRIET12A~ //Override script WRITE_ASCII 0x280 ~X#VIC2PRI~ //Death Variable WRITE_ASCII 0x77c ~_CHAN02~ WRITE_ASCII 0x790 ~_SHLD14~ Offsets 0x77c and 0x790 are items, though the items the original creature had were longer, so I'm ending up instead with _CHAN021 and _SHLD141... How can I over-write this spillover? Link to comment
icelus Posted May 27, 2004 Share Posted May 27, 2004 I'd like to know the answer, as well. Once upon a time, someone suggested adding a hard return to the .tp2 for each space that was needed, but I can't recall if that fixed the problem I was having at the time or not. Link to comment
CamDawg Posted May 27, 2004 Share Posted May 27, 2004 You can use one of the flavors of WRITE_BYTE to "zero" the extra spaces. So you could use: WRITE_ASCII 0x246 ~PRIET12A~ //Override script WRITE_ASCII 0x280 ~X#VIC2PRI~ //Death Variable WRITE_ASCII 0x77c ~_CHAN02~ WRITE_BYTE 0x783 0 WRITE_ASCII 0x790 ~_SHLD14~ WRITE_BYTE 0x797 0 Alternatively, you could always 0 the entire field before using WRITE_ASCII with a pair of WRITE_LONGs. In general, WRITE_LONG offset 0 WRITE_LONG (offset + 0x04) 0 WRITE_ASCII offset ~whatever~ This is typically overkill, but will definitely work in all situations. Link to comment
Andyr Posted May 27, 2004 Author Share Posted May 27, 2004 Ace, cheers. Will do that. Link to comment
Idobek Posted May 27, 2004 Share Posted May 27, 2004 When you WRITE_LONG in this situation you need to use 4 zeros. WRITE_LONG offset 0000 Otherwise it will act like a WRITE_BYTE and only clear the first byte. WRITE_BYTE needs 1 zero and WRITE_SHORT needs 2. EDIT: The above is apparently wrong. I tend to use hex values and thought the same principles applied. The following is how hex values should be written: WRITE_BYTE offset 0x00 WRITE_SHORT offset 0x0000 WRITE_LONG offset 0x00000000 Link to comment
Ghreyfain Posted May 28, 2004 Share Posted May 28, 2004 Yeah, 0d is both 00h and 0000 0000h. Another method I think I once used to solve this problem was opening my .tp2 with a hex editor and making the two trailing spaces in the field "00". Heh. Link to comment
hlidskialf Posted May 28, 2004 Share Posted May 28, 2004 Ghrey loves any excuse to use his hex editor, I think it's cast a domination on him. Link to comment
Ghreyfain Posted May 28, 2004 Share Posted May 28, 2004 Well, when you think about it, what is WeiDU but a big trumped up Hex Editor? Oh yeah, and there's SET_STRING. We can't forget that. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.