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
3 registered members (AndrewAMD, Ayumi, NewbieZorro), 14,141 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
another question:how to judge two objects hit each other? #223378
08/23/08 18:25
08/23/08 18:25
Joined: Aug 2008
Posts: 63
=Strogg=3rd_com_cent.
O
Omicron_NEGA Offline OP
Warez kiddie?
Omicron_NEGA  Offline OP
Warez kiddie?
O

Joined: Aug 2008
Posts: 63
=Strogg=3rd_com_cent.
hi!

i tried trace_hit,but it returns 1 because of the ground.
anyother idea?
and can c_trace work when i enabled the phy system?


P4 3.6GHz x2 8GB RAM DDR2 GeForce8800GTS
Re: another question:how to judge two objects hit each other? [Re: Omicron_NEGA] #229913
10/01/08 14:32
10/01/08 14:32
Joined: Jul 2008
Posts: 27
Italy, Sicilia, Palermo
Azrael85 Offline
Newbie
Azrael85  Offline
Newbie

Joined: Jul 2008
Posts: 27
Italy, Sicilia, Palermo
Code:
if (c_trace(my.x,vector(player.x,player.y,player.z),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) < 500 || c_trace(my.y,vector(player.x,player.y,player.z),IGNORE_ME | IGNORE_PASSABLE | USE_BOX) < 500  )

i use this to detect the distance between an actors and the player wink


Last edited by Azrael85; 10/01/08 14:32.
Re: another question:how to judge two objects hit each other? [Re: Azrael85] #229915
10/01/08 14:34
10/01/08 14:34
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Coisox gave me this a while ago:
Code:
ENTITY* Bullet;
ENTITY* Enemy;

function BeingHit()
{
	switch (event_type)
	{
		case EVENT_ENTITY:
			if (you == Bullet)
			{
				// enemy dead
			}
			return;
	}
}

function main()
{
	//bla.. bla.. bla..
	
	Bullet = ent_create(bla.. bla..);
	Enemy = ent_create(bla.. bla..);
	Enemy.emask |= (ENABLE_ENTITY);
	Enemy.event = BeingHit;
}


Perhaps you can use it..


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<

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