Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why is my custom story not working!?!?!?
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#11
RE: Why is my custom story not working!?!?!?

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
(This post was last modified: 12-03-2012, 03:25 AM by Adrianis.)
12-03-2012, 03:24 AM
Find
Gamerlord08 Offline
Junior Member

Posts: 8
Threads: 1
Joined: Dec 2012
Reputation: 0
#12
RE: Why is my custom story not working!?!?!?

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.
(This post was last modified: 12-03-2012, 05:18 PM by Gamerlord08.)
12-03-2012, 05:17 PM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#13
RE: Why is my custom story not working!?!?!?

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!


///////////////////////
// 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", "FUNCTION_TO_CALL", 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()
{


}


Hope that helped

I rate it 3 memes.
(This post was last modified: 12-03-2012, 06:23 PM by Adny.)
12-03-2012, 06:22 PM
Find
Gamerlord08 Offline
Junior Member

Posts: 8
Threads: 1
Joined: Dec 2012
Reputation: 0
#14
RE: Why is my custom story not working!?!?!?

alright, i will try that.
(This post was last modified: 12-03-2012, 10:28 PM by Gamerlord08.)
12-03-2012, 10:25 PM
Find
Gamerlord08 Offline
Junior Member

Posts: 8
Threads: 1
Joined: Dec 2012
Reputation: 0
#15
RE: Why is my custom story not working!?!?!?

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.
12-05-2012, 04:01 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#16
RE: Why is my custom story not working!?!?!?

(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

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-05-2012, 04:07 PM
Find
Gamerlord08 Offline
Junior Member

Posts: 8
Threads: 1
Joined: Dec 2012
Reputation: 0
#17
RE: Why is my custom story not working!?!?!?

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.
(This post was last modified: 12-07-2012, 08:52 PM by Gamerlord08.)
12-07-2012, 08:51 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#18
RE: Why is my custom story not working!?!?!?

(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.

///////////////////////

// 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.
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 Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-07-2012, 08:55 PM
Find




Users browsing this thread: 1 Guest(s)