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
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#11
RE: Multiple triggers

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

Tutorials: From Noob to Pro
06-19-2012, 11:17 PM
Website Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#12
RE: Multiple triggers

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

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!

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-20-2012, 12:03 AM by The Shanus.)
06-19-2012, 11:22 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#13
RE: Multiple triggers

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

Tutorials: From Noob to Pro
(This post was last modified: 06-20-2012, 12:02 AM by Your Computer.)
06-20-2012, 12:00 AM
Website Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#14
RE: Multiple triggers

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

[Image: theshanusyoutube.jpg]
(This post was last modified: 06-20-2012, 12:22 AM by The Shanus.)
06-20-2012, 12:18 AM
Find
drunkmonk Offline
Member

Posts: 109
Threads: 7
Joined: Jun 2012
Reputation: 4
#15
RE: Multiple triggers

(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: (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();
}
    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,"")
06-20-2012, 01:21 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#16
RE: Multiple triggers

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

Tutorials: From Noob to Pro
06-20-2012, 01:35 AM
Website Find
The Shanus Offline
Member

Posts: 134
Threads: 15
Joined: Jun 2012
Reputation: 3
#17
RE: Multiple triggers

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

[Image: theshanusyoutube.jpg]
06-20-2012, 09:35 AM
Find




Users browsing this thread: 2 Guest(s)