Script-Once
script-once
is executed once when the pack loads the marker, providing the marker as context.
Default Parameters
Parameter | Type | Description |
---|---|---|
marker | Marker | A reference to the marker firing the script. |
Usage
- pack.xml
- script.lua
- Output
pack.xml
<marker ... script-once="DoSomethingWhenMarkerIsLoaded(1)">
<marker ... script-once="DoSomethingWhenMarkerIsLoaded(2)">
script.lua
function DoSomethingWhenMarkerIsLoaded(marker, markerTriggerID)
Debug:Print("Marker " .. markerTriggerID " was loaded")
-- do something else here
end
Example Output
-- Once marker 2 is loaded:
"Marker 2 was loaded"