Script-Tick
script-tick
is executed once every in-game tick (typically every frame, but potentially less depending on configuration), providing the marker as context.
warning
Because this executes on every game tick, it can impact FPS significantly if you aren't careful with your logic!
Default Parameters:
Parameter | Type | Description |
---|---|---|
marker | Marker | A reference to the marker firing the script. |
gameTime | GameTime | A reference to the current gameTime object. |
Usage
- pack.xml
- script.lua
- Output
pack.xml
<marker ... script-tick="DoSomethingEveryTick(1)">
script.lua
function DoSomethingEveryTick(marker, gameTime, markerTriggerID)
Debug:Print("Marker " .. markerTriggerID " tick triggered")
-- do something else here
end
Example Output
"Marker 1 tick triggered"
"Marker 1 tick triggered"
"Marker 1 tick triggered"
"Marker 1 tick triggered"
"Marker 1 tick triggered"
...