The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Multiple triggers
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#1
Question  Multiple triggers

So, straight to the point. I would like to go about setting up a trigger - this would be once "NOTETWO" is picked up, it causes a door ("room102") to be unlocked, a monster ("brute1") to spawn in "brute1area", and the player to turn to look at it. I have one trigger already setup, but I'm not sure about how to setup a second one. Any help would be greatly appreciated.

Here is my current script:
PHP Code: (Select All)
void OnStart()
{
}

////////////////////////////
// Run when entering map

void OnEnter()
{
AddUseItemCallback("""room101key""room101""UsedKeyOnDoor"true);
AddUseItemCallback("""room100key""room100""UsedKeyOnDoor"true);
SetEntityCallbackFunc("room100key""OnPickup");
SetEntityCallbackFunc("NOTETWO""OnPickup");
AddUseItemCallback("""hatch101key""hatch101""UsedKeyOnDoor"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity(""asEntity"room101"0false);
PlaySoundAtEntity(""asEntity"room100"0false);
PlaySoundAtEntity(""asEntity"hatch101"0false);
RemoveItem(asItem);
}

void OnPickup(string &in asEntitystring &in type)
{
    if(
asEntity == "room100key")
{
  
SetEntityActive("poofer1"true);
  
ShowEnemyPlayerPosition("poofer1");
  
PlaySoundAtEntity("""04_break.snt""poofer1"0false);
  
StartPlayerLookAt("poofer1",2,2,"");
  
StopPlayerLookAt();
}
    else if(
asEntity == "NOTETWO")
{
  
SetSwingDoorLocked("room102",false,false);
  
SetEntityActive("brute1",true);  
  
ShowEnemyPlayerPosition("brute1");
  
StartPlayerLookAt("brute1",2,2,"");
  
StopPlayerLookAt();
}


Thanks

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-20-2012, 09:35 AM by The Shanus.)
06-19-2012, 08:02 PM
Find


Messages In This Thread
Multiple triggers - by The Shanus - 06-19-2012, 08:02 PM
RE: Multiple triggers - by Cruzore - 06-19-2012, 08:56 PM
RE: Multiple triggers - by The Shanus - 06-19-2012, 08:59 PM
RE: Multiple triggers - by Cruzore - 06-19-2012, 09:01 PM
RE: Multiple triggers - by The Shanus - 06-19-2012, 09:05 PM
RE: Multiple triggers - by Cruzore - 06-19-2012, 09:13 PM
RE: Multiple triggers - by The Shanus - 06-19-2012, 09:38 PM
RE: Multiple triggers - by Cruzore - 06-19-2012, 09:41 PM
RE: Multiple triggers - by The Shanus - 06-19-2012, 09:44 PM
RE: Multiple triggers - by The Shanus - 06-19-2012, 10:56 PM
RE: Multiple triggers - by Your Computer - 06-19-2012, 11:17 PM
RE: Multiple triggers - by The Shanus - 06-19-2012, 11:22 PM
RE: Multiple triggers - by Your Computer - 06-20-2012, 12:00 AM
RE: Multiple triggers - by The Shanus - 06-20-2012, 12:18 AM
RE: Multiple triggers - by Your Computer - 06-20-2012, 01:35 AM
RE: Multiple triggers - by The Shanus - 06-20-2012, 09:35 AM
RE: Multiple triggers - by drunkmonk - 06-20-2012, 01:21 AM



Users browsing this thread: 4 Guest(s)