Script-Focus
script-focus
is executed when a marker is focused (the player is within the marker's triggerRange
).
Default Parameters
Parameter | Type | Description |
---|---|---|
marker | Marker | A reference to the marker firing the script. |
isFocused | boolean | Indicates if the marker was just focused (true) or unfocused (false). |
Usage
- pack.xml
- script.lua
- Output
pack.xml
<marker ... script-focus="DoSomethingWhenMarkerIsFocused(1)">
<marker ... script-focus="DoSomethingWhenMarkerIsFocused(2)">
script.lua
function DoSomethingWhenMarkerIsFocused(marker, isFocused, markerTriggerID)
if (isFocused) then
Debug:Print("Marker " .. markerTriggerID " was focused")
-- do something else here
end
end
Example Output
-- If the player enters the marker 2's trigger range:
"Marker 2 was focused"