github ZQuestClassic/ZQuestClassic 2.55-alpha-29-prelim1
2.55 Major Global Script Refactor

pre-release4 years ago

global scripts 'onLaunch', 'onContGame', 'onF6Menu' added
renamed 'onContinue' to 'onSaveLoad', for clarity
modified hero script 'onDeath' to match global script 'onF6Menu' in functionality
modified hero script 'Init' to run more often.
Fixed various bugs
Added 'Game->SaveAndQuit()' and 'Game->SaveAndContinue()'

Global scripts now each have their own Stack, Refinfo, and bit of g_doscript, represented by their slot ID (or 1<<slotID for g_doscript). This means that multiple global scripts can be executed in parallel.

Global Script onF6Menu will run on F6 press, or Game>>>End Game. It will freeze all action, as Hero onDeath does, and run the script until it exits. This freezes, but does NOT CLEAR/EXIT, the global active script. Exiting this script without exiting the game will go to the normal F6 action; either popping up "would you like to exit", or, if qr_NOCONTINUE is active, not doing so. If this is bypassed without selecting to exit, gameplay will resume exactly where it left off, all scripts included; exiting, will of course exit.
Enabling the compatibility rule (automatically enabled for old quests) qr_OLD_F6 will revert all changes in F6 functionality, both skipping the F6 script, as well as running with slightly more instantaneous timing (instead of waiting for the end of the current frame, as it does now).

Hero Script onDeath was also modified heavily, both to fix bugs, remove redundant calls, and be consistent with the behavior of the onF6Menu slot, so that menus can be shared between them without issues. Timing has also been altered; the default timing is the same, however by a new QR, the script can be set to run AFTER the engine death animation.

Hero script Init now runs whenever 'Link.init()' is called, save for if global script Init has never been run before; in which case it will be run immediately following the global Init script. This, majorly, means it will run on continue; any time the Hero is initialized, as the name would imply.

ZScript_Additions.txt has been updated to reflect ALL of this.

Don't miss a new ZQuestClassic release

NewReleases is sending notifications on new releases.