1 registered members (Ayumi),
1,170
guests, and 2
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
How to debug collision detection?
#9589
06/27/02 00:51
06/27/02 00:51
|
Joined: Jul 2000
Posts: 1,570 Windsor, CT 06095
WildCat
OP
Expert
|
OP
Expert
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
|
Hi gang.
I'm having trouble with collision detection.
When I set move mode to "Ignore_you" and fire a bullet, the bullet explodes inside my ship.
It's like it is ignoring the ignore. Can anyone offer some suggestions on how to debug this?
I'm stumpped. I made a real simple level for testing and the ignore works fine.
I put the same code that works in the simple level into my game, and the bullets still explode inside the model.
Maybe there is some parameter on the parent that is set that is messing this up, but I can't find it...
- WildCat
Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
|
|
|
Re: How to debug collision detection?
#9591
06/27/02 05:34
06/27/02 05:34
|
Joined: Jul 2000
Posts: 1,570 Windsor, CT 06095
WildCat
OP
Expert
|
OP
Expert
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
|
I'll give it a shot Doug, but I doubt it. Currenly my event says:
Beep; Remove me;
(!)
Still, I'll do as you suggest and see if that tells me anything meaningful.
Thanks Doug.
- WildCat
Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
|
|
|
Re: How to debug collision detection?
#9592
06/27/02 10:55
06/27/02 10:55
|
Joined: Jul 2000
Posts: 1,570 Windsor, CT 06095
WildCat
OP
Expert
|
OP
Expert
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
|
I should know better than to question the Master... Ok, Doug. You got me. I had a dangerous event alright. Here's the offending code, which is offensive in one script, and works fine in another. (Go figure!) code:
function bullet_event() { beep; remove me; }
var bulletspeed[3] = 20,0,0;
ACTION fire_bullet { my.event = bullet_event; my.enable_entity = on;
while (1) { vec_set(temp,bulletspeed); vec_scale(temp,time); // temp = time corrected bulletspeed move_mode = ignore_you; ent_move(temp,nullvector); wait(1); } } //*****************************************
FUNCTION FIRE_GUN() { IF(MY.SHOT_TIMER > 0){RETURN;} IF(PLAYER_SHIP1 == ME) //PLAYER1 = RED {ENT_CREATE(RED_SHOT_STR,MY.POS,FIRE_BULLET);}
I've since added a wait(1) as the first line of the bullet event, which makes it "undangerous", but the bullet still explodes immediately while inside my ship.
Any thoughts?
- WildCat
Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
|
|
|
Re: How to debug collision detection?
#9594
06/28/02 04:28
06/28/02 04:28
|
Joined: Jul 2000
Posts: 1,570 Windsor, CT 06095
WildCat
OP
Expert
|
OP
Expert
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
|
Hmmm...
You got me thinking... all of my action takes place inside a large hollow, passable sphere. Maybe I'm actually colliding with that.
I know once upon a time, passable objects had no collision detection, but that was before ENT_MOVE...
I'm not at a computer where I can try this, but is the command that I am looking for more like this:
MOVE_MODE = IGNORE_YOU + IGNORE_PASSENTS; ENT_MOVE(TEMP,NULLVECTOR);
Thats something I've not tried before!
- Cautiously Optimistic WildCat
Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
|
|
|
Re: How to debug collision detection?
#9595
06/28/02 07:10
06/28/02 07:10
|
Joined: Jul 2000
Posts: 1,570 Windsor, CT 06095
WildCat
OP
Expert
|
OP
Expert
Joined: Jul 2000
Posts: 1,570
Windsor, CT 06095
|
That did it, Doug!
Thanks for your Gentle guidence.
- Wildcat
Visit us at [url=http://www.vertexgames.com]Vertex Games[/url]!
|
|
|
|