Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
0 registered members (), 631 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | 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