A handy little tool I made

Discussion in 'Modding Discussion' started by Wedge of Cheese, Dec 17, 2008.

Old topic!
The last post in this thread is over 60 days old. Posting in this thread will be considered a bump, so please make an attempt to be courteous if you go ahead with it.

If the last post is over 6 months old, it may instead be a better idea to start a new topic. If you aren't sure about what to do, feel free to ask a staff member for help, or try to locate a 'general questions'-type thread if it exists in this (sub-)forum.
  1. Dec 17, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    This tool allows you to edit the "npc.tbl" file. When you run the program, start by finding the "npc.tbl" file that you want to edit. Then, you can edit the file by entering the number of the NPC that you wish to edit into the textbox at the top and pressing "save". This will save all the data in the window into that NPC. You can load the data for any NPC in the file by typing the NPC number into the textbox and pressing "load"

    Here's the program


    This was programmed in Liberty BASIC. For those of you who know that language, or are just interested in seeing the source code, here it is. Feel free to edit/distribute the source code as much as you like.
     
  2. Dec 18, 2008
    ZarroTsu
    Been here way too long...
    "What're YOU lookin' at?"
    Join Date: Jan 21, 2007
    Location:
    Posts: 1111
    Age: 28
    General NPC hacking problem ensues:

    Upon changing a value to an amount too large or small (or something), I think it shifts the tables, causing other npcs beyond the edited one to act weird and/or broken. For example, critters gain infinite HP, and bats drop 100 experience. additionally, death sounds are mixed up.

    It's possible to fix all of them after the change, but mind you it's either a loop of editing that effects all npcs if the value is too large or small (and it'd effect vice-versa too), or just a common game error that can be fixed. I dunno.

    So generally speaking, experience, health, and death sounds either break, or are erased. After initially editing, you'll have to fix them...

    Death sounds start at 70;

    70 - small enemy death (bat)
    71 - medium enemy death (critter, and... I guess most enemies in the game)


    But of course, there's also other bugs such as balrog jittering around like he's on some profound drug. Obviously the game reads the npc table only one way, and any major edits to values completely breaks the game. bah.

    Other interesting points are HP values, which are set to specific numbers like 100, to which the sprite's health is hardly that much. For example are hell enemies.



    I suppose overall it's a good tool, but in general; The game doesn't WANT to be edited... Heh.

    EDIT: additionally, after closing the program, and replacing npc.tbl; the program refuses to open under some error. even after deleting the program and replacing it, it refuses to work any more. hmm...
     
  3. Dec 18, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    Um, ok, this is odd because I have used this tool many times to edit the npc.tbl of my Wrath of Revorshkenahl mod and haven't experienced any of the problems you listed. Are you entering strange values like negatives, fractions, or numbers greater than 2 to the n where n is the number of bits?
     
  4. Dec 18, 2008
    S. P. Gardebiter
    Just some person
    "Life begins and ends with Nu."
    Join Date: Dec 30, 2005
    Location: Germany
    Posts: 3213
    Age: 26
    Darn, you have no data types according to your source, that makes the whole thing alot of harder.
    It may be easier to store every value into an own array.
    Look out for buffer overflows, there maybe was a buffer overflow.
    Do you verify the health value, meaning in a way of:

     
  5. Dec 18, 2008
    Celtic Minstrel
    In front of a computer
    "Man, if only I had an apple..."
    Join Date: Mar 1, 2008
    Location: Grasstown
    Posts: 1435
    ...You mean numbers greater than 2^n-1 !
     
  6. Dec 18, 2008
    ZarroTsu
    Been here way too long...
    "What're YOU lookin' at?"
    Join Date: Jan 21, 2007
    Location:
    Posts: 1111
    Age: 28
    Well, in any case; I can't get it to run again, as I said before, even after replacing both the npc table and the program.





    Error log timestamp Thursday 18/12/08 02:06:26 PM

    Runtime error: "isEmpty" not understood

    MessageNotUnderstood>>defaultAction
    MessageNotUnderstood(Exception)>>activateHandler: <anUndefinedObject>
    MessageNotUnderstood(Exception)>>handle
    MessageNotUnderstood(Exception)>>signal
    MessageNotUnderstood class>>message: <aMessage>
    UndefinedObject(Object)>>doesNotUnderstand: <aMessage>
    BasicRunProgram(BasicProgram)>>terminateRun: <aFileSystemAccessDenied>
    [] in BasicProgram>>errorHandlerBlock
    ExceptionHandler>>evaluateResponseBlock: <aBlockClosure> for: <aFileSystemAccessDenied>
    [] in ExceptionHandler>>handle:
    ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure>
    BlockClosure>>invisibleEnsure: <aBlockClosure>
    ExceptionHandler>>handle: <aFileSystemAccessDenied>
    ExceptionHandler>>findHandler: <aFileSystemAccessDenied>
    FileSystemAccessDenied(Exception)>>activateHandler: <anExceptionHandler>
    FileSystemAccessDenied(Exception)>>handle
    FileSystemAccessDenied(Exception)>>signal
    FileSystemAccessDenied class(Exception class)>>signal
    HostFileSystemError>>defaultAction
    ExceptionHandler>>findHandler: <aHostFileSystemError>
    HostFileSystemError(Exception)>>activateHandler: <anExceptionHandler>
    HostFileSystemError(Exception)>>handle
    HostFileSystemError(Exception)>>signal
    HostFileSystemError class>>signalWith: <5>
    FileHandle class>>osError: <5>
    FileHandle class(Object)>>osError
    [] in FileHandle class>>open:access:share:create:attributes:
    ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure>
    [] in ExceptionHandler>>activateDuring:
    ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure>
    BlockClosure>>invisibleEnsure: <aBlockClosure>
    ExceptionHandler>>activateDuring: <aBlockClosure>
    ExceptionHandler class>>handle: <anExceptionSet> with: <aBlockClosure> during: <aBlockClosure>
    BlockClosure>>on: <anExceptionSet> do: <aBlockClosure>
    FileHandle class>>open: <'C:\Users\zach\Edges ...'> access: <3221225472> share: <3> create: <4> attributes: <128>
    FileHandle class>>open: <'npc.tbl'> in: <aDirectory> access: <3221225472> share: <3> create: <4> attributes: <128>
    FileHandle class>>open: <'npc.tbl'> in: <aDirectory>
    File>>open
    File class>>open: <'npc.tbl'> in: <aDirectory>
    Directory>>file: <'npc.tbl'>
    BasicRandomFile(BasicFile)>>from: <'C:\Users\zach\Edges ...'> mode: <'BINARY'> handle: <'#2'>
    BasicRandomFile class(BasicFile class)>>from: <'C:\Users\zach\Edges ...'> mode: <'BINARY'> handle: <'#2'> owner: <aBasicRunProgram> length: <128>
    [] in OpenCommand>>using:
    [] in BasicRunProgram>>begin
    ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure>
    [] in ExceptionHandler>>activateDuring:
    ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure>
    BlockClosure>>invisibleEnsure: <aBlockClosure>
    ExceptionHandler>>activateDuring: <aBlockClosure>
    ExceptionHandler class>>handle: <anError class> with: <aBlockClosure> during: <aBlockClosure>
     
  7. Dec 18, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    Oh, no, not the dreaded "isEmpty not understood" error! I think that error message is due to a bug in the programming language.

    @SP: I don't have anything like that, I should probably add that.
     
  8. Dec 18, 2008
    S. P. Gardebiter
    Just some person
    "Life begins and ends with Nu."
    Join Date: Dec 30, 2005
    Location: Germany
    Posts: 3213
    Age: 26
    Then I can understand why it's buggy if you enter a too high value. It just gets a buffer overflow.
     
  9. Dec 18, 2008
    TheForgottenOne
    The Suicide Option
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jan 1, 2008
    Location: Styx
    Posts: 1973
    Age: 28
    http://i137.photobucket.com/albums/q235/dragonboots/error1.jpg
    http://i137.photobucket.com/albums/q235/dragonboots/error2.jpg


    So, I got those two, and having little understanding of programming, figure that those would be useful with this for debugging. This is a very useful tool in concept, and I'd like to see it perfected. Also, what I did was change npc 1 (weapon energy) so it was shootable, showed damage numbers and dropped hp/missiles. And I got that. >.> Did I ask too much?

    Code:
     
    Error log timestamp Thursday 18/12/08 03:00:21 PM
    Runtime error: Attempt to seek beyond end of file: #2
    Error(Exception)>>defaultAction
    Error(Exception)>>activateHandler: <anUndefinedObject> 
    Error(Exception)>>handle
    Error(Exception)>>signal
    Error class(Exception class)>>signal: <'Attempt to seek beyo...'> 
    BasicRunProgram(Object)>>error: <'Attempt to seek beyo...'> 
    BasicRunProgram(BasicProgram)>>terminateRun: <anError> 
    [] in BasicProgram>>errorHandlerBlock
    ExceptionHandler>>evaluateResponseBlock: <aBlockClosure> for: <anError> 
    [] in ExceptionHandler>>handle:
    ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> 
    BlockClosure>>invisibleEnsure: <aBlockClosure> 
    ExceptionHandler>>handle: <anError> 
    ExceptionHandler>>findHandler: <anError> 
    Error(Exception)>>activateHandler: <anExceptionHandler> 
    Error(Exception)>>handle
    Error(Exception)>>signal
    Error class(Exception class)>>signal: <'Attempt to seek beyo...'> 
    BasicRunProgram(Object)>>error: <'Attempt to seek beyo...'> 
    BasicRunProgram(BasicProgram)>>runError: <'Attempt to seek beyo...'> 
    BasicRunProgram(BasicProgram)>>seekFile: <2> handle: <'#2'> 
    [] in SeekCommand>>using:
    [] in BasicRunProgram>>begin
    ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure> 
    [] in ExceptionHandler>>activateDuring:
    ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> 
    BlockClosure>>invisibleEnsure: <aBlockClosure> 
    ExceptionHandler>>activateDuring: <aBlockClosure> 
    ExceptionHandler class>>handle: <anError class> with: <aBlockClosure> during: <aBlockClosure> 
    BlockClosure>>on: <anError class> do: <aBlockClosure> 
    BasicRunProgram>>begin
    BasicRunProgram(BasicProgram)>>gotoAndIfStoppedBegin: <'[save]'> 
    BasicRunProgram(BasicProgram)>>handlerName: <'[save]'> evaluate: <aBlockClosure> callParameters: <anOrderedCollection> 
    BasicRunProgram>>handlerName: <'[save]'> evaluate: <aBlockClosure> callParameters: <anOrderedCollection> 
    BasicRunProgram(BasicProgram)>>submitHandlerName: <'[save]'> evaluate: <aBlockClosure> callParameters: <anOrderedCollection> 
    BasicRunProgram(BasicProgram)>>submitHandlerName: <'[save]'> callParameters: <anOrderedCollection> 
    LibButton>>click
    BasicWindow>>click: <aLibButton> 
    LibButton(Button)>>click: <aLibButton> 
    Message>>perform
    Message>>evaluate
    LibButton(Object)>>triggerEvent: <#clicked> 
    LibButton(Button)>>triggerClickedEvent
    LibButton(Button)>>notifyClicked: <788452> 
    LibButton(ControlPane)>>asyncControlEvent: <0> with: <788452> 
    Message>>perform
    NotificationManager>>empty
    NotificationManager>>runPendingEvents
    NotificationManager>>runEventLoop
    Message>>perform
     
  10. Dec 18, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    I tried doing exactly what you mentioned and I didn't get any errors. I even re-downloaded it using the download link I posted and did what you tried doing using the downloaded program (to make sure I didn't accidently post a corrupt or incorrect file) and still no errors. Are you sure you selected the right file when the program first ran? Are you sure you entered the correct entity number into the textbox?
     
  11. Dec 18, 2008
    ZarroTsu
    Been here way too long...
    "What're YOU lookin' at?"
    Join Date: Jan 21, 2007
    Location:
    Posts: 1111
    Age: 28
    I entered a 1. highest I've entered is 68. Both worked; and now it doesn't at all work. I think I deleted the file while it was open, though...
     
  12. Dec 19, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    Well, if you deleted the file while it was open, that's probably why it doesn't work. Does it work if you restart it and select a new file?

    EDIT: Oh, snap! I just realized that was my 100th post! BAM! :D
     
  13. Dec 19, 2008
    ZarroTsu
    Been here way too long...
    "What're YOU lookin' at?"
    Join Date: Jan 21, 2007
    Location:
    Posts: 1111
    Age: 28
    did I not say that 80 bajillion times? ALL the files I've tried are NEW files, because the ORIGINAL file NO LONGER EXISTS.

    The program won't open the file name in general anymore, and I keep getting that error. I've tried replacing EVERYTHING, and I keep getting that error.

    FIXITFIXITFIXITFIXITFIXIT

    FIXITFIXIT
     
  14. Dec 19, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    Wait, so you're actually creating a new, blank file called "npc.tbl" and attempting to open that file using the program? The way I designed the program, it will only edit existing "npc.tbl" files, it won't actually create new ones. Maybe I should change that.
     
  15. Dec 19, 2008
    Celtic Minstrel
    In front of a computer
    "Man, if only I had an apple..."
    Join Date: Mar 1, 2008
    Location: Grasstown
    Posts: 1435
    I thought he meant he was replacing the npc.tbl with an unaltered copy...
     
  16. Dec 19, 2008
    ZarroTsu
    Been here way too long...
    "What're YOU lookin' at?"
    Join Date: Jan 21, 2007
    Location:
    Posts: 1111
    Age: 28

    qwertyuiop
    asdfghjkl
    zxcvbnm
     
  17. Dec 20, 2008
    Lace
    Been here way too long...
    "Life begins and ends with Nu."
    Join Date: Jan 4, 2008
    Location: Lingerie, but also, like, fancy curtains
    Posts: 3053
    would you like some cheese with that spam?
     
  18. Dec 20, 2008
    S. P. Gardebiter
    Just some person
    "Life begins and ends with Nu."
    Join Date: Dec 30, 2005
    Location: Germany
    Posts: 3213
    Age: 26
    Fuck you, seriously.
     
  19. Dec 22, 2008
    Wedge of Cheese
    graters gonna grate
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jul 2, 2008
    Location: &
    Posts: 1886
    Age: 25
    Well, sorry, I don't know what to tell you. I guess you're just cursed :eek:
     
  20. Dec 23, 2008
    TheForgottenOne
    The Suicide Option
    "Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
    Join Date: Jan 1, 2008
    Location: Styx
    Posts: 1973
    Age: 28
    Oh, one more note.

    I opened Windows Task Manager because it was running a little slugish, and I found that I had several instances of this running. Perhaps you missed a line that terminates the program? Iunno.