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
ERR : Unexpected token '{'
Wickedwrath Offline
Junior Member

Posts: 13
Threads: 3
Joined: Oct 2011
Reputation: 0
#1
Question  ERR : Unexpected token '{'

Hello! I finally got my keys and "scary event" to work in my script, but when I added Elven's awesome piano scare-script I'm getting a error "ERR : Unexpected token '{'". Can someone explain what this error means? What I coul'd think of is that I have placed one of those '{ }' wrong, or?
- This is my whole script. Help me solve this, please?

PHP Code: (Select All)
////////////////////////////////////////////////////////////////////////////////////
// Run first time starting map
void OnStart()

///////////////////////////////////////////////////////////////////////////////////
// HUNTED PIANO STARTS PLAYING!

{
AddTimer("pianotimer"0"pianotimer");
AddEntityCollideCallback("Player""pianostop""pianostop"true1);
}

void PianoTimer(string &in asTimer)
{
PlaySoundAtEntity("piano""general_piano03.ogg""Piano"0false);
AddTimer("pianotimer"18"pianotimer");
}

void pianostop(string &in asEntityint alState
{
StopSound("piano"0);
RemoveTimer("pianotimer");
SetLeverStuckState("piano"0true);
AddPropImpulse("piano"00100"world");
PlaySoundAtEntity("piano""impact_wood_heavy_med3""Piano"0false);
CreateParticleSystemAtEntity("""ptest_dust_falling.ps""impact"false);
}

///////////////////////////////////////////////////////////////////////////////////
// ALL THE KEYS!
{
  
AddUseItemCallback("""Key_1""Door_1""UsedKeyOnDoor"true);
  
AddUseItemCallback("""Key_2""Door_2""UsedKeyOnDoor_2"true);
  
AddUseItemCallback("""Secretkey2""metal_1""UsedKeyOnDoor_3"true);
}

void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
  
SetSwingDoorLocked("Door_1"falsetrue);
  
PlaySoundAtEntity("""unlock_door""Door_1"0false);
  
RemoveItem("Key_1");
}

void UsedKeyOnDoor_2(string &in asItemstring &in asEntity)
{
  
SetSwingDoorLocked("Door_2"falsetrue);
  
PlaySoundAtEntity("""unlock_door""Door_2"0,false);
  
RemoveItem("Key_2");


void Message_1(string &in asEntity)
{
  
SetMessage("Message""Message_1"2);
}

void UsedKeyOnDoor_3(string &in asItemstring &in asEntity)
{
  
SetSwingDoorLocked("metal_1"falsetrue);
  
PlaySoundAtEntity("""unlock_door""metal_1"0false);
  
RemoveItem("Secretkey2");
}
 
///////////////////////////////////////////////////////////////////////////////////
// SCARY DOOR/CHAIR EVENT IN CORRIDOOR!
void OnEnter()

{
StopSound("Sound_1"0);
//COLLIDES
AddEntityCollideCallback("Player""Event_Start_Collide_Area""StartEvent"true1);
}

void StartEvent(string &in asParentstring &in asChildint alState)
{
CreateParticleSystemAtEntityExt("awedsasf""ps_dust_push_15.ps""Particle_Spawn"false1.0f0.1f0.1f1false1111);
    
AddTimer("asdtgeqtfgd"1.0f"LoopyTimerCounting");
}

void LoopyTimerCounting(string &in asTimer)
{
AddLocalVarInt("Stage"1);
float fEventSpeed 0.0f;
    switch(
GetLocalVarInt("Stage")) 
    {    case 
1:
            
SetSwingDoorClosed("WindDoor"truetrue);
            
SetSwingDoorDisableAutoClose("WindDoor"false);
            
AddPropForce("WindDoor"00290.0f"world");
            
SetSwingDoorLocked("WindDoor"truetrue);
        
            
FadeInSound("Sound_1"1.0ftrue);
            
FadeLightTo("PointLight_1"0.8f10000.3);
            break;
            
        case 
2:
            
AddPropForce("chandelier_simple_short_6"00100.0f"world");
            
fEventSpeed 0.5f;
            
FadeLightTo("PointLight_1"000000.5);
            
FadeLightTo("PointLight_2"0.7f10000.6);
            break;
            
        case 
3:
            
AddPropForce("chandelier_simple_short_6"002400.0f"world");
            
fEventSpeed 0.6f;
            
FadeLightTo("PointLight_2"000000.6);
            
FadeLightTo("PointLight_3"0.5f10000.6);
            break;
            
        case 
4:
            
SetEntityActive("block_box_nonchar_1"true);
            
AddPropForce("chair_wood02_4"000"world");
            
fEventSpeed 0.0f;
            
FadeLightTo("PointLight_3"000000.5);
            break;
        case 
5:
        
            
AddPropForce("chair_wood02_4",40006000"world");
            
fEventSpeed 0.0f;
            break;
        case 
6:
        
            
SetEntityActive("block_box_nonchar_1"false);
            break;
        }
if(
GetLocalVarInt("Stage") < 10)   AddTimer("thisloopsthetimer"fEventSpeed"LoopyTimerCounting");




[Image: tumblr_lfv1jh0Z5V1qfw81zo1_500.gif]
(This post was last modified: 10-27-2011, 12:48 AM by Wickedwrath.)
10-20-2011, 05:22 PM
Find


Messages In This Thread
ERR : Unexpected token '{' - by Wickedwrath - 10-20-2011, 05:22 PM
RE: ERR : Unexpected token '{' - by Your Computer - 10-20-2011, 05:36 PM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-20-2011, 05:39 PM
RE: ERR : Unexpected token '{' - by Your Computer - 10-20-2011, 05:44 PM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-20-2011, 05:51 PM
RE: ERR : Unexpected token '{' - by Your Computer - 10-20-2011, 06:15 PM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-20-2011, 07:01 PM
RE: ERR : Unexpected token '{' - by Your Computer - 10-20-2011, 07:10 PM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-20-2011, 07:32 PM
RE: ERR : Unexpected token '{' - by jens - 10-20-2011, 07:48 PM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-20-2011, 09:36 PM
RE: ERR : Unexpected token '{' - by jens - 10-21-2011, 07:27 AM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-21-2011, 07:41 AM
RE: ERR : Unexpected token '{' - by Homicide13 - 10-21-2011, 08:13 PM
RE: ERR : Unexpected token '{' - by Wickedwrath - 10-26-2011, 10:34 PM



Users browsing this thread: 1 Guest(s)