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
Need help with my script!!!!!
MrNord94 Offline
Junior Member

Posts: 1
Threads: 2
Joined: May 2013
Reputation: 0
#1
Need help with my script!!!!!

Hi. I'm new to this level editor, and I'm having problems understanding what can be wrong with my script-code. Can anyone please tell me, it would be great if someone could Big Grin



errors:
main (13,6) ERR: Expected "("
main (21,6) ERR: Expected "("
main (29,6) ERR: Expected "("
main (35,6) ERR: Expected "("
main (47,6) ERR: Expected "("


Here's the code:

void OnStart()
{
{
AddEntityCollideCallback("Player", "BildeShow", "ActivateBildeShow", true, 1);
AddEntityCollideCallback("Player", "Monster1Area", "ActivateMonster", true, 1 );
AddUseItemCallback("", "SkapNokkel", "Skap1", "OpenDoor1", true);
AddUseItemCallBack("", "DoorKey", "Door1", "OpenDoor2", true);
SetSwingDoorLocked("Skap1", true, true);
SetSwingDoorDisableAutoClose("Skap1", true);
SetSwingDoorClosed("Skap1", false, true);
}

void ActivateBildeShow(string &in asParent, string &in asChild, int alState)

{
AddPropForce("Bilde1", -1000, 0, 0, "world");
SetPlayerSanity(10);
}


void OpenDoor1(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Skap1", false, false);
PlaySoundAtEntity("", "unlock_door", asEntity, 0, false);
RemoveItem(asItem);
SetPlayerSanity(1);
AddTimer("Timer1", 0.5, "ReleaseMartin");
}
void ReleaseMartin(string &in asTimer)
{
AddPropForce("Martin", 10000, 0, 0, "world");

}

void ActivateMonster(string &in asParent, string &in asChild, int alState)

{

ShowEnemyPlayerPosition("Monster1");
AddQuest("Quest1", "Welcome");
SetEntityActive("Monster1", true);
AddEnemyPatrolNode("Monster1", "PathNodeArea_1", 0, "Idle");
AddQuest("Quest2", "KeyToLocker");
}


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

{
SetSwingDoorLocked("Door1", false, true);
PlaySoundAtEntity("", "unlock_door", "Door1", 0, false);
RemoveItem(DoorKey);
}

}

void OnEnter(){}

void OnExit(){}
05-05-2013, 04:58 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#2
RE: Need help with my script!!!!!

Remove one of these brackets:

PHP Code: (Select All)
void OnStart()
{



And one of these:

PHP Code: (Select All)
void OpenDoor2(string &in asItemstring &in asEntity)
//Close up this space here. The compiler probably doesn't care, it's just good form
{
SetSwingDoorLocked("Door1"falsetrue);
PlaySoundAtEntity("""unlock_door""Door1"0false);
RemoveItem(DoorKey);
}

//This one 


This, also:

PHP Code: (Select All)
void ActivateBildeShow(string &in asParentstring &in asChildint alState)
//This space, as well
{
AddPropForce("Bilde1", -100000"world");
SetPlayerSanity(10);


There might be more, but try that and see what happens.
(This post was last modified: 05-05-2013, 05:40 PM by Tomato Cat.)
05-05-2013, 05:39 PM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#3
RE: Need help with my script!!!!!

You could always look for it yourself. The error message:

main (13,6) ERR: Expected "("
main (21,6) ERR: Expected "("
main (29,6) ERR: Expected "("
main (35,6) ERR: Expected "("
main (47,6) ERR: Expected "("

Just means there is something wrong in the 13th line, 6th digit. Expected "(" probably means you're missing a ( or you placed anything else wrong there.

Right?
(This post was last modified: 05-06-2013, 02:23 AM by OriginalUsername.)
05-06-2013, 01:57 AM
Find
CarnivorousJelly Offline
Posting Freak

Posts: 1,196
Threads: 41
Joined: Dec 2012
Reputation: 80
#4
RE: Need help with my script!!!!!

(05-05-2013, 04:58 PM)MrNord94 Wrote: Hi. I'm new to this level editor, and I'm having problems understanding what can be wrong with my script-code. Can anyone please tell me, it would be great if someone could Big Grin

errors:
main (13,6) ERR: Expected "("
main (21,6) ERR: Expected "("
main (29,6) ERR: Expected "("
main (35,6) ERR: Expected "("
main (47,6) ERR: Expected "("
Smoke and Mr Credits have already explained what's wrong with your script, so I won't parrot them Smile I'm just going to add something:

Those numbers in brackets ((13,6) for example) tell you where in your script the error is. If you're using Notepad++, the bottom of your window tells you what line and column you're in. The bracketed numbers correspond with this. The 13 tells you that it's line 13 and the 6 tells you that it's the 6th column in the line.

Your errors are at:
Line 13, column 6
Line 21, column 6
Line 29, column 6
Line 35, column 6
and line 47, column 6

Just checked in Notepad++, column 6 is one letter/character past a TAB space. So it'll probably be the first or second character of the line which needs to be fixed.

The part that comes after the coordinates tells you what's wrong with that spot. "Expected "("" means it's missing a ( - as Smoke already said.

If you're missing a closing bracket "}", or a semicolon ";" in one of your statements, it'll just give you the coordinates for the last character in your script and say "unexpected end of file" which is really super not useful! Took me forever to figure out that the end of the file was not where the error actually was the first time this happened to me!

Edit: I second Smoke's statement below

[Image: quote_by_rueppells_fox-d9ciupp.png]
(This post was last modified: 05-06-2013, 02:10 AM by CarnivorousJelly.)
05-06-2013, 02:04 AM
Find
OriginalUsername Offline
Posting Freak

Posts: 896
Threads: 42
Joined: Feb 2013
Reputation: 34
#5
RE: Need help with my script!!!!!

I just looked a little more in the script and it looks like youre going to use a flying naked guy named martin... Please dont do this, no one would really appreciate it Wink
(This post was last modified: 05-06-2013, 02:09 AM by OriginalUsername.)
05-06-2013, 02:07 AM
Find




Users browsing this thread: 1 Guest(s)