Author Topic: How do you add Triggers?  (Read 1940 times)

How do you add Triggers to Retail? I can't find the file. I got the mission editor, but there is only 1 trigger.

I know how to add them in RTB, but what do I do in RBL?

-Black Panther


P.S. :cookie:'s for the first person to tell me!

if you would like to
A) make new types of triggers that do different things, press 1
B) spawn triggers ingame, press 2
C) do a mexican hat dance with a handicapped monkey, press 3

1...but I really love 3...I'll go with pressing 1.

*BOOP!* :cookieMonster:

-Black Panther

P.S. I know how to do 2, cause I already learned that from playing RTB.
P.P.S. I really want to know where to put the trigger files. Blockland/Base/data/skies ? I don't know...

Blockland/Add-Ons.

Enable the addon, spawn it with F11, save the mission if you want.

Wait...but isn't there a trigger.cs somewhere?

No, this is retail, it lives in a DSO world. :cookieMonster:

so...

I could copy a trigger from RTB, name it ADD-ONS_TRIGGER1 or something, add to Add-on list, and spawn it?

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: [Select]
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 :))
}
this nifty trigger kills someone if they stay inside for too long. enjoy.


C) do a mexican hat dance with a handicapped monkey, press 3


I lol'd.
If you want map triggers, I think that's possible to make with Torque Construct.

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.

I added RTB triggers to retail, some don't work though :P

BP, face up when creating triggers. They spawn either at what you are focusing on (seems to exclude interiors) or at your eye point. Yours is underground or inside the house - invisible.

No, his trigger spawned at the map centroid, its the game default spawn location.

Under either the camera or the world menu, I can't remember which, is an option could spawn/drop/place at camera, or something like that. Click that option.

Oh. For me, since the start, it always has done the "Camera or facing" spawn method.

The trigger is probably at (0 0 300), where the default spawn location for stuff here is. In the Bedroom that's about terrain level and in Slate up in the air.

To go and find these locations push F8 before entering F11 and move as you would in the camera and use right click to turn.