Darkboot
Junior Member
Posts: 31
Threads: 8
Joined: Jun 2012
Reputation:
0
|
Cant see the error :S
wtf? i dont see anything so i guess i will learn a new thing today
Errors:
main (11,1);ERR;Expected "," or ';'
main (27,1) Same as above
Here's the rows:
11: void monsterActive(string &in asParent, string &in asChild, int alState)
27: void Happening(string &in asName, int alCount)
PS: im using notepad++
(This post was last modified: 05-25-2013, 01:37 PM by Darkboot.)
|
|
05-25-2013, 01:34 PM |
|
OriginalUsername
Posting Freak
Posts: 896
Threads: 42
Joined: Feb 2013
Reputation:
34
|
RE: Cant see the error :S
Could you give us more of the script?
|
|
05-25-2013, 01:39 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Cant see the error :S
Yeah. If you are ever having troubles with script, you should post the entire thing.
Discord: Romulator#0001
|
|
05-25-2013, 01:45 PM |
|
Darkboot
Junior Member
Posts: 31
Threads: 8
Joined: Jun 2012
Reputation:
0
|
RE: Cant see the error :S
i dont know how but its only 11,1 now and it is Another one since i moves 27,1. Here's the script
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("Player", "enemy_spawner_1", "monsterActive", true, 1);
AddEntityCollideCallback("Player", "PlayerStartArea_1", "Restart", true, 1);
}
void Restart(string &in asParent, string &in asChild, int alState)
void UsedKeyOnDoor(string &in asItem, string &in asEntity) <---- thats 11,1
void monsterActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_spawner_2", true);
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_1", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_5", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_6", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_1", "PathNodeArea_7", 1.0f, "");
CheckPoint ("FirstCheckpoint", "PlayerStartArea_1", "Happening", "DeathCategory", “Deathtext”);
}
void Happening(string &in asName, int alCount)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("","unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}
void OnEnter()
{
FadeOut(0.0f);
FadeIn(5.0f);
}
void OnLeave()
{
}
(This post was last modified: 05-25-2013, 01:48 PM by Darkboot.)
|
|
05-25-2013, 01:47 PM |
|
OriginalUsername
Posting Freak
Posts: 896
Threads: 42
Joined: Feb 2013
Reputation:
34
|
RE: Cant see the error :S
You have several functions behind each other without the {} for the function. I'm talking about line 10, 11 and 12.
|
|
05-25-2013, 01:51 PM |
|
Darkboot
Junior Member
Posts: 31
Threads: 8
Joined: Jun 2012
Reputation:
0
|
RE: Cant see the error :S
What? O.o
|
|
05-25-2013, 02:07 PM |
|
OriginalUsername
Posting Freak
Posts: 896
Threads: 42
Joined: Feb 2013
Reputation:
34
|
RE: Cant see the error :S
This:
void Restart(string &in asParent, string &in asChild, int alState)
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
void monsterActive(string &in asParent, string &in asChild, int alState)
Needs to be:
void Restart(string &in asParent, string &in asChild, int alState)
{
//functions
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
//functions
}
void monsterActive(string &in asParent, string &in asChild, int alState)
{
//functions
}
|
|
05-25-2013, 02:14 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Cant see the error :S
The correct way to have your script is like
void OnStart()
{ AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true); GiveItemFromFile("lantern", "lantern.ent"); AddEntityCollideCallback("Player", "enemy_spawner_1", "monsterActive", true, 1); AddEntityCollideCallback("Player", "PlayerStartArea_1", "Restart", true, 1); }
Which you have done, but you haven't done this with your things below.
Think of it like this:
void myfunction(asString, asEntity, etc) { //place what I want to happen in here }
Using an example from your code:
Assuming you want the door to unlock when you use the key on it in your code, you would have this.
void UsedKeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("mansion_1", false, true); PlaySoundAtEntity("","unlock_door", "mansion_1", 0, false); RemoveItem("awesomekey_1"); }
Discord: Romulator#0001
|
|
05-25-2013, 02:17 PM |
|
Darkboot
Junior Member
Posts: 31
Threads: 8
Joined: Jun 2012
Reputation:
0
|
RE: Cant see the error :S
okey, i deleted the checkpoint thing cause that was just a Little test and then i changed so it looks like you guys said. But i seriously dont get this.. i dont get any description on my key or the the custom story main window.. why? :S
void OnStart()
{
AddUseItemCallback("", "awesomekey_1", "mansion_1", "UsedKeyOnDoor", true);
GiveItemFromFile("lantern", "lantern.ent");
AddEntityCollideCallback("Player", "enemy_spawner_1", "monsterActive", true, 1);
}
void monsterActive(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("enemy_spawner_2", true);
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_1", 0.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_2", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_3", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_4", 1.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_5", 10.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_6", 5.0f, "");
AddEnemyPatrolNode("enemy_spawner_2", "PathNodeArea_7", 3.0f, "");
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("","unlock_door", "mansion_1", 0, false);
RemoveItem("awesomekey_1");
}
void OnEnter()
{
FadeOut(0.0f);
FadeIn(5.0f);
}
void OnLeave()
{
}
(This post was last modified: 05-25-2013, 04:26 PM by Darkboot.)
|
|
05-25-2013, 03:37 PM |
|
Romulator
Not Tech Support ;-)
Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation:
195
|
RE: Cant see the error :S
Your code is still incorrect.
Could you post what you would like to happen? For example:
I unlock a door. Once the door is unlocked, I get Sanity, but another door behind me slams shut.
Discord: Romulator#0001
|
|
05-25-2013, 03:45 PM |
|
|