http://rapidshare.com/files/121791951/BugTest3.qst.html
To reproduce the bug, simply try the following:
Load the quest in the player to see the script in action. It draws 8 tiles using a global array for the tile index, a global array for the tile CSet, and a global array for the tile transparency. You can move the sword 'cursor' around. Change the tile index for each tile by moving the 'cursor' over the arrows and pressing 'A'. Press 'A' over CSET to change the tile csets and press 'A" over TRAN to toggle the tile transparency.
Everything should work fine, even if you completely quit out of the player.
But if you save and quit...
After reloading the quest in the player after saving it, the global arrays seem to be messed up. From what I've seen (and you should see), index 0 of the first global array (the tile index array) works fine. All the other arrays share the same memory or something similar (the other 7 tiles are always the same, the CSet and transparencies are all the same for each).
For refrence, this is the 813 build on Windows.
Hey, um, could you re-post the test quest, please?
Is this bug still happening?
Re-posting the quest:
http://rapidshare.com/files/156958821/BugTest3.qst.html
Bug still happens in build 884, both in XP and Vista.
I've tried working on this, but it deals with the scripting language, so JMan or DD would be better suited to this task.
I've just had this problem too.
Confirmed for 885.
Would it help you to be able to fix it if I post a bit more information/a test quest?
Well, the test quest that's already posted shows the bug quite clearly. Once we can run that quest without the bug, it should fix it in yours, too.
I know why the bug happens. Hopefully I can fix this bug without breaking previous quests.
It comes because of a faulty assumption I made. The memory for global arrays is initialized inside the global Init script (the auto-generated one). The problem is that, unlike what I believed was the case, the Init script is designed to only be run when a quest is actually started. When the playthrough is saved, any subsequent playthroughs are NOT saved, which means that the array pointers used by the script are pointing to unallocated data. The solution I'm thinking of is to just add a seperate command to allocate global scripts and have it run during the acting script itself, but of course then I have to keep track of which global variables are actually available.
Has this bug been addressed yet? I looked through the Quarantined and Exterminated bug lists and didn't find it, but I could have overlooked the bug somehow (if so sorry). My quest uses arrays so saving will not work correctly until this is fixed, unfortunately. However it'll be awhile before my quest is done so there's no big hurry for me, I was just wondering what the state is and if there is any ETA.
Thanks for reading.
It's been looked at but not solved. It's a particularly tricky but that will take a lot of recoding to fix.
Dark Nation wrote:It's been looked at but not solved. It's a particularly tricky but that will take a lot of recoding to fix.
Fair enough, it sounds like fixing this could potentially cause other issues - and at the very minimum require a lot of work and testing. Thanks for being upfront about it, I think I'll move away from using arrays for now - except in cases where the data is filled in at run time (until its fixed).
Finally fixed this bug, and managed to make a minor new feature in the process (I'll explain it later)
Awesome! Once my quest demo is out I can switch some things back to arrays and make some of the script code a lot nicer in my quest. Thanks for the fix. 😃