Game Development Community

Trigger help

by Ashley Etherington · in Technical Issues · 08/24/2006 (6:13 pm) · 1 replies

Atm im quite a noob with triggers so ill try to exsplain in the best posible way

ive got a new part in server/player.cs

datablock PlayerData(DuleInfo)
{

InDuel = 0;
Phase = 0;
Lifepoints = 0;
IsPremium = 0;
Unlocked = 0;
Rank = 0;
}

and im trying to make a triger that when u enter it InDuel becomes 1 not 0 and when u exit it becomes 0 again
but im not sure how to go about this

thanks in advance

#1
09/15/2006 (4:00 pm)
Unless those new properties are harded they do not need to reside in the datablock instead when you create an instance of the object set they object properties then.
%player =  new Player(){}
%player.InDuel = 0;
later the trigger code would be
function SomeNewTrigger::onEnterTrigger(%this, %obj ){
    %obj.Induel = 1;
}
function SomeNewTrigger::onExitTrigger(%this, %obj ){
    %obj.Induel = o;
}