I've made a modified checkpoint.lua script that'll work on a radius around an entity instead of a zone since the zones are acting
so weird ,moving around or disappearing.
Just place it on a small entity like the key, since it'll be destroyed when the script runs.
Just copy the code and name the file setcheckpoint.lua .
Make sure you put the checkpoint sound in sound0 ... or whatever sound you want to signal to the player that the checkpoint has been reached.
Auger
-- LUA Script - precede every function and global member with lowercase name of script + '_main'
-- make a Checkpoint when Player nears this entity
-- Just place the script on the entities AI System > Main property
-- Remember you'll also need to set the sound > sound0 to the checkpoint sound found @
-- \audiobank\misc\checkpoint.wav
-- also place this on a small entity(ie key) since It'll dissappear when Destroy() is called
--Modified checkpoint.lua by Auger
--Use for anything you'd like. Modify as you like. No credit needed.
function setcheckpoint_init(e)
end
function setcheckpoint_main(e)
PlayerDX = g_Entity[e]['x'] - g_PlayerPosX;
PlayerDY = g_Entity[e]['y'] - g_PlayerPosY;
PlayerDZ = g_Entity[e]['z'] - g_PlayerPosZ;
PlayerDist = math.sqrt(math.abs(PlayerDX*PlayerDX)+math.abs(PlayerDY*PlayerDY)+math.abs(PlayerDZ*PlayerDZ));
-- set (800) as the radius of the checkpoint check .. make this higher/lower if you wish to have a larger/smaller checkpoint area
if PlayerDist < 800 then
PlaySound(e,0);
-- set the checkpoint then destroy the entity
Checkpoint(e);
Destroy(e);
end
end