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 Unexpected token?
Manbearpig116 Offline
Junior Member

Posts: 9
Threads: 4
Joined: Apr 2012
Reputation: 0
#1
Unexpected token?

Any ideas?

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 0);
AddUseItemCallback("", "waterdoorkey", "waterdoor", "UsedKeyOnDoor", true);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alstate)
{
SetSwingDoorClosed("RoomTwoDoor", true, true);
GiveSanityDamage(90 , true);
PlayGuiSound("react_past", 1);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity);
{
SetSwingDoorLocked("waterdoorkey, false, true);
PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false);
RemoveItem("waterdoorkey");
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
04-26-2012, 06:13 PM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#2
RE: Unexpected token?

I see unwanted space here;

GiveSanityDamage(90 , true);

Could you be more specific with your error? What does it exactly say?

Also this line.

PlayGuiSound("react_past", 1);

I belive it should be like this:

PlayGuiSound("react_pant.snt", 1);

(This post was last modified: 04-26-2012, 06:30 PM by TeamSD.)
04-26-2012, 06:25 PM
Find
Manbearpig116 Offline
Junior Member

Posts: 9
Threads: 4
Joined: Apr 2012
Reputation: 0
#3
RE: Unexpected token?

(04-26-2012, 06:25 PM)TeamSD Wrote: I see unwanted space here;

GiveSanityDamage(90 , true);

Could you be more specific with your error? What does it exactly say?

Also this line.

PlayGuiSound("react_past", 1);

I belive it should be like this:

PlayGuiSound("react_pant.snt", 1);
It says
FATAL ERROR : Could not load script file 'custom_stories/Awakening 0.1/,aps/01_basement.hps '! Main (17, 1) : ERR Unexpected token '{'


04-26-2012, 06:32 PM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#4
RE: Unexpected token?

(04-26-2012, 06:32 PM)Manbearpig116 Wrote:
(04-26-2012, 06:25 PM)TeamSD Wrote: I see unwanted space here;

GiveSanityDamage(90 , true);

Could you be more specific with your error? What does it exactly say?

Also this line.

PlayGuiSound("react_past", 1);

I belive it should be like this:

PlayGuiSound("react_pant.snt", 1);
It says
FATAL ERROR : Could not load script file 'custom_stories/Awakening 0.1/,aps/01_basement.hps '! Main (17, 1) : ERR Unexpected token '{'
void UsedKeyOnDoor(string &in asItem, string &in asEntity); <--- this is wrong I belive. Erase ;

{

SetSwingDoorLocked("waterdoorkey, false, true);

PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false);

RemoveItem("waterdoorkey");

}

Hope it works :)

Prelauncher, you have sharp eyes

(This post was last modified: 04-26-2012, 06:42 PM by TeamSD.)
04-26-2012, 06:36 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#5
RE: Unexpected token?

SetSwingDoorLocked("waterdoorkey, false, true);
make that: SetSwingDoorLocked("waterdoorkey", false, true);
Main (17, 1) tells you on what line the problem is located

Socialism (noun): A great way to run out of other people's money.
04-26-2012, 06:37 PM
Find
Manbearpig116 Offline
Junior Member

Posts: 9
Threads: 4
Joined: Apr 2012
Reputation: 0
#6
RE: Unexpected token?

Okay now it's telling me that the error is located at 37,2 but I have no idea what to do with it
////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "RoomTwoArea", "CollideRoomTwo", true, 0);
AddUseItemCallback("", "waterdoorkey", "waterdoor", "UsedKeyOnDoor", true);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alstate)
{
SetSwingDoorClosed("RoomTwoDoor", true, true);
GiveSanityDamage(90 , true);
PlayGuiSound("react_pant.snt", 1);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("waterdoorkey", false, true);

PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false);

RemoveItem("waterdoorkey");

////////////////////////////
// Run when entering map
void OnEnter()
{

}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
(This post was last modified: 04-26-2012, 06:52 PM by Manbearpig116.)
04-26-2012, 06:51 PM
Find
Prelauncher Offline
Senior Member

Posts: 451
Threads: 11
Joined: May 2011
Reputation: 13
#7
RE: Unexpected token?

void UsedKeyOnDoor(string &in asItem, string &in asEntity)

{

SetSwingDoorLocked("waterdoorkey", false, true);

PlaySoundAtEntity("", "unlock_door", "waterdoor", 0, false);

RemoveItem("waterdoorkey");

}

Socialism (noun): A great way to run out of other people's money.
(This post was last modified: 04-26-2012, 06:55 PM by Prelauncher.)
04-26-2012, 06:54 PM
Find




Users browsing this thread: 1 Guest(s)