 |
Castle Paradox
|
View previous topic :: View next topic |
Author |
Message |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Wed Nov 17, 2010 6:30 pm Post subject: Possible causes for custom to crash during script import... |
|
|
Since I have reached 31 plotscripts(the ones that you see in custom), custom crashes completely with no errors in the debug file or anything. If I take the script away, it imports fine again, or if I change the plotscript to a simple script, it imports fine again. That to say, this new plotscript is basically a copy of an existing one with minimal modifications, and it compiles with hspeak just fine.
What are all the possible causes for custom to "just crash" during the import of an .HS file? Is the plotscript limit, 30 per game? If this is the cause, then I will definitely need to write a dispatch plotscript and use arguments for maps and NPCs to exceed this limit.
UPDATE: The same plotscript, changed to a regular script and called from a secondary plotscript imported and ran perfectly fine. However, it just won't import if I set it as a callable plotscript from custom?!?! What's up with this...
UPDATE 2: Well, I changed over all my map init plotscripts to regular scripts, and created a dispatcher to attach to maps that use a map init script.
Dispatcher wrote: |
plotscript, map setup, begin
if (current map == map:Waku Forest 1) then (waku forest 1)
if (current map == map:Waku Village) then (waku village)
if (current map == map:Waku Stables) then (waku stables)
end
|
Simple enough, but now it fails to import and crashes just as it tries to import this, only 19 plotscripts import before this one does, then it freezes. The plotscript right before this one imports just fine, but then it crashes trying to import this one.
I am very confused on why it is crashing during import and how to remedy the issue. As before, it compiles just fine, but the import freezes or crashes custom. I have my scripts throughout multiple .HSS files, including each one into the main .HSS, it worked fine before, but now during import, it's a no-go.
UPDATE 3: In attempts to see if a fresh new start would allow me to import the scripts, I backed up my RPG file and compiled a very basic .HSS file and imported it. This HSS has 0 plotscripts in it, I just included the basic .HSD file. It imported just fine, then I went through all the maps and such removing every single trigger, until fix broken triggers returned nothing. Then I saved and exited and re-opened custom with the RPG and attempted to re-import my .HS again with all my scripts... It crashed... So much for that idea, eh? Glad I backed up my RPG before trying this one out.
UPDATE 4: Well, in my next attempt to import my .HS file, I created a brand spank'n new .RPG file and tried importing my .HS file. IT IMPORTED! Although it does not solve my problem, as I need it to import into my existing project... So it would seem that my RPG file is corrupted somewhere along the line, but I see no debugging output in c_debug.txt to prove this. This might mean that I may need to start a new RPG file and export then re-import all my data into it. That would really suck, as this game is suppose to be done for the Heart of OHR contest. Any ideas on what maybe causing the import to fail on this particular RPG file? Is there a way to completely reset the script management page and start fresh with a new import? I see this would solve the issue.
UPDATE 5: A little RPG file surgery... Yikes, it was scary to play with it's internals while it was still awake and alive. I did the file swaps and moves within the working.tmp folder to see if I could manually import the HS file. I first unlumped my .HS file that will not import, and copied out the SCRIPTS.BIN to WORKING.TMP/PLOTSCR.LST. Then I took the full .HS file and replaced the OHRRPGCE.HSP with it. I then saved my RPG file and quit. I re-opened it, and to my utter amazement, it still didn't work, and when checking where my scripts are being used, well now it appears that system scripts are scattered everywhere in the game. Here is an example: "4: walkherotox", this is very odd. How does custom import your HS file, if it doesn't import it like this? I am very confused on why this didn't work.
UPDATE 6: Well, now this is getting frustrating. I took my newly created RPG file which did successfully import the HS file, and copied out the OHRRPGCE.HSP and PLOTSCR.LST. I then re-opened my other RPG file which is having issues importing and copied them into it's WORKING.TMP then saved and quit and opened custom. To my amazement, this also did not work. None of the scripts are even showing up. Now I am very comfused on which files in the LUMP are used for plotscripting and which ones I need to repair in order to resolve this issue. _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Wed Nov 17, 2010 8:28 pm Post subject: |
|
|
Well, it seems like I finally fixed the issue... Boy this was a pain to fix though. For those here who may also have this issue and don't know how to go about fixing it, here is how to COMPLETELY RESET THE SCRIPT MANAGEMENT menu.
USING THIS PROCESS IS OUT OF YOUR OWN RISK, BACKUP 1ST!
First compile a very simple .HS file as so:
blank.hss wrote: |
include, plotscr.hsd
include, scancode.hsi
|
Next take this file and import it into your corrupted RPG file. This insures that the GEN lump has a little records as possible for plotscripts. Read the wiki for more info on this.
After importing it, go through your RPG file and eliminate all script triggers(this can be time consuming) also write down each trigger as you will be re-assigning them after repairing your RPG file.
Now, save your RPG file and back it it, this will be a second backup for before we delete some lumps. Create a first backup as well before even starting this process.
Now go into your WORKING.TMP folder and carefully delete these files:
LOOKUP1.BIN
OHRRPGCE.HSP
PLOTSCR.LST
Save and exit custom, then re-open it to make sure it sees the changes. This step may not be needed.
Then carefully go into the "Script Management" menu, and only select "Import", selecting other options may crash custom. I know one of them at least crashes it, as LOOKUP1.BIN is missing. Import your HS file as usual, and now it will successfully import without a single error being outputed.
Now you may re-assign all your script triggers.
The reason you un-assign your script triggers, is that for some reason, after doing this process, all of your scripts are in different places when selecting them in custom, and keeping your triggers assigned may result in a crash during your import yet again. Although I have not fully tested this.
FEATURE REQUEST: I request a new menu option in Custom under "Script Management" called "Reset plotscript sub-system" or something along those lines. People can then use this option if they have trouble importing their HS file. The menu option would basically copy down their script triggers to a temp file, remove all files related to plotscripts from the RPG lump, reset the GEN record to default, and allow the user to re-import their HS file. After a successful import, the system will then automatically refer to the temp file with the trigger list and re-assign them all for the user.
Although this entire issue I just experienced could be the only one of it's kind, or it could be a bug that can be re-produced under specific requirements. Who knows. _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
Guo Guest
|
Posted: Wed Nov 17, 2010 9:11 pm Post subject: |
|
|
What is lookup1.bin used for? I say this because after saving and exiting custom the other day there was a working.tmp folder containing only lookup1.bin (i just deleted it). Am I likely to experience issues in future because of this? |
|
Back to top |
|
 |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Wed Nov 17, 2010 9:48 pm Post subject: |
|
|
Guo wrote: | What is lookup1.bin used for? I say this because after saving and exiting custom the other day there was a working.tmp folder containing only lookup1.bin (i just deleted it). Am I likely to experience issues in future because of this? |
No, it shouldn't cause any issues, if that was the only file in there. When you save and exit from CUSTOM, it packs the WORKING.TMP folder into your RPG file. You can verify if there are any issues right now but visiting the "Script Management" menu and selecting "Check where scripts are used...".
If you have never created any custom script yet for your game, then deleting LOOKUP1.BIN should not cause any problems whatsoever while editing. Don't quote me on that though, one of the programmers will know for sure. _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Thu Nov 18, 2010 12:24 am Post subject: |
|
|
Okay, the error has definately been reproduced again after I repaired it a few hours ago. But, this time I actually have an error message which can be used to find the source of the problem!
CUSTOM wrote: |
Aborting due to runtime error 12 ("segmentation violation" signal) in subs2.bas::ADDTRIGGER()
|
Furthermore, as I am using Linux at the moment, it outputed tons of debugging info, of which the error stated something about an invalid pointer.
I really hope this error can be fixed up soon, as it is making it very difficult to finish my Heart of OHR game on time...
Perhaps fixing this issue should be on my list if I do win.
UPDATE: Fixed it again, but found a way easier way to do it! Open the corrupted RPG file in custom, navigate to the WORKING.TMP folder, delete both OHRRPGCE.HSP and PLOTSCR.LST, then import your .HS file from the "Script Management" menu, voila! No needing to exit custom either. It even keeps your triggers in tact. Although, Backup your RPG file before doing this, just in case it doesn't work on your particular RPG file or issue. _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 18, 2010 4:43 am Post subject: |
|
|
Umm, yikes. I can't believe you went through all that trouble. Next time you encounter a problem like this, I recommend you send it off to the developers and try to do something else while we fix it; I assure you we will spend far less time fixing the problem than you spent trying to work around it :)
Script importation is quite complicated; it involving copying the .HS file, updating several lumps (lookup1.bin, plotscr.lst, ohrrpgce.gen) and scanning the whole game for triggers that need updating.
Could you please email me a broken copy of your game, or post it somewhere, or create a bugzilla bug and attach it?
Guo wrote: | What is lookup1.bin used for? I say this because after saving and exiting custom the other day there was a working.tmp folder containing only lookup1.bin (i just deleted it). Am I likely to experience issues in future because of this? |
Ah, I'll investigate that. Thanks for the report. No, there's no chance of it damaging your game. It just means that a menu somewhere failed to close the file. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Thu Nov 18, 2010 8:24 am Post subject: |
|
|
The Mad Cacti wrote: | Could you please email me a broken copy of your game, or post it somewhere, or create a bugzilla bug and attach it?
|
How about if I include a broken copy of the game for the Heart of OHR? And if it's a winner, it would be the developers task to find a way to successfully import a .HS file back into it and squish this very annoying bug. It's re-occurring, and is starting to make me want to pull my hair out.
Thinking about it, this would be an awesome Contest for developers such as yourself to put out there... Basically, create a game in which there is a bug in either custom or game that needs to be squished. This will allow game creators to try out new funky ideas to stress both custom and game to their limits to find bugs.
If you import scripts into your game like this: CUSTOM MYGAME.RPG MYGAME.HS
Does it import any different than when using the script management page? I tend to use this method ALOT, I made a shell script which I call from my file manager to preform game/script testing.
testgame.sh wrote: |
#!/bin/sh
FILE=$1
GAME=`basename $FILE .rpg`
cd `dirname $FILE`
wine C:\\hspeak\\hspeak.exe $GAME.hss
custom `pwd`/$GAME.rpg `pwd`/$GAME.hs
rm $GAME.hs
game $GAME.rpg
|
I also have a similar script in case people from the Windows world would also like to use it:
testgame.bat wrote: |
set file=%1
set GAME=%file:~0,-4%
hspeak %GAME%.hss
start /wait custom %GAME%.rpg %GAME%.hs
del %GAME%.hs
game %GAME%.rpg
|
These scripts come in handy a lot when developing a game which uses a lot of scripts to drive gameplay, or even when editing cutscenes for example.
In both Linux and Windows you can associate the script with the RPG file in the right-click menu. IE, if you double click it, it just runs the game, but a right-click will pop-up a list of options: "Play Game", "Edit Game", and "Test Game". Edit Game will launch the RPG file with custom, Test Game will launch it with one of the above scripts(depending on OS). _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Nov 18, 2010 1:36 pm Post subject: |
|
|
This definitely sounds like an engine bug.
If you can send a copy of your script and rpg file to either me or TMC, or post it on bugzilla, I am sure we can figure it out. |
|
Back to top |
|
 |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Thu Nov 18, 2010 1:56 pm Post subject: |
|
|
It seems to be finally working fine today after my latest workaround/fix I preformed last night. If it starts to happen again, I'll definitely send a copy to TMC and James to investigate. _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Thu Nov 18, 2010 2:38 pm Post subject: |
|
|
Did you save an older copy of it from before you worked around the bug? |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Nov 18, 2010 6:59 pm Post subject: |
|
|
I thought you said you created backups!
chronoboy wrote: | How about if I include a broken copy of the game for the Heart of OHR? |
That contest is making everyone think that having bugs fixed is a privilege they can expect to wait months for. While I admit it can take us years to fix minor bugs (or add features), we want to fix serious stuff like this as soon as possible.
Quote: | This will allow game creators to try out new funky ideas to stress both custom and game to their limits to find bugs. |
Actually, that would be exceeding easy. We do far too little error checking; there are probably ways to cause almost every menu in Custom to crash using corrupt data.
Quote: | If you import scripts into your game like this: CUSTOM MYGAME.RPG MYGAME.HS
Does it import any different than when using the script management page? |
No, it's equivalent.
I use scripts just like yours. Context menu items to edit/play/import&play is a nifty idea though. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
chronoboy Into the past with a splash

Joined: 04 Jun 2010 Posts: 162 Location: Canada
|
Posted: Thu Nov 18, 2010 11:42 pm Post subject: |
|
|
The Mad Cacti wrote: | I thought you said you created backups! |
Don't quote me on that one, but I'm sure I have it lying around somewhere. After I release my Heart of OHR game, I will send the file your way. I'm really trying to keep this game's story under wraps(you guys understand right?)
The Mad Cacti wrote: | I use scripts just like yours. Context menu items to edit/play/import&play is a nifty idea though. |
I'm actually surprised not everybody is using such a feature, perhaps the next stable installer EXE release and have an option to add such context menus for the user. It makes editing and testing a breeze, I also have a context menu for .HSS files to compile only, so if I already have custom loaded, and all I need to do is compile, it's one right-click away.
Context menus work on both Windows and Linux platforms, I was able to successfully configure it in Windows Explorer and in KDE 4.4.5, with little difficulty. I am not too sure how to add context menus in Mac OS X yet. Guess it would help if I actually had a Mac to play on. _________________ Current project: Chronoboy Adventures
Website: http://www.chronoboy.com/ |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|