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
SCRIPTING PROBLEMS
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#1
SCRIPTING PROBLEMS

I keep getting this error [see attachment] every time I try and load. I've gotten rid of the tokens, added the ';' it wants, and it still complains. -.- Here's my full script:

Spoiler below!
void OnStart(wakeup())

void wakeUp () {
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");
}

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}

{
AddUseItemCallback("", "crowbar_1", "prison_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
}

void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("prison_1", false, true);
SetMoveObjectState("prison_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}

{
AddUseItemCallback("", "ladder_1", "PlaceLadder", "LadderOn", true);
}

void LadderOn(string &in asItem, string &in asEntity)
{
SetEntityActive("LadderArea_1", true);
SetEntityActive("ladder_static_1", true);
GiveSanityBoostSmall();
}

{
AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("key_1");
}

{
AddEntityCollideCallback("Player" , "monster_rawr" , "MonsterFunc1" , true , 1);
}
void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt" , true);
}


thanks to anyone who can help me! D:


Attached Files
.jpg   002.JPG (Size: 229.13 KB / Downloads: 106)

Ba-da bing, ba-da boom.
07-16-2011, 10:07 PM
Find
xtron Offline
Senior Member

Posts: 402
Threads: 37
Joined: May 2011
Reputation: 2
#2
RE: SCRIPTING PROBLEMS

isn't it
void OnStart()
{
wakeup();
}

?

[Image: 44917299.jpg]Dubstep <3
(This post was last modified: 07-16-2011, 10:18 PM by xtron.)
07-16-2011, 10:18 PM
Find
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#3
RE: SCRIPTING PROBLEMS

Woah.. ok.. first off, '(wake up)', that does NOT belong there lol, nothing goes inbetween the parenthesis of OnStart(), OnLeave(), or OnEnter().
and there are extra brackets everywhere.
Here:
void OnStart()
{
FadeOut(0);
FadeIn(20);
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220);
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true);
AddTimer("trig1", 11.0f, "beginStory");
AddUseItemCallback("", "crowbar_1", "prison_1", "UsedCrowbarOnDoor", true);
AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1);
AddUseItemCallback("", "ladder_1", "PlaceLadder", "LadderOn", true);
AddUseItemCallback("", "key_1", "locked_door1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player" , "monster_rawr" , "MonsterFunc1" , true , 1);
}

void beginStory(string &in asTimer)
{
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33);
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}


void UsedCrowbarOnDoor(string &in asItem, string &in asEntity)
{
AddTimer("", 0.2, "TimerSwitchShovel");
RemoveItem("crowbar_1");
}

void TimerSwitchShovel(string &in asTimer)
{
PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false);
SetEntityActive("crowbar_joint_1", true);
}

void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState)
{
AddPlayerSanity(25);
PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
SetSwingDoorLocked("prison_1", false, true);
SetMoveObjectState("prison_1", 1);
PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false);
SetEntityActive("crowbar_joint_1", false);
SetLocalVarInt("Door", 1);
}


void LadderOn(string &in asItem, string &in asEntity)
{
SetEntityActive("LadderArea_1", true);
SetEntityActive("ladder_static_1", true);
GiveSanityBoostSmall();
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("locked_door1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "locked_door1", 0, false);
RemoveItem("key_1");
}


void MonsterFunc1(string &in asParent , string &in asChild , int alState)
{
SetEntityActive("servant_grunt" , true);
}

void OnEnter()
{

}


void OnLeave()
{

}

I had to redo most of the script, there might be some syntax error, i'm not sure, i'm being lazy right now sorry.
None of the commands belong in a seperate set of brackets like you had it.
EX:
{
AddEntityCollideCallback(blah, blah, blah)
}

It doesn't work that way, these commands will always be in one of the On sections (OnStart, OnEnter, etc.)
The only things that get a bracket are the callback functions themselves.

EDIT: lol, I dunno if I messed it up or not, considering the way you had it.
(This post was last modified: 07-16-2011, 10:30 PM by Zypherzemus.)
07-16-2011, 10:28 PM
Find
JenniferOrange Offline
Senior Member

Posts: 424
Threads: 43
Joined: Jun 2011
Reputation: 33
#4
RE: SCRIPTING PROBLEMS

I'm sorry about putting the wakeup() in the OnStart parenthesis.. I got the script from someone else and the directions said to put that in between a code and I was very clueless.. xD I've made a backup of my original script and have copied Snuffalofagus' script to try out instead, I'll let you know if it works. Big Grin

IT WORKS, THANKYOU Big Grin

Ba-da bing, ba-da boom.
(This post was last modified: 07-16-2011, 10:52 PM by JenniferOrange.)
07-16-2011, 10:45 PM
Find




Users browsing this thread: 1 Guest(s)