Frictional Games Forum (read-only)

Full Version: Is there an entity for "any"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
So what you want is when the player interacts with something in the room the grunt attacks?
(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.


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



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


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