![]() |
[SCRIPT] Cant see the error :S - Printable Version +- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum) +-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html) +--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html) +---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html) +---- Thread: [SCRIPT] Cant see the error :S (/thread-21605.html) Pages:
1
2
|
Cant see the error :S - Darkboot - 05-25-2013 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++ RE: Cant see the error :S - OriginalUsername - 05-25-2013 Could you give us more of the script? RE: Cant see the error :S - Romulator - 05-25-2013 Yeah. If you are ever having troubles with script, you should post the entire thing. ![]() RE: Cant see the error :S - Darkboot - 05-25-2013 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() { } RE: Cant see the error :S - OriginalUsername - 05-25-2013 You have several functions behind each other without the {} for the function. I'm talking about line 10, 11 and 12. RE: Cant see the error :S - Darkboot - 05-25-2013 What? O.o RE: Cant see the error :S - OriginalUsername - 05-25-2013 This: Code: void Restart(string &in asParent, string &in asChild, int alState) Needs to be: Code: void Restart(string &in asParent, string &in asChild, int alState) RE: Cant see the error :S - Romulator - 05-25-2013 The correct way to have your script is like PHP Code: void OnStart() Think of it like this: PHP Code: void myfunction(asString, asEntity, etc) 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. PHP Code: void UsedKeyOnDoor(string &in asItem, string &in asEntity) RE: Cant see the error :S - Darkboot - 05-25-2013 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() { } RE: Cant see the error :S - Romulator - 05-25-2013 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. |