Author Topic: Checkpoint Triggers  (Read 755 times)

Code: [Select]
//====================
// SwollowCheckPoint
//====================

datablock TriggerData(SwollowCheckPointTrigger)
{
   tickPeriodMS = 50;
};

function SwollowCheckPointTrigger::onEnterTrigger(%this,%trigger,%obj)
{
   Parent::onEnterTrigger(%this,%trigger,%obj); 
}

function SwollowCheckPointTrigger::onLeaveTrigger(%this,%trigger,%obj)
{
   Parent::onLeaveTrigger(%this,%trigger,%obj);
}

function SwollowCheckPointTrigger::onTickTrigger(%this,%trigger, %obj)

   if(!(%obj.getType() & $TypeMasks::PlayerObjectType))
     {
      return;
     }
   %client = %obj.client;
   if(!isObject(%client))
    {
      return;
    }

 
   centerPrint(%obj.client,"CheckPoint Reached!",2);
   %client.SwollowcheckPoint = %this;
   %client.SwollowcheckPointPos = %this.getPosition();
   Parent::onTickTrigger(%this,%trigger);
}

package SwollowCheckpointPackage
{
   function GameConnection::getSpawnPoint(%client)
   {
      if(isObject(%client.SwollowcheckPoint))
         return (%client.SwollowcheckPoint.getSpawnPoint());
         
      return Parent::getSpawnPoint(%client);   
   }
};
activatePackage(SwollowCheckpointPackage);
I'm trying to make a checkpoint with triggers but so far the getSpawnPoint isn't working

Change
Code: [Select]
return (%client.SwollowcheckPoint.getSpawnPoint());to
Code: [Select]
return (%client.SwollowcheckPoint.getTransform());

Change
Code: [Select]
return (%client.SwollowcheckPoint.getSpawnPoint());to
Code: [Select]
return (%client.SwollowcheckPoint.getTransform());
thanks amade :D