Skip to content

Lua level end extensions

Documentation:

Updated -

IntermissionThinker

Hook format: addHook("IntermissionThinker", functionname)

Function format: function(*boolean* stagefailed, *int* intertic, *int* tallydonetic, *int* endtic)

Function return value: Boolean (true = ends intermission, false = pauses intermission, nil/none = use default behavior)

Executes every tic during any end-map intermission screen ('Character got through the act' screen). intertic, tallydonetic, endtic are all intermission tickers used by vanilla, when inactive all tickers default to -1. stagefailed if the stage is failed, returns true. intertic is the current intermission tic. tallydonetic is the tic timestamp when the visual intermission calculation finishes or player skipped the calculation. endtic is predetermined tic timestamp after tallydonetic is registered and when intertic reaches endtic, intermission ends. If the function returns true it directly ends the intermission sequence. Returning false pauses intertic from progressing. Otherwise (return, return nil, or no return value) results in default behaviour.

Hook name Function format Description
"intermission" function(drawer v, boolean stagefailed, int ticker, int calculatedtime, int endtime) The function is run when intermissions between maps are displayed.

Notes:
- stagefailed if the stage is failed, returns true.
- ticker is the amount of time, in tics, that the intermission has been displayed
- calculatedtime is the value of ticker at which vanilla visual tally finished.
- endtime is the value of ticker at which the intermission will end and stop displaying.

New -

MapFinish

Hook format: addHook("MapFinish", functionname)

Function format: function(*int* skipstats, *int* currentmap, *int* nextmap)

Function return value: Boolean (true = interrupts stops map end sequence from activating, false = denying score awards from intermission, nil/none = use default behaviour)

Executes before the map ends. Useful for setup still within the map before intermission starts and game state changes. currentmap is the identification of the current map. nextmap is the identification of the next map. skipstats is a variable whether or not intermission gets skipped by the custom exit. If the function returns true then the sequence that would normally follow map exit would be ceased. Returning false merely denies any awards gained by the following map end intermission. Otherwise (return, return nil, or no return value) results in default behaviour.

Testing script (jump - skip, spin - pause) for intermission, GFZ1 won't reward you no matter what you do and you won't be able to finish GFZ2: intermission_test2.lua

Excuse the old commits that were already merged in previous MRs. I really need to start fresh my base fork.

Edited by Skydusk

Merge request reports