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
Script Help Error unexpected token {
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Error unexpected token {

PHP Code: (Select All)
void OnStart()
{
    
FadeOut(0);
    
AddEffectVoice("intro_1", "", "Voice", "intro1",
false, "", 0, 5);
AddEffectVoice("intro_2", "", "Voice", "intro2",
false, "", 0, 5);
AddEffectVoice("intro_3", "", "Voice", "intro3",
false, "", 0, 5);
AddEffectVoice("intro_4", "", "Voice", "intro4",
false, "", 0, 5); 
    
SetEffectVoiceOverCallback("VoicesDone"); //This enables a callback that happens when the voices are done.
}

{
AddEntityCollideCallback("Player","CollideOpeningDustDoor","AreaTriggerDoor_1",true,1);
AddEntityCollideCallback("JumpscareDoor", "AreaJumpscare", "SanityDec", true, 1);
AddEntityCollideCallback("Handle", "AreaConnect", "AttachLever", true, 1);
AddEntityCollideCallback("Player", "teleport", "changemap", true , 1);
AddEntityCollideCallback("Player", "AreaDoor", "EventDoor", true, 1);
AddEntityCollideCallback("Player", "AreaMemento", "EventQuest", true, 1);
GiveItemFromFile("tinderbox_"+1, "tinderbox.ent");
GiveItemFromFile("tinderbox_"+1, "tinderbox.ent");
GiveItemFromFile("tinderbox_"+1, "tinderbox.ent");
AddTimer("voicesintro_1", 6, "VoicesIntro_1");

wakeUp();
}



void wakeUp()
{
FadeIn(2);
SetPlayerActive(true);
SetSanityDrainDisabled(false);
ShowPlayerCrossHairIcons(true);
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(10); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
PlayGuiSound("react_pant3.ogg", 1);
FadeSepiaColorTo(0, 2);
SetPlayerActive(false); 
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.5, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
} 

Above is incorrect. They're all should be in OnStart.

Spoiler below!

CORRECT
PHP Code: (Select All)
void OnStart()
{
    
FadeOut(0);
    
AddEffectVoice("intro_1", "", "Voice", "intro1",
false, "", 0, 5);
AddEffectVoice("intro_2", "", "Voice", "intro2",
false, "", 0, 5);
AddEffectVoice("intro_3", "", "Voice", "intro3",
false, "", 0, 5);
AddEffectVoice("intro_4", "", "Voice", "intro4",
false, "", 0, 5); 
    
SetEffectVoiceOverCallback("VoicesDone"); //This enables a callback that happens when the voices are done.
AddEntityCollideCallback("Player","CollideOpeningDustDoor","AreaTriggerDoor_1",true,1);
AddEntityCollideCallback("JumpscareDoor", "AreaJumpscare", "SanityDec", true, 1);
AddEntityCollideCallback("Handle", "AreaConnect", "AttachLever", true, 1);
AddEntityCollideCallback("Player", "teleport", "changemap", true , 1);
AddEntityCollideCallback("Player", "AreaDoor", "EventDoor", true, 1);
AddEntityCollideCallback("Player", "AreaMemento", "EventQuest", true, 1);
GiveItemFromFile("tinderbox_"+1, "tinderbox.ent");
GiveItemFromFile("tinderbox_"+1, "tinderbox.ent");
GiveItemFromFile("tinderbox_"+1, "tinderbox.ent");
AddTimer("voicesintro_1", 6, "VoicesIntro_1");
wakeUp();
}

void wakeUp()
{
FadeIn(2);
SetPlayerActive(true);
SetSanityDrainDisabled(false);
ShowPlayerCrossHairIcons(true);
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(10); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
PlayGuiSound("react_pant3.ogg", 1);
FadeSepiaColorTo(0, 2);
SetPlayerActive(false); 
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.5, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddEntityCollideCallback("Player", "AreaCollide", "EventCollide", true, 1);
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
} 


"Veni, vidi, vici."
"I came, I saw, I conquered."
03-09-2014, 10:46 AM
Find


Messages In This Thread
Error unexpected token { - by Radical Batz - 03-09-2014, 10:22 AM
RE: Error unexpected token { - by PutraenusAlivius - 03-09-2014, 10:46 AM
RE: Error unexpected token { - by DnALANGE - 03-09-2014, 03:12 PM



Users browsing this thread: 1 Guest(s)