Why is my custom story not working!?!?!? - 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: Why is my custom story not working!?!?!? (/thread-19414.html) Pages:
1
2
|
RE: Why is my custom story not working!?!?!? - Adrianis - 12-03-2012 See here... AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); AddEntityCollideCallback("Player", "MonsterEnd", true, 1); You've called 2 of the same function, but on the second one you've missed out one of the things that function requires, which is the call to another function. AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates); asParentName - internal name of main object asChildName - internal name of object that collides with main object (asterix (*) NOT supported!) asFunction - function to call abDeleteOnCollide - determines whether the callback after it was called alStates - 1 = only enter, -1 = only leave, 0 = both That third parameter on the list tells the function AddEntityCollideCallback which function to call. Your first call to that function used "MonsterFunction", so when the 'parent' and 'child' collide, MonsterFunction is called. The reason it says 'no matching signature' is because its talking about the 'signature' of the function you are calling, AddEntityCollideCallback requires all 5 parameters to be given a value, you did it the first time but not the second. There is no AddEntityCollideCallback function that takes only 4 parameters, so there is no matching signature to that function RE: Why is my custom story not working!?!?!? - Gamerlord08 - 12-03-2012 well, it stopped with major errors, but now this: /////////////////////// // Run when starting map void OnStart() { PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); AddEntityCollideCallback("Player", "MonsterEnd", true, 1); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", bool ("abDeleteOnCollide", int (alStates) ), void MonsterFunction(string &in asParent, string &in asChild, int alState) { SetEntityActive("servant_grunt_1", true); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_3", 0, ""); } ////////////////////// // Run when leaving map void OnLeave() { } now it says "(25:2) Unexpected End Of File", so now i have no idea how to get rid of this. also, i thank you for fixing and explaining the problem adrianis. and i had to add extra things in order for it to stop saying problem here and problem there. RE: Why is my custom story not working!?!?!? - Adny - 12-03-2012 There's...a lot wrong. I'm tired, so to sum it up: -After OnStart you used a parentheses and a comma to end it -The second AddEntityCollideCallback needs one more string argument to set the name of the function it will call -The third AddEntityCollideCallback seems to be the same as the first, except with some really messed up part on the end. With that said, here you go: Spoiler below!
Hope that helped RE: Why is my custom story not working!?!?!? - Gamerlord08 - 12-03-2012 alright, i will try that. RE: Why is my custom story not working!?!?!? - Gamerlord08 - 12-05-2012 didn't work bud, it's ether that doesn't work, or mine doesn't work, thinking mine, i have another custom story and i made a script, but he doesn't react to my script, AT ALL. RE: Why is my custom story not working!?!?!? - The chaser - 12-05-2012 (12-05-2012, 04:01 PM)Gamerlord08 Wrote: didn't work bud, it's ether that doesn't work, or mine doesn't work, thinking mine, i have another custom story and i made a script, but he doesn't react to my script, AT ALL.In case it doesn't work, post your script and tell us if it crashes Amnesia or just doesn't work. Those are two things I made once and that you could have done too: -Make sure it's an .hps -It must have the same name than the map RE: Why is my custom story not working!?!?!? - Gamerlord08 - 12-07-2012 it is a .hps file, i get the (25: 2) unexpected end of file error, here's what i'm using with the custom story, everything else checks out. /////////////////////// // Run when starting map void OnStart() { PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); AddEntityCollideCallback("Player", "MonsterEnd", true, 1); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", bool ("abDeleteOnCollide", int (alStates) ), void MonsterFunction(string &in asParent, string &in asChild, int alState) { SetEntityActive("servant_grunt_1", true); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_3", 0, ""); } ////////////////////// // Run when leaving map void OnLeave() { } see if you can figure this out, i cannot put my finger on why it's saying this. also, it just doesn't work, amnesia works fine unless i try my custom story. RE: Why is my custom story not working!?!?!? - The chaser - 12-07-2012 (12-07-2012, 08:51 PM)Gamerlord08 Wrote: it is a .hps file, i get the (25: 2) unexpected end of file error, here's what i'm using with the custom story, everything else checks out.void OnStart() { PlayMusic("01_amb_darkness.ogg", true, 1.0f, 0, 0, true); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); AddEntityCollideCallback("Player", "MonsterEnd", true, 1); AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1); } void MonsterFunction(string &in asParent, string &in asChild, int alState) { SetEntityActive("servant_grunt_1", true); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_1", 2, ""); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_2", 0, ""); AddEnemyPatrolNode("servant_Grunt_1", "PathNodeArea_3", 0, ""); } ////////////////////// // Run when leaving map void OnLeave() { } You had the last AddEntityCollideCallback wrong |