Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Unexpected token?
Author Message
Manbearpig116 Offline
Junior Member

Posts: 9
Joined: Apr 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
TeamSD Offline
Member

Posts: 51
Joined: Apr 2012
Reputation: 2
Post: #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 all posts by this user Quote this message in a reply
Manbearpig116 Offline
Junior Member

Posts: 9
Joined: Apr 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
TeamSD Offline
Member

Posts: 51
Joined: Apr 2012
Reputation: 2
Post: #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 all posts by this user Quote this message in a reply
Prelauncher Online
Senior Member

Posts: 461
Joined: May 2011
Reputation: 13
Post: #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 all posts by this user Quote this message in a reply
Manbearpig116 Offline
Junior Member

Posts: 9
Joined: Apr 2012
Reputation: 0
Post: #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 all posts by this user Quote this message in a reply
Prelauncher Online
Senior Member

Posts: 461
Joined: May 2011
Reputation: 13
Post: #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 all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)