Blockland Forums > Modification Help
How do you add Triggers?
<< < (2/3) > >>
Aloshi:
No, this is retail, it lives in a DSO world. :cookieMonster:
Black Panther:
so...

I could copy a trigger from RTB, name it ADD-ONS_TRIGGER1 or something, add to Add-on list, and spawn it?
rkynick:
perhaps im not sure, since the changes of coding between retail and original.
anyways if you put a cs file in add-ons with the trigger you can enable it.
here is an example trigger:

--- Code: ---datablock TriggerData(helloworld){
   tickPeriodMS = 100;//tick period. best to leave it alone.
};

function helloworld::onEnterTrigger(%this, %trigger, %obj){
   if(!%obj.client.inhello){// if the enteree isnt already inside
      %obj.client.inhello = 1;//set it so they are inside
      %obj.client.helloschedule = Schedule(8000, 0, "hellointoo", %obj);
      messageClient(%obj.client, "", "You have entered the trigger.");
   }
}

function helloworld::OnLeaveTrigger(%this, %trigger, %obj){
   if(%obj.client.inhello){//make sure they're actually inside
      %obj.client.inhello = 0;//hes no longer inside
      messageClient(%obj.client, "", "You have left the trigger.");
      cancel(%client.helloschedule);//end the hellointoo process
   }
}
function hellointoo(%obj)
{
 messageClient(%obj.client, "", "HOW DARE YOU STAY IN TOO LONG!!!");
 %obj.kill();//kill them >:D
 %obj.client.inhello = 0;// no longer inside(they dead :))
}
--- End code ---
this nifty trigger kills someone if they stay inside for too long. enjoy.
Spartan300:

--- Quote from: rkynick on July 17, 2007, 07:23:31 PM ---
C) do a mexican hat dance with a handicapped monkey, press 3


--- End quote ---

I lol'd.
If you want map triggers, I think that's possible to make with Torque Construct.
Black Panther:
rkynick, I tried your trigger, but when I spawned it with  F11, I couldn't see it. It looked like a little...heres a picture that is easier.

I spawned a Goal Trigger in the tutorial, and that worked. I could see the purple box. I cannot see it here.

Please reply.
Navigation
Message Index
Next page
Previous page

Go to full version