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
Is there an entity for "any"
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#1
Is there an entity for "any"

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.

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
(This post was last modified: 08-06-2012, 03:52 AM by Theforgot3n1.)
04-15-2012, 05:48 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: Is there an entity for "any"

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

04-15-2012, 05:49 PM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#3
RE: Is there an entity for "any"

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



Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
04-15-2012, 06:02 PM
Website Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#4
RE: Is there an entity for "any"

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 post was last modified: 04-15-2012, 06:26 PM by DRedshot.)
04-15-2012, 06:21 PM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#5
RE: Is there an entity for "any"

(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




Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
04-15-2012, 06:35 PM
Website Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: Is there an entity for "any"

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)

04-15-2012, 06:36 PM
Find
DRedshot Offline
Senior Member

Posts: 374
Threads: 23
Joined: Jun 2011
Reputation: 11
#7
RE: Is there an entity for "any"

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

(This post was last modified: 04-15-2012, 06:39 PM by DRedshot.)
04-15-2012, 06:39 PM
Find
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#8
RE: Is there an entity for "any"

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



Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
04-15-2012, 07:26 PM
Website Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#9
RE: Is there an entity for "any"

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

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

04-16-2012, 03:01 AM
Website Find




Users browsing this thread: 1 Guest(s)