Frictional Games Forum (read-only)
Is there an entity for "any" - 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: Is there an entity for "any" (/thread-14818.html)



Is there an entity for "any" - Theforgot3n1 - 04-15-2012

Okay so what i want to do is to make a room where you are alone with a grunt (and other shit), and if you use "any"thing in the room, the grunt attacks you. But i can't seem to find "any". If there is one...

SetEntityPlayerInteractCallback("any", "MonsterAttack", true);

This is basically what i want.

Thanksies.


RE: Is there an entity for "any" - SilentStriker - 04-15-2012

So what you want is when the player interacts with something in the room the grunt attacks?



RE: Is there an entity for "any" - Theforgot3n1 - 04-15-2012

(04-15-2012, 05:49 PM)SilentStriker Wrote: So what you want is when the player interacts with something in the room the grunt attacks?
Yes, i want the grunt to attack as soon as i interact with "any"thing within the area that envelops the room.





RE: Is there an entity for "any" - DRedshot - 04-15-2012

I don't think the wildcard '*' is supported in SetEntityPlayerInteractCallback, so unfortunately you might have to do it the long way.
Try doing this: SetEntityPlayerInteractCallback( * , "MonsterAttack", true);
I don't have a clue whether it will work, if it doesn't, try suffixing all entities in that room with a number, and calling a for-loop like so:

for(int i=1;i<=10;i++){SetEntityPlayerInteractCallback("entity_"+i , "MonsterAttack" , true);}

(Doing it this way would require renaming every object in that room to "entity_1" "entity_2" and so on, Instead, you might want to set an interact callback in the level editor, by typing "MonsterAttack" (without quotes) in the PlayerInteractCallback box, which can be found by clicking an object, and clicking the tab at the top right)



RE: Is there an entity for "any" - Theforgot3n1 - 04-15-2012

(04-15-2012, 06:21 PM)DRedshot Wrote: I don't think the wildcard '*' is supported in SetEntityPlayerInteractCallback, so unfortunately you might have to do it the long way.
Try doing this: SetEntityPlayerInteractCallback( * , "MonsterAttack", true);
I don't have a clue whether it will work, if it doesn't, try suffixing all entities in that room with a number, and calling a for-loop like so:

for(int i=1;i<=10;i++){SetEntityPlayerInteractCallback("entity_"+i , "MonsterAttack" , true);}

(Doing it this way would require renaming every object in that room to "entity_1" "entity_2" and so on, Instead, you might want to set an interact callback in the level editor, by typing "MonsterAttack" (without quotes) in the PlayerInteractCallback box, which can be found by clicking an object, and clicking the tab at the top right)
This part:

Instead, you might want to set an interact callback in the level editor,
by typing "MonsterAttack" (without quotes) in the
PlayerInteractCallback box, which can be found by clicking an object,
and clicking the tab at the top right.

What do you mean? I'm a bit noobish. Big Grin






RE: Is there an entity for "any" - SilentStriker - 04-15-2012

Redshot's way is the easiest way unless you want to have a line of code for each entity which makes it just too much text x)



RE: Is there an entity for "any" - DRedshot - 04-15-2012

Click on the entity, then click on the 'entity' tab at the right. Scroll down untill you find the 'PlayerInteractCallback' box. In this box type 'MonsterAttack'.

Repeat this for all the entities you'd like to use to call the trigger.
(This MonsterAttack callback points to the same piece of code as SetEntityPlayerInteractCallback("entity" , "MonsterAttack" , true); )


RE: Is there an entity for "any" - Theforgot3n1 - 04-15-2012

(04-15-2012, 06:39 PM)DRedshot Wrote: Click on the entity, then click on the 'entity' tab at the right. Scroll down untill you find the 'PlayerInteractCallback' box. In this box type 'MonsterAttack'.

Repeat this for all the entities you'd like to use to call the trigger.
(This MonsterAttack callback points to the same piece of code as SetEntityPlayerInteractCallback("entity" , "MonsterAttack" , true); )
Okidoki. I'll try and attempt doing this later on; right now i have to fix other stuff, since literally nothing is working on my map lol.





RE: Is there an entity for "any" - JetlinerX - 04-16-2012

(04-15-2012, 07:26 PM)Theforgot3n1 Wrote: since literally nothing is working on my map lol.
I feel your pain right now... Sad