Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Can I Make a Trigger Activate Another Trigger?
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#1
How Can I Make a Trigger Activate Another Trigger?

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:
AddEntityCollideCallback("Player", "GruntDoorTrigger1", "CollideGruntDoorTrigger1", true, 0);
and then further down,
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?

Check out my custom stories(1)(2)!
(This post was last modified: 09-30-2010, 11:24 PM by Ilkka X.)
09-18-2010, 12:34 AM
Find Reply
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#2
RE: How Can I Make a Trigger Activate Another Trigger?

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

RemoveEntityCollideCallback("Player", "NameOfAreaToRemoveCallbackFrom");

[Image: 16455.png]
09-18-2010, 03:04 AM
Find Reply
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#3
RE: How Can I Make a Trigger Activate Another Trigger?

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

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.

Check out my custom stories(1)(2)!
09-18-2010, 03:34 AM
Find Reply
gosseyn Offline
Member

Posts: 63
Threads: 7
Joined: Sep 2010
Reputation: 1
#4
RE: How Can I Make a Trigger Activate Another Trigger?

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
Find Reply
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#5
RE: How Can I Make a Trigger Activate Another Trigger?

(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

Check out my custom stories(1)(2)!
09-18-2010, 03:46 AM
Find Reply
gosseyn Offline
Member

Posts: 63
Threads: 7
Joined: Sep 2010
Reputation: 1
#6
RE: How Can I Make a Trigger Activate Another Trigger?

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.
09-18-2010, 03:52 AM
Find Reply
theDARKW0LF Offline
Member

Posts: 150
Threads: 17
Joined: Sep 2010
Reputation: 0
#7
RE: How Can I Make a Trigger Activate Another Trigger?

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

Check out my custom stories(1)(2)!
09-18-2010, 04:45 AM
Find Reply
Luis Offline
Frictional Games

Posts: 278
Threads: 19
Joined: Jun 2006
Reputation: 9
#8
RE: How Can I Make a Trigger Activate Another Trigger?

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.

EOF
09-18-2010, 09:37 AM
Find Reply
Deruu Offline
Junior Member

Posts: 6
Threads: 0
Joined: Sep 2010
Reputation: 0
#9
RE: How Can I Make a Trigger Activate Another Trigger?

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, 10:20 AM
Website Find Reply
MulleDK19 Offline
Senior Member

Posts: 545
Threads: 21
Joined: Jun 2009
Reputation: 10
#10
RE: How Can I Make a Trigger Activate Another Trigger?

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

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.

[Image: 16455.png]
09-18-2010, 11:37 AM
Find Reply




Users browsing this thread: 1 Guest(s)