Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by vicknick. 06/13/24 08:51
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,209 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19059 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Door swinging open #236416
11/14/08 04:06
11/14/08 04:06
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
When a door is opening or closing (the door is a map entity), how can I detect that the door hits the player (FPG)? The player is not moving, the map entity (door) is moving.
What flags need to be set or what method should I use to detect this collision?
Thanks for your help
Gerrit

Re: Door swinging open [Re: Gerrit] #236417
11/14/08 04:25
11/14/08 04:25
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
is the door rotating via c_rotate?

If so, use event_entity.


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: Door swinging open [Re: heinekenbottle] #236421
11/14/08 05:58
11/14/08 05:58
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
I tried it with my.pan and with c_rotate. I will check the event_entity
Thanks for the tip
Gerrit

Re: Door swinging open [Re: Gerrit] #236566
11/14/08 21:59
11/14/08 21:59
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
I am using c_rotate for the door, and I set the following in the action for the door (map entity):
my.emask = (ENABLE_BLOCK | ENABLE_ENTITY | ENABLE_TRIGGER);
I also created an event and added this in the door action:
my.event=door_event;
but when the door hits the player (who is NOT moving) the event is not triggered.

Re: Door swinging open [Re: Gerrit] #236573
11/14/08 23:00
11/14/08 23:00
Joined: Jan 2004
Posts: 3,023
The Netherlands
Helghast Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
can try vec_dist as well, and see in a loop if the player is close enough.
if so, open door...

regards,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: Door swinging open [Re: Helghast] #236581
11/14/08 23:42
11/14/08 23:42
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
The issue is not that I can't open the door, the problem I try to solve is that when the door opens it passes right through the player. I cannot detect the collision. I move the door with c_rotate. When the player moves then I do get a collision but when the player stands still I don't.
Gerrit

Re: Door swinging open [Re: Gerrit] #236597
11/15/08 03:38
11/15/08 03:38
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
show us the c_rotate line your using for the door


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Door swinging open [Re: EvilSOB] #236599
11/15/08 04:40
11/15/08 04:40
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
This is yhr c_rotate line

c_rotate (me, vector(direction*10*time_step,0,0), 0 );

Thanks for helping
Gerrit

Re: Door swinging open [Re: Gerrit] #236608
11/15/08 07:41
11/15/08 07:41
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
OK, thats cool. I just wanted to check the collision_flags(mode).

Now lets see the "door_event" function you created please.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Door swinging open [Re: EvilSOB] #236659
11/15/08 16:57
11/15/08 16:57
Joined: Sep 2005
Posts: 75
CA, Orange County
Gerrit Offline OP
Junior Member
Gerrit  Offline OP
Junior Member

Joined: Sep 2005
Posts: 75
CA, Orange County
There really is nothing in the event yet except for the beep() that would indicte that the program gets there. But it doesn't so the event is never executed....

Thanks for your help
Gerrit


function door_event() // event is triggered when
{
beep();
energy-=10;
switch (event_type)
{
case EVENT_BLOCK:
// ent_playsound(my,whamm,50);
// vec_to_angle(my.pan,bounce); // change direction
return;
case EVENT_ENTITY:
// energy-= 10;
// ent_playsound(my,boingg,50); // play a different sound
// vec_to_angle(my.pan,my_location); // change direction
return;
case EVENT_TRIGGER:
return;
}
}

Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1