triggers.cs:
datablock TriggerData(CheckpointTrigger)
{
tickPeriodMS = 100;
};
function CheckpointTrigger::onEnterTrigger(%this,%trigger,%obj)
{
//%this.getName
%name = %trigger.getname();
// Bad, should be a commandtoclient
cp.setcurrent(%name);
Parent::onEnterTrigger(%this,%trigger,%obj);
}
function CheckpointTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
Parent::onLeaveTrigger(%this,%trigger,%obj);
}
function CheckpointTrigger::onTickTrigger(%this,%trigger)
{
Parent::onTickTrigger(%this,%trigger);
}
___________________________________
game.cs:
function getCheckPoint()
{
%checkpoint = $checkpointtoload - 1;
%groupName = MissionGroup/CheckPoints;
%group = nameToID(%groupName);
%index = %checkpoint;
%spawn = %group.getObject(%index);
return %spawn.getTransform();
}