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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yet another noob asking for help scripting
Author Message
Repus32 Offline
Junior Member

Posts: 10
Joined: Jan 2011
Reputation: 0
Post: #1
Sad Yet another noob asking for help scripting
////////////////////////////
// Run first time starting map
void OnStart()
{
SetPlayerLampOil(0);

}
////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("09_amb_safe", true, 0.9, 5, 0, true);

AddUseItemCallback("", "Key_1", "Door_1", "UsedKeyOnDoor", true);

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(Door_1, false, true);
PlaySoundAtEntity("", "unlock_door.snt", "Door_1", 0.0f, false);
RemoveItem(Key_1);
}
}
////////////////////////////
// Run when leaving map
void OnLeave()
{

}

ERROR: expected ( at 16,8!

Could someone please help me fix this?
09-01-2011 08:17 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,268
Joined: Jul 2011
Reputation: 223
Post: #2
RE: Yet another noob asking for help scripting
You're not supposed to define a function within another function (i.e. take UsedKeyOnDoor out of OnEnter).

Tutorials: From Noob to Pro
09-01-2011 08:51 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Repus32 Offline
Junior Member

Posts: 10
Joined: Jan 2011
Reputation: 0
Post: #3
RE: Yet another noob asking for help scripting
Many thanks upon you, good sir. Is there a tutorial page for this out there somewhere?
09-01-2011 10:43 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,268
Joined: Jul 2011
Reputation: 223
Post: #4
RE: Yet another noob asking for help scripting
(09-01-2011 10:43 PM)Repus32 Wrote:  Is there a tutorial page for this out there somewhere?
For what exactly? Defining a function? How to handle errors? Understanding scripting in general?

Tutorials: From Noob to Pro
09-02-2011 04:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




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