![]() |
Game Problems - 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: Game Problems (/thread-19466.html) |
RE: Game Problems - The chaser - 12-08-2012 (12-08-2012, 05:21 PM)Fishnugget Wrote: Where exactly have i to write onenter();?Wherever you want, like void OnStart() or void OnLeave. By this I don't mean putting it in there, I mean putting it freely. Like this: void OnStart() { } void OnEnter() { } RE: Game Problems - Fishnugget - 12-08-2012 Is this right? void OnStart() { AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideDoorExplode" , true , 1); } void Clown1(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_1", true); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle"); } void Clown2(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_3", true); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle"); } void Clown3(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_2", true); AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle"); AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle"); } void OnEnter() void CollideDoorExplode(string &in asParent, string &in asChild, int alState) { SetEntityActive("castle_1", false); SetEntityActive("castle_broken_1", true); CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false); PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false); } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Game Problems - FlawlessHappiness - 12-08-2012 No. Void OnEnter is just like void OnStart. This is what you wrote: void OnStart() { } void OnEnter() Do you see. There is a problem. It should look like this: void OnEnter() { } RE: Game Problems - Fishnugget - 12-08-2012 like this? void OnEnter() { AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideDoorExplode" , true , 1); } void Clown1(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_1", true); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle"); } void Clown2(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_3", true); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle"); } void Clown3(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_2", true); AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle"); AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle"); } void CollideDoorExplode(string &in asParent, string &in asChild, int alState) { SetEntityActive("castle_1", false); SetEntityActive("castle_broken_1", true); CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false); PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false); } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Game Problems - FlawlessHappiness - 12-08-2012 No. I'm change your script now: void OnStart() { AddEntityCollideCallback("Player" , "ScriptArea_1" , "Clown1" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_2" , "Clown2" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_3" , "Clown3" , true , 1); AddEntityCollideCallback("Player" , "ScriptArea_1" , "CollideDoorExplode" , true , 1); } void Clown1(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_1", true); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_1", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_2", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_3", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_4", 0, "Idle"); AddEnemyPatrolNode("Clooni1_1", "PathNodeArea_5", 0, "Idle"); } void Clown2(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_3", true); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_6", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_7", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_8", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_9", 0, "Idle"); AddEnemyPatrolNode("Clooni1_3", "PathNodeArea_10", 0, "Idle"); } void Clown3(string &in asParent, string &in asChild, int alState) { SetEntityActive("Clooni1_2", true); AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_11", 0, "Idle"); AddEnemyPatrolNode("Clooni1_2", "PathNodeArea_12", 0, "Idle"); } void CollideDoorExplode(string &in asParent, string &in asChild, int alState) { SetEntityActive("castle_1", false); SetEntityActive("castle_broken_1", true); CreateParticleSystemAtEntity("", "ps_break_wood.ps", "DoorExplodeParticle", false); PlaySoundAtEntity("", "break_wood.snt", "DoorExplodeParticle", 0, false); } void OnEnter() { } //////////////////////////// // Run when leaving map void OnLeave() { } RE: Game Problems - Fishnugget - 12-08-2012 Oh, now I get it, thanks^^ but the door doesnt explode RE: Game Problems - The chaser - 12-08-2012 You have two AddEntityCollideCallback's with ScriptArea_1. Wouldn't it be more logical to put the door thing in the "Clown 1"? Script: Code: void OnStart() Also, those "AddEnemyPatrolNode" have "Idle" as animation. Why is that? RE: Game Problems - Fishnugget - 12-08-2012 dammit, I really dont get it xDDD i have an better idea. I delete the door and make just a floor who the evil clown walks RE: Game Problems - The chaser - 12-08-2012 Fishnugget, read carefully: Scripts can be hard, very hard. I toke me a good time to memorize a lot of scripts and I still need the wiki for a lot of things. But, if you skip and change the idea to a more basic one, you will never learn. Everything will be the same. So, when making scripts, you have to think. A LOT. You must care about bugs and how realistic does it look in-game. So, we are here. Ask freely. Whatever you need, hell, this is Development Support, we help people. If you need so, we will crush our head to think to solve your problem. Now, what's the thing you don't get? Let's see: This is the list of ALL available scripts for Amnesia (doesn't include Justine, I think). You can look at the scripts to see what they do. And this is a large list of tutorials to improve your techniques. I've learned with them, do so too. Basic scripting tutorial: http://wiki.frictionalgames.com/hpl2/tutorials/script/entihscript_beginner RE: Game Problems - FlawlessHappiness - 12-08-2012 Yes. You need to understand what a basic script is. So you understand why you get the errors. And understand that whenever you open something. ( [ { You have to close it again ) ] } |