Forum Archive

Go Back   3D Realms Forums > 3D Realms Topics > Duke Nukem > Duke Nukem 3D Modifications
Blogs FAQ Community Calendar

Notices

 
 
Thread Tools
Old 06-14-2006, 12:13 AM   #1
DeeperThought

DeeperThought's Avatar
Unhappy "po"
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.
DeeperThought is offline  
Old 06-14-2006, 01:49 AM   #2
DeeperThought

DeeperThought's Avatar
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).
DeeperThought is offline  
Old 06-14-2006, 05:51 PM   #3
TerminX

TerminX's Avatar
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.
Last edited by TerminX; 06-14-2006 at 05:56 PM.
TerminX is offline  
Old 06-14-2006, 07:15 PM   #4
DeeperThought

DeeperThought's Avatar
Re: "po"
Quote:
Originally Posted by TerminX
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.
My beliefs about how things work are regularly updated. For example, now I know that a block of CON code can effect the game even if the CON commands it contains never get executed because the relevant conditions aren't satisfied in game. Beyond that, I can only conjecture. Perhaps the functions referred to in the CON code are loaded into memory even if they do not end up being used, and errors in the way the functions are specified can result in bad stuff happening, like quote 3 being changed so that it can only hold 2 bytes. Maybe you left out an asterisk or something so instead of referring to whatever you were supposed to be referring to you ended up referring to some random spot that happened to be quote 3.
DeeperThought is offline  
Old 06-14-2006, 07:27 PM   #5
TerminX

TerminX's Avatar
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.
TerminX is offline  
Old 06-14-2006, 08:42 PM   #6
DeeperThought

DeeperThought's Avatar
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.
DeeperThought is offline  
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:38 PM.

Page generated in 0.09682202 seconds (100.00% PHP - 0% MySQL) with 18 queries

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

Website is ©1987-2014 Apogee Software, Ltd.
Ideas and messages posted here become property of Apogee Software Ltd.