Frictional Games Forum

Full Version: GetEntitiesCollide
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Does GetEntitiesCollide not support detecting whether a player is within a script area or not? Because for some reason this function is returning false for me even if I know that it should be true.

For example, the code
PHP Code:
void OnStart(){

    
loop("TestTimer");
}

void loop(stringTimer){

    
int test;
    if(
GetEntitiesCollide("Player","ScriptArea_1")) test 1;
    else 
test 2;
        
    
AddDebugMessage(""+testfalse);
    
    
AddTimer(Timer,1,"loop");

always displays "2", even if the script area covers the entire level.
I tried to use GetEntitiesCollide with the player and an area, experimenting in every possible way, only to find out that the bool just doesn't work when used with the player. It was a huge let-down and i wasted lots of time on it.

Basically I first tried with "player" and "area", until I replaced "player" with "an entity" and the bool reacted correctly.
"Player" is only considered (supported) for the other collision detection functions.
;_; haha I wish that bit of information was listed in the wiki, it would saved me a bit of a headache.
Actually, Your Computer: You can spare yourself maybe 10-20 similar future questions, but editing the wiki instead of replying to forum posts that will be forgotten the next week. I personally know how overwhelming wiki editing can be - I'm just saying that as long as you have your amazing enthusiasm to help out, that's where you'd do the most good.
I would edit it myself but as far as I know regular users can't edit it (or at least certain sections of it, such as the "Engine Scripts" section). (Though correct me if I'm wrong and I'll gladly do it. Tongue)

haha And ideally one would edit the wiki AND reply to said forum post. Wink
(05-06-2012, 01:14 AM)Cranky Old Man Wrote: [ -> ]Actually, Your Computer: You can spare yourself maybe 10-20 similar future questions, but editing the wiki instead of replying to forum posts that will be forgotten the next week. I personally know how overwhelming wiki editing can be - I'm just saying that as long as you have your amazing enthusiasm to help out, that's where you'd do the most good.

I only like editing articles that i created, since i like to use the plain text editor of the Wiki (therefore i know i won't mess up the article by attempting to edit it). The WYSIWYG editor of the wiki (as any WYSIWYG editor) tends to mess things up and makes it more difficult to edit using the source editor. If it didn't save changes as you're switching to the source editor, then i would consider editing the Wiki articles more. Until then, long articles will remain unedited by me.

@Homicide13 All you need is a Wiki account. The whole purpose of a wiki is for community contributions.
(05-06-2012, 02:16 AM)Your Computer Wrote: [ -> ]@Homicide13 All you need is a Wiki account. The whole purpose of a wiki is for community contributions.
Ah, I was under the impression that certain articles were off limits because of how important they are.

Time to edit all the things... ;d
Try

GetEntitiesCollide("PlayerHands", "ScriptArea");

or

PlayerHands_lantern
(05-06-2012, 08:46 AM)palistov Wrote: [ -> ]Try

GetEntitiesCollide("PlayerHands", "ScriptArea");

or

PlayerHands_lantern
;D The real question I have is how you figured out those objects existed, though if I had to guess I would probably say you just snooped around in the main game scripts. haha

But thanks, that's certainly helpful.
Pages: 1 2