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
Please remove
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#1
Please remove

Please remove

Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-11-2012, 10:38 PM by eagledude4.)
01-02-2012, 04:31 AM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#2
RE: AddEntityCollideCallback

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

01-02-2012, 04:36 AM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#3
RE: AddEntityCollideCallback

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



Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-02-2012, 04:50 AM by eagledude4.)
01-02-2012, 04:39 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#4
RE: AddEntityCollideCallback

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
(This post was last modified: 01-02-2012, 04:46 AM by Statyk.)
01-02-2012, 04:46 AM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#5
RE: AddEntityCollideCallback

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

(This post was last modified: 01-02-2012, 04:52 AM by Khyrpa.)
01-02-2012, 04:50 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#6
RE: AddEntityCollideCallback

(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.. >>
01-02-2012, 05:20 AM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#7
RE: AddEntityCollideCallback

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


Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-02-2012, 05:57 AM by eagledude4.)
01-02-2012, 05:41 AM
Find
Khyrpa Offline
Senior Member

Posts: 638
Threads: 10
Joined: Apr 2011
Reputation: 24
#8
RE: AddEntityCollideCallback

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
}


01-02-2012, 06:42 AM
Find
eagledude4 Offline
Member

Posts: 144
Threads: 14
Joined: Dec 2011
Reputation: 0
#9
RE: AddEntityCollideCallback

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



Its hard to see the truth when you've been blinded by lies.
(This post was last modified: 01-02-2012, 06:47 AM by eagledude4.)
01-02-2012, 06:45 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#10
RE: AddEntityCollideCallback

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?
01-02-2012, 07:08 AM
Find




Users browsing this thread: 1 Guest(s)