Frictional Games Forum (read-only)
How Can I Make a Trigger Activate Another Trigger? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: How Can I Make a Trigger Activate Another Trigger? (/thread-4499.html)

Pages: 1 2


How Can I Make a Trigger Activate Another Trigger? - theDARKW0LF - 09-18-2010

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?


RE: How Can I Make a Trigger Activate Another Trigger? - MulleDK19 - 09-18-2010

(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");



RE: How Can I Make a Trigger Activate Another Trigger? - theDARKW0LF - 09-18-2010

(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.


RE: How Can I Make a Trigger Activate Another Trigger? - gosseyn - 09-18-2010

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.


RE: How Can I Make a Trigger Activate Another Trigger? - theDARKW0LF - 09-18-2010

(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


RE: How Can I Make a Trigger Activate Another Trigger? - gosseyn - 09-18-2010

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.


RE: How Can I Make a Trigger Activate Another Trigger? - theDARKW0LF - 09-18-2010

Still need help... Anyone know how to make one area trigger another to become active if it was disabled previously?


RE: How Can I Make a Trigger Activate Another Trigger? - Luis - 09-18-2010

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.


RE: How Can I Make a Trigger Activate Another Trigger? - Deruu - 09-18-2010

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);
}



RE: How Can I Make a Trigger Activate Another Trigger? - MulleDK19 - 09-18-2010

(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.