Matt201496
Junior Member
Posts: 11
Threads: 4
Joined: Jun 2012
Reputation:
0
|
Err (60, 26) Expected '('
I think it's this part of the script that has an error, but i'm not sure what to do.
void DeactivateMonster (string &in asTimer)
{
SetEntityActive("DungeonGrunt", false);
AddTimer("",10,""); \\ Timer to change map after the grunt goes away
{
void ChangeMap(string& Test2.map, string& PlayerStartArea_2, string& , string& )
};
}
Heres the whole script if you need it:
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "DungeonKey1", "DungeonDoor", "UnlockDungeon", true);
};
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
void UnlockDungeon(string &in item, string &in door)
{
SetSwingDoorLocked(door, false, true);
PlaySoundAtEntity("", "unlock_door", door, 0, false);
RemoveItem(item);
}
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,"");
{
void ChangeMap(string& Test2.map, string& PlayerStartArea_2, string& , string& )
};
}
(This post was last modified: 06-17-2012, 11:44 PM by Matt201496.)
|
|
06-17-2012, 10:25 PM |
|
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
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 |
|
DaAinGame
Member
Posts: 90
Threads: 11
Joined: Mar 2012
Reputation:
4
|
RE: Err (60, 26) Expected '('
I honestly don't know if this worked for you before but to me this is REALLY jumbled. I'm going to give you corrected code and then you can ask questions on the changes I made.
////////////////////////////
// Run when the map starts
void OnStart()
{
AddUseItemCallback("", "DungeonKey1", "DungeonDoor", "UnlockDungeon", true);
}
////////////////////////////
// Run when entering map
void OnEnter()
{
}
////////////////////////////
// Run when leaving map
void OnLeave()
{
}
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"); //I'm not sure what the timer is for, but it needs a function callback. So I made it activate the map change
}
void ChangeMap(string &in asTimer)
{
ChangeMap("Test2.map," "PlayerStartArea_2", "", "");
}
I'm pretty sure this should work, just make sure everything in your level editor is named correctly.
*EDIT*
Someone beat me to it >.<
(This post was last modified: 06-17-2012, 10:52 PM by DaAinGame.)
|
|
06-17-2012, 10:47 PM |
|
Matt201496
Junior Member
Posts: 11
Threads: 4
Joined: Jun 2012
Reputation:
0
|
RE: Err (60, 26) Expected '('
Thanks that worked.
|
|
06-17-2012, 11:43 PM |
|
Adny
Posting Freak
Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation:
173
|
RE: Err (60, 26) Expected '('
If I had a nickel for every time I beat someone else's scripting post by 1 minute...
I'd have two nickels
I rate it 3 memes.
|
|
06-18-2012, 12:40 AM |
|
|