![]() |
#1 |
![]()
HEAVILY RE-EDITED:
When the medkit is picked up or selected in my mod, instead of displaying "PORTABLE MEDKIT" (quote 3) the game displays "PO" (the first two letters of the quote). I commented out all of my EVENT_DISPLAYREST code, and at that point the quote displayed correctly. So it has something to do with my code in that event... SEE BELOW
Last edited by DeeperThought; 06-14-2006 at 01:51 AM.
|
|
![]() |
![]() |
#2 |
Re: "po"
This is the line that is causing the trouble:
redefinequote 170 10 Note that I am intentionally redefining quote 170 so that quote 170 is "10". I want quote 170 to display the string "10". I am not accidentally putting a number in there. But the truly strange thing is, I have other redefinequotes in EVENT_DISPLAYREST that do the same thing (only with different numbers), and none of these other cause the problem. Stranger still, this problematic line of code is part of a block that isn't even being executed. The entire block is set to execute only when the variable menutoggle is set to 1, and that is the case only when the player presses the menu key. But the error (displaying "PO" instead of the entire string "PORTABLE MEDKIT" occurs even when the menu is off). |
|
![]() |
![]() |
#3 |
Re: "po"
Heh, things don't quite work as you appear to think they do, but this is just a small bug that I'll post a fix for later. The problem is pretty much just a typo in my code.
__________________
EDuke32 | Duke4.net forums, the largest Duke Nukem 3D community on the Internet Visit #eduke32 on irc.freenode.net!
Last edited by TerminX; 06-14-2006 at 05:56 PM.
|
|
![]() |
![]() |
#4 | |
Re: "po"
Quote:
|
||
![]() |
![]() |
#5 |
Re: "po"
When the CONs are compiled, all of the quotes defined via definequote are stored in memory (it used to be a static array of text, but in 1.4.0 I changed it to dynamically allocate the memory during compile). All of the quotes redefined by redefinequote are saved in a different set of dynamically allocated memory. As all quotes are merely zero terminated strings, I write '\0' into the next byte of memory after the quote's actual text. However, a typo I made caused that \0 to get written into the quotes defined by definequote rather than those of redefinequote.
As such, it can be inferred that your "redefinequote 170 10" was the fourth instance of redefinequote present in your CON files, which is how I knew what the problem was. |
|
![]() |
![]() |
#6 |
Re: "po"
I see. So quotes 0, 1 and 2 were also shortened. If the last redefinequote had been a longer string, this could have gone unnoticed.
|
|
![]() |
Bookmarks |
|
|