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
Okay what's wrong in this script ?!
Jahffax Offline
Junior Member

Posts: 7
Threads: 1
Joined: Apr 2011
Reputation: 0
#1
Okay what's wrong in this script ?!

Hi, I started to make custom story and I don't have any scripting experience.. Why I get this error when I try load my map : main(32,27) : ERR : Expected '('

This is my script and tell if there is something else wrong. Smile

void OnStart()
{
AddEntityCollideCallback("Player","ScriptArea_1", "MonsterFunc1" , true , 1);
}


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

AddEnemyPatrolNode("servant_grunt", "1", 2,"");
AddEnemyPatrolNode("servant_grunt", "2", 2,"");
AddEnemyPatrolNode("servant_grunt", "3", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "4", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "5", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "6", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "7", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "8", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "9", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "10", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "11", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "12", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "13", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "14", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "15", 1.7,"");
}

void OnEnter()
{
AddUseItemCallback("", "crowbar_1", "ovi1", "ekanovenavaus", true);

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

SetSwingDoorLocked("ovi1", false, true);
PlaySoundAtEntity("", "unlock_door", "ovi1", 0, false);
RemoveItem("crowbar_1");
}
04-21-2011, 11:00 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#2
RE: Okay what's wrong in this script ?!

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

I'm not sure what that is doing there. Smile
04-21-2011, 11:20 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#3
RE: Okay what's wrong in this script ?!

It appears you missing a brace at the end of OnEnter(...) and before the start of ekanovenavaus(...) - so either you didn't fully delete a function, or you forgot a "}" and a "{".
04-21-2011, 05:24 PM
Find
Jahffax Offline
Junior Member

Posts: 7
Threads: 1
Joined: Apr 2011
Reputation: 0
#4
RE: Okay what's wrong in this script ?!

Well Now I got fixed it but new problem came!

void OnStart()
{
AddEntityCollideCallback("Player","ScriptArea_1", "MonsterFunc1" , true , 1);
}

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

{
SetEntityActive("servant_grunt" , true);

AddEnemyPatrolNode("servant_grunt", "1", 2,"");
AddEnemyPatrolNode("servant_grunt", "2", 2,"");
AddEnemyPatrolNode("servant_grunt", "3", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "4", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "5", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "6", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "7", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "8", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "9", 1.3,"");
AddEnemyPatrolNode("servant_grunt", "10", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "11", 1.7,"");
AddEnemyPatrolNode("servant_grunt", "12", 0.6,"");
AddEnemyPatrolNode("servant_grunt", "13", 1,"");
AddEnemyPatrolNode("servant_grunt", "14", 1,"");
AddEnemyPatrolNode("servant_grunt", "15", 1,"");
}
void OnEnter()
{
AddUseItemCallback("", "crowbar_1", "ovi1", "avaus", true);

void avaus(string &in asItem, string &in asEntity);
{

SetSwingDoorLocked("ovi1", true, true);
PlaySoundAtEntity("", "unlock_door", "ovi1", 0, false);
RemoveItem("crowbar_1");
}
void OnLeave()
{
}

I know there is something little bit wrong but I can't find it lol. It says unexpected end of file.
04-22-2011, 11:18 AM
Find
Tottel Offline
Senior Member

Posts: 307
Threads: 9
Joined: Nov 2010
Reputation: 0
#5
RE: Okay what's wrong in this script ?!

you didn't close the OnEnter() function.
04-22-2011, 11:28 AM
Find




Users browsing this thread: 2 Guest(s)