Author Topic: Triggers  (Read 3641 times)

I'm trying to use a trigger to lift up the player to a bridge, but I'm having difficulty making it work. I'll add it into the mission file, add in the proper triggers.cs to get the datablock to add velocity, but it won't show up as an object in the mission editor. Anyone have any tips?

Are you defining the triggers before you make them in the map?
is this in between the write comments?
Code: [Select]
   new Trigger() {
      position = "";
      rotation = "";
      scale = "";
      dataBlock = "datablock";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
   };
?

Code: [Select]
datablock TriggerData(FanTrigger)
{
    tickPeriodMS = 100;
};
 
function FanTrigger::onTickTrigger( %this, %trigger, %obj )
{
%obj.addvelocity("0 0 5");
}

datablock TriggerData(FanSlowDownTrigger)
{
    tickPeriodMS = 100;
};
 
function FanSlowDownTrigger::onTickTrigger( %this, %trigger, %obj )
{
%obj.addvelocity("0 0 2");
}
This is the triggers.cs


Code: [Select]
};
   new Trigger() {
      position = "209.204 114.093 103.536";
      rotation = "1 0 0 0";
      scale = "1.87923 2.04568 26.1737";
      dataBlock = "FanTrigger";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 -1.0000000 0.0000000 0.0000000 0.0000000 1.0000000";
This is in the mis.
« Last Edit: October 01, 2011, 05:31:17 PM by Nasoa »

Triggers to make a fan, clever.

If you're just trying to make a fan to lift players or something you might want to try using a physical zone instead of a trigger. I'm pretty sure physical zones only effect players and player based vehicles though, I don't think they work on someone driving a jeep for example.

Make sure the part in the .mis file is nested with the mission editor stuff.

I don't think they work on someone driving a jeep for example.
I think they only work on things directly in the root node, which is maybe it doesn't detect players in vehicles. Not just that, but adding velocity to a player in a vehicle does nothing.

How do you even create a trigger?

Also, does anyone know if it's possible to incorporate variables of a mod into a map to affect interior behavior?

How do you even create a trigger?
Add it through Mission Editor.

Ah, I suppose that triggers can perform any operation.

-snip-
Are you executing "trigger.cs" before the rest of the .mis file?