Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
5 registered members (Dico, AndrewAMD, TipmyPip, NewbieZorro, Grant), 15,791 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
unable to detect impact #205915
05/09/08 15:16
05/09/08 15:16
Joined: Jan 2008
Posts: 11
A
AloC83 Offline OP
Newbie
AloC83  Offline OP
Newbie
A

Joined: Jan 2008
Posts: 11
I am making a simple Tank game....

the user fires the main turret by clicking on the left mouse button. when this happens i call a function which creates the shell/bullet entity using ent_create and registers it as a physics entity and gives it an initial velocity. relevant code is given below:

if(mouse_left)
{
turret_fire();
}

function turret_fire()
{
turretfire_snd_handle = ent_playsound(my,turretfire_snd,900);
shell_handle = ent_create("shell.mdl",vector(200,0,20),shell_move);
phent_settype(shell_handle, PH_RIGID, PH_BOX);
phent_addvelcentral(shell_handle,vector(200,0,90));
}

till this point it works fine.....the shell is created and gets the velocity(200,0,90). now i want to detect any collisions that the shell makes. since shell_move is the action associated with the shell, i wrote this piece of code:

action shell_move()
{
my.enable_impact = ON;
my.event = shell_explode;
}

but the function shell_explode() NEVER gets called....even when i can see that the shell collides with another tank.

what am i doing wrong??.....this is the first game that i am making so i am sorry if the mistake is very obvious.....

Re: unable to detect impact [Re: AloC83] #205966
05/09/08 20:33
05/09/08 20:33
Joined: Jan 2008
Posts: 11
A
AloC83 Offline OP
Newbie
AloC83  Offline OP
Newbie
A

Joined: Jan 2008
Posts: 11
okay i got it.........when i use enable_entity instead of enable_impact, it works.

i guess my.enable_impact doesn't work for stationary targets whereas my.enable_entity does.

or atleast that seems to be the only explanation.


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

Gamestudio download | 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