Frictional Games Forum (read-only)
Multiple triggers - 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 - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Multiple triggers (/thread-16317.html)

Pages: 1 2


RE: Multiple triggers - Your Computer - 06-19-2012

(06-19-2012, 10:56 PM)theshanus Wrote: Can't tell what's wrong Confused

StartPlayerLookAt in OnPickup is missing a semicolon at the end of it.


RE: Multiple triggers - The Shanus - 06-19-2012

(06-19-2012, 11:17 PM)Your Computer Wrote:
(06-19-2012, 10:56 PM)theshanus Wrote: Can't tell what's wrong Confused

StartPlayerLookAt in OnPickup is missing a semicolon at the end of it.
Fixed that now, but same errors :/
PHP Code:
void OnStart()
{
}

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

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

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
SetSwingDoorLocked(asEntityfalsetrue);
PlaySoundAtEntity(""asEntity"room101"0false);
PlaySoundAtEntity(""asEntity"room100"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();
}


EDIT: CURRENT ERRORS: "main (24,1) : INFO : Compiling void OnScript (string&in string&in)
main (26,5) : ERR: Expected expressions value
main (34,5) : ERR: Expected expressions value"

Off to sleep now, hopefully someone will have it figured out by morning. Thanks in advance!


RE: Multiple triggers - Your Computer - 06-20-2012

(06-19-2012, 11:22 PM)theshanus Wrote: Fixed that now, but same errors :/

Did you forget to save, then? It shouldn't have printed the same exact error if that issue was fixed; it would be a completely separate error if there is a problem.


RE: Multiple triggers - The Shanus - 06-20-2012

(06-20-2012, 12:00 AM)Your Computer Wrote:
(06-19-2012, 11:22 PM)theshanus Wrote: Fixed that now, but same errors :/

Did you forget to save, then? It shouldn't have printed the same exact error if that issue was fixed; it would be a completely separate error if there is a problem.
Have a look at that edit, please. A couple of new errors to replace that one, but no clue how to fix them either. Apparently, playing it out of dev mode, there are no errors. I'll check again with dev mode on in the morning. However, the player does not turn once the monster spawns...

EDIT: Playing out of dev mode, everything works but the player turning to look at the monsters.


RE: Multiple triggers - drunkmonk - 06-20-2012

(06-19-2012, 10:56 PM)theshanus Wrote:
(06-19-2012, 09:41 PM)FastHunteR Wrote: http://www.frictionalgames.com/forum/thread-10798.html
Number 18, wake up script
Okay so these are the errors I'm now getting:
"main (26,1) : INFO : Compiling void OnPickup (string&in string&in)
main (34,3) : ERR : Expected ';' "
And my script as of now:
PHP Code:
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();
}
    if(
asEntity == "NOTETWO")
{
  
SetSwingDoorLocked("room102",false,false);
  
SetEntityActive("brute1",true);
  
StartPlayerLookAt("brute1",2,2,"");
  
StopPlayerLookAt();
}


Can't tell what's wrong Confused
you are just missing a ";" beside your StartPlayerLookAt("poofer1",2,2,"")


RE: Multiple triggers - Your Computer - 06-20-2012

(06-20-2012, 12:18 AM)theshanus Wrote: EDIT: Playing out of dev mode, everything works but the player turning to look at the monsters.

That's because you told the game to stop forcing the player to look towards the monster immediately after telling the game to force the player to look at the monster.


RE: Multiple triggers - The Shanus - 06-20-2012

(06-20-2012, 01:35 AM)Your Computer Wrote:
(06-20-2012, 12:18 AM)theshanus Wrote: EDIT: Playing out of dev mode, everything works but the player turning to look at the monsters.

That's because you told the game to stop forcing the player to look towards the monster immediately after telling the game to force the player to look at the monster.
Ah, I was unsure about the StopPlayerLookAt, as it had no arguments. Using AddTimer worked like a charm, many thanks.