Frictional Games Forum (read-only)
Please remove - 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: Please remove (/thread-12271.html)

Pages: 1 2 3


Please remove - eagledude4 - 01-02-2012

Please remove



RE: AddEntityCollideCallback - Khyrpa - 01-02-2012

"Calls a function when two entites collide"
If you move as the player and hit any part of the chest, then it should trigger. But not on interaction. So you might be better off with:

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
"Calls a function when the player interacts with a certain entity"
You can also set that inside the level editor with the entity properties.



RE: AddEntityCollideCallback - eagledude4 - 01-02-2012

(01-02-2012, 04:36 AM)Khyrpa Wrote: "Calls a function when two entites collide"
If you move as the player and hit any part of the chest, then it should trigger. But not on interaction. So you might be better off with:

SetEntityPlayerInteractCallback(string& asName, string& asCallback, bool abRemoveOnInteraction);
"Calls a function when the player interacts with a certain entity"
You can also set that inside the level editor with the entity properties.

Before I seen you're reply, I tried SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true); but that didn't work either.

Do I just insert the name of the function in the PlayerInteractCallback field? Just "TriggerSpider"?
I've never used the script functions inside the editor, does it change anything in the .hps file itself?





RE: AddEntityCollideCallback - Statyk - 01-02-2012

I figured out the other day playing Unsterblich that spiders do not work properly in Amnesia. They will scurry around and attack you, but the mesh stays at the 0 point of all axis in the level. It's a bug (no pun intended), and unfortunately, does not work like they do in Penumbra. =[ I'm sorry


RE: AddEntityCollideCallback - Khyrpa - 01-02-2012

(01-02-2012, 04:39 AM)eagledude4 Wrote: Before I seen you're reply, I tried SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true); but that didn't work either.

Do I just insert the name of the function in the PlayerInteractCallback field? Just "TriggerSpider"?
I've never used the script functions inside the editor, does it change anything in the .hps file itself?
When you use the functions inside the editor, put your mouse on top of them to see the syntax (string &in asEntity) for PlayerInteractCallback for example. When you write TriggerSpider there, just put:
void TriggerSpider(string &in asEntity)
{//stuff
}



(01-02-2012, 04:46 AM)Statyk Wrote: I figured out the other day playing Unsterblich that spiders do not work properly in Amnesia. They will scurry around and attack you, but the mesh stays at the 0 point of all axis in the level. It's a bug (no pun intended), and unfortunately, does not work like they do in Penumbra. =[ I'm sorry
The spider entity in insan_visions works though, its just with an idle loop animation.



RE: AddEntityCollideCallback - Statyk - 01-02-2012

(01-02-2012, 04:50 AM)Khyrpa Wrote: The spider entity in insan_visions works though, its just with an idle loop animation.
I thought that was the only one in the files.. >>


RE: AddEntityCollideCallback - eagledude4 - 01-02-2012

(01-02-2012, 04:50 AM)Khyrpa Wrote:
(01-02-2012, 04:39 AM)eagledude4 Wrote: Before I seen you're reply, I tried SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true); but that didn't work either.

Do I just insert the name of the function in the PlayerInteractCallback field? Just "TriggerSpider"?
I've never used the script functions inside the editor, does it change anything in the .hps file itself?
When you use the functions inside the editor, put your mouse on top of them to see the syntax (string &in asEntity) for PlayerInteractCallback for example. When you write TriggerSpider there, just put:
void TriggerSpider(string &in asEntity)
{//stuff
}



(01-02-2012, 04:46 AM)Statyk Wrote: I figured out the other day playing Unsterblich that spiders do not work properly in Amnesia. They will scurry around and attack you, but the mesh stays at the 0 point of all axis in the level. It's a bug (no pun intended), and unfortunately, does not work like they do in Penumbra. =[ I'm sorry
The spider entity in insan_visions works though, its just with an idle loop animation.

Thanks for the warning about the bug, I switched to the insan_visions spider.
As for the PlayerInteractCallback, are you saying I have to put the whole function in that tiny field box? I'd rather do it in the script itself if that's the case.

As for now, I have SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true);, but the spider is not in the chest when I open it.




RE: AddEntityCollideCallback - Khyrpa - 01-02-2012

void OnStart()
{
SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true);
}
void TriggerSpider(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("spider_1", true);

//FadeOut(0); //I like to use somethings like this to check if a callback happens
}




RE: AddEntityCollideCallback - eagledude4 - 01-02-2012

(01-02-2012, 06:42 AM)Khyrpa Wrote: void OnStart()
{
SetEntityPlayerInteractCallback("chest_small_2", "TriggerSpider", true);
}
void TriggerSpider(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("spider_1", true);

//FadeOut(0); //I like to use somethings like this to check if a callback happens
}
Just replaced my code with yours, still no spider. Also, what does "FadeOut(0);" do exactly?





RE: AddEntityCollideCallback - Statyk - 01-02-2012

It makes the screen black instantly. That's actually a good teting idea. see, if a function isn't working, a visual like THAT would easily tell you if something is wrong with a specific function, or if it is working fine but has a typo somewhere, etc. Understand?