Frictional Games Forum (read-only)

Full Version: How Can I Make a Trigger Activate Another Trigger?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So I'm so very close to being done with a short map I've been working on, but I've run into yet another brief roadblock! Dodgy

I want to be able to have a trigger disabled or inactive so that when the player walks through it, it doesn't activate whatever it is supposed to activate, but when the player gets to an area further in the map, he collides with a trigger that activates those previously inactive triggers, the player then needs to go back and through those now active triggers which then trigger an event... So, basically, I tried using this formula:
Code:
AddEntityCollideCallback("Player", "GruntDoorTrigger1", "CollideGruntDoorTrigger1", true, 0);
and then further down,
Code:
void CollideGruntDoorTrigger1(string &in asParent, string &in asChild, int alState)
{

    SetEntityActive("GruntTrigger1", true);
    
    SetEntityActive("CloseDoorTrigger1", true);
    
}

So I don't know if I'm supposed to make a trigger activate more than one thing at a time, or... Or is it the obvious fact that the triggers needing activation are not entities as those strings assume? If so, what would I put in in place of those strings to make my event work the way it should?

Any of the smart scripters around to assist this poor knowledge-lacking newbie?
(09-18-2010, 02:27 AM)theDARKW0LF Wrote: [ -> ]Any of the smart scripters around to assist this poor knowledge-lacking newbie?

Code:
RemoveEntityCollideCallback("Player", "NameOfAreaToRemoveCallbackFrom");
(09-18-2010, 03:04 AM)MulleDK19 Wrote: [ -> ]
(09-18-2010, 02:27 AM)theDARKW0LF Wrote: [ -> ]Any of the smart scripters around to assist this poor knowledge-lacking newbie?

Code:
RemoveEntityCollideCallback("Player", "NameOfAreaToRemoveCallbackFrom");

Thanks for the reply, but wouldn't that make the trigger area be removed? I want the opposite to occur, I want an already disabled trigger (i unchecked active in the window for the two areas i want disabled at first) to activate when I reach a certain area ahead of it, so when I have to go back through that trigger it will call the event.
i don't know if it can help, but i noticed that for example making a point light inactive in the editor does not deactivate it in game.
(09-18-2010, 03:38 AM)gosseyn Wrote: [ -> ]i don't know if it can help, but i noticed that for example making a point light inactive in the editor does not deactivate it in game.

That's not my problem though, I'm trying to get the trigger area active after it's already been disabled. But thanks for trying to help Big Grin
yeah, the problem is that the functions are not named clearly for the most part, plus there's no documentation on them, apart from some comments here and there.
Still need help... Anyone know how to make one area trigger another to become active if it was disabled previously?
That snippet you posted above should work, assuming the area names are correct. If you are not sure it is working, just print messages saying what is going on with the AddDebugMessage function.
Code:
void CollideGruntDoorTrigger1(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("GruntTrigger1", true);
    AddEntityCollideCallback("Player", "GruntTrigger1", "ReplaceMe", true, 1);
    
    SetEntityActive("CloseDoorTrigger1", true);
    AddEntityCollideCallback("Player", "CloseDoorTrigger1", "ReplaceMe", true, 1);
}
(09-18-2010, 03:34 AM)theDARKW0LF Wrote: [ -> ]
(09-18-2010, 03:04 AM)MulleDK19 Wrote: [ -> ]
(09-18-2010, 02:27 AM)theDARKW0LF Wrote: [ -> ]Any of the smart scripters around to assist this poor knowledge-lacking newbie?

Code:
RemoveEntityCollideCallback("Player", "NameOfAreaToRemoveCallbackFrom");

Thanks for the reply, but wouldn't that make the trigger area be removed? I want the opposite to occur, I want an already disabled trigger (i unchecked active in the window for the two areas i want disabled at first) to activate when I reach a certain area ahead of it, so when I have to go back through that trigger it will call the event.

Then just wait to add the collide callback until the player touches the first area.
Pages: 1 2