Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
This event gets triggered on every frame that the game runs, thus is framerate dependent. The callback function gets the deltaTime
passed along with it, which measures the frametime in ms, useful for making e.g. timers.
In here you can put any code that you want to run every frame, although it is best practice to only run your code when needed, e.g. using Observers.
Use this event with caution, as it is triggered continuously once the game is launched.
On onInit gets triggered once, when CET loads in all the mods. This event ensures that CET has fully loaded, and you have access to the Scripting API. There can be only one onInit event per mod.
Use it to register any Observers, as well as do any one-off actions needed for your mod.
This event is a safe starting point for your code interaction with the game, as it guarantees the access to most of the Scripting API.
This event is also triggered when using "Reload all mods" button in the CET Overlay, as it fires when CET load all mods.
Cyber Engine Tweaks has builtin events which can be listened using the registerForEvent()
function. These listeners must be registered inside the init.lua
file.
Keep in mind that CET events are not game events. For example, onInit doesn't mean the game the initializing, but rather that CET loaded mods and the game's Scripting API.
If you need to listen for game events, take a look at the Observers functions.
Here is a video showing when events are triggered in real-time:
This event works similarly to , except that it is used for drawing custom ImGui UI. It gets triggered on every frame that the game runs, thus is framerate dependent.
This example use . Check the for further information on its usage.
This event get triggered when the gets shown.
Use this to keep track of the overlays state, and e.g. to only draw your own UI when CETs overlay is visible. Use it in conjunction with to get a proper on/off switch case.
This example use the event, which is triggered continuously. Make sure to before any modification.
This event gets triggered even before onInit, and can be useful for making changes to the TweakDB, as some values can only be changes very early during the loading process.
Opposing to onInit, this event gets triggered whenever CET unloads all the mods, either due to the game shutting down, or when pressing the "Reload all mods" button in the CET Overlay.
Use this to do any clean-up work for your mod, e.g. despawning objects or removing status effects.
This event get triggered when the CET Overlay gets hidden.
Use this to keep track of the overlays state, and e.g. to only draw your own UI when CETs overlay is visible. Use it in conjunction with onOverlayOpen to get a proper on/off switch case.
This example use the onDraw event, which is triggered continuously. Make sure to check the documentation before any modification.