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
Err (60, 26) Expected '('
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#2
RE: Err (60, 26) Expected '('

Honestly, there isn't enough information here and/or proper callbacks added to void "OnStart()" for me to know what you're trying to accomplish in this script; but I gave it my best shot. I'll try to break things down bit by bit to help you and show where you went wrong for future reference (I will be using the entire script you posted)!


void OnStart()
{
AddUseItemCallback("", "DungeonKey1", "DungeonDoor", "UnlockDungeon", true);
}

I changed the location of the semicolon ( ; ) and got rid of the extraneous spacing. This looks good so far.


void UnlockDungeon(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DungeonDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "DungeonDoor", 0, false);
RemoveItem("DungeonKey1");
}

Revised door to "DungeonDoor", and changed the callback syntax to "(string &in asItem, string &in asEntity)"


void ActivateMonster(string &in asItem, string &in asEntity)
{
SetEntityActive("DungeonGrunt", true);
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_2", 0, "idle");
AddTimer("", 30, "DeactivateMonster");
}

You had too many brackets ({}), and the colons were in the incorrect position; I also added colons/spaces where necessary. Also, there is no Entity Callback Function for this (unless you added it in the level editor). Because I do not know what items you're using, or if this is even the proper syntax you meant to use, the only thing I can do is offer you the correct callback function to place under void "OnStart()":


AddUseItemCallback(string& asName, string& asItem, string& asEntity, string& asFunction, bool abAutoDestroy);



void DeactivateMonster(string &in asTimer)
{
SetEntityActive("DungeonGrunt", false);

AddTimer("",10,"ChangeMap");
}


You left the function to call for AddTimer blank, so I made the assumption it was "ChangeMap" (as indicated later in your script).


void ChangeMap(string &in asTimer)
{
ChangeMap("Test2.map", "PlayerStartArea_2", "", "")
}

Again, it was difficult to tell what you were trying to do, so I had to attempt to fill in the gaps. Also, I moved OnEnter and OnLeave to the bottom of the script. Here it is all together:



////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "DungeonKey1", "DungeonDoor", "UnlockDungeon", true);
}


void UnlockDungeon(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("DungeonDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "DungeonDoor", 0, false);
RemoveItem("DungeonKey1");
}

void ActivateMonster(string &in item)
{
SetEntityActive("DungeonGrunt", true);
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_1", 0, "idle");
AddEnemyPatrolNode("DungeonGrunt", "PathNodeArea_2", 0, "idle");
AddTimer("", 30, "DeactivateMonster");
}

void DeactivateMonster(string &in asTimer)
{
SetEntityActive("DungeonGrunt", false);

AddTimer("",10,"ChangeMap");

}

void ChangeMap(string &in asTimer)
{
ChangeMap("Test2.map", "PlayerStartArea_2", "", "")
}

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

}

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

}

Hope that helped!

I rate it 3 memes.
06-17-2012, 10:46 PM
Find


Messages In This Thread
Err (60, 26) Expected '(' - by Matt201496 - 06-17-2012, 10:25 PM
RE: Err (60, 26) Expected '(' - by Adny - 06-17-2012, 10:46 PM
RE: Err (60, 26) Expected '(' - by DaAinGame - 06-17-2012, 10:47 PM
RE: Err (60, 26) Expected '(' - by Matt201496 - 06-17-2012, 11:43 PM
RE: Err (60, 26) Expected '(' - by Adny - 06-18-2012, 12:40 AM



Users browsing this thread: 1 Guest(s)