Jump to content


Photo

Note about WRITE_ASCII


  • Please log in to reply
4 replies to this topic

#1 dorotea

dorotea

    witch extraordinaire

  • Modder
  • 1927 posts

Posted 28 December 2002 - 12:53 PM

It took me about half a day to figure out that when you try to use WRITE_ASCII to replace already existing string it had to be exactly the same length or larger ( never tried larger but I suppose it will work)

I needed replace a dialog say

Noober1.dlg with New.dlg in the cre file

by doing

WRITE_ASCII 0x2CC ~New~


And - it always came out as Newber1.dlg which kind of made me tear my hair out until I realised what was going on.

Freedom cannot be equated with goodness, virtue, or perfection. Freedom has its own unique self-contained nature; freedom is freedom ? not universal goodness. Any confusion or deliberate equalization of freedom with goodness and excellence is in itself negation of freedom, and acceptance of the path of restraint and enforcement.

Nikolai Berdyaev - Christian Existentialist, Philosopher of Freedom.


The Longer Road mod
Redemption mod
Bitter Grey Ashes


#2 japheth

japheth

    Codewalker

  • Member
  • 317 posts

Posted 30 December 2002 - 01:11 PM

You have to embed a null character in the file to terminate the string since WeiDU doesn't do it for you.

This can be done by opening up your .tp2 file after it's been completed in a hex editor, finding the offset where you need to embed a null character, and inserting 00 hex right after the end of the string.

EditPadPro is pretty good for this since you can switch between Hex, Unicode, and ANSI with it.

You can get it here.

Oh, and as a side note, ALT+255 is *not* an ASCII null character. I'm not sure what the ALT code is (or if there even is an ASCII ALT code) for a null character.
Check out BG1Tutu.

#3 Lone Wolf

Lone Wolf

    The guy with the most serious looking avatar ever

  • Member
  • 13 posts

Posted 31 December 2002 - 07:27 AM

There is no ALT shortcut for an NULL char. The first 32 ASCII chars don't get displayed in Windows(that is in plain text mode), Tabs, Linefeeds & carriage returns excluded.
The speed of light just isn't fast enough.

#4 dorotea

dorotea

    witch extraordinaire

  • Modder
  • 1927 posts

Posted 31 December 2002 - 11:18 AM

Just downloaded EditPadPro - and going to try it now!

Thanks japheth - you are the best!

Now if only somebody can look through the "Redemption' code with an eye of a professional ...

But that's asking too much!

;)

Freedom cannot be equated with goodness, virtue, or perfection. Freedom has its own unique self-contained nature; freedom is freedom ? not universal goodness. Any confusion or deliberate equalization of freedom with goodness and excellence is in itself negation of freedom, and acceptance of the path of restraint and enforcement.

Nikolai Berdyaev - Christian Existentialist, Philosopher of Freedom.


The Longer Road mod
Redemption mod
Bitter Grey Ashes


#5 Blucher

Blucher
  • Member
  • 97 posts

Posted 02 January 2003 - 03:58 PM

This was giving me trouble too, but I found a very simple and easy way.

Make sure your tp2 file is in unix text format (no windows notepad, etc. use an editor like PFE, ConTEXT & Co.). Whenever you want to add a terminating null just hit [ENTER] each time you need a truly blank spot.

For instance:

WRITE_ASCII 0x250 ~none



~

Where you'd type:
[tilde] [n] [o] [n] [e] [enter] [enter] [enter] [enter] [tilde]

If that makes any sense. :)