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
1 registered members (TipmyPip), 18,618 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
How to fire an object? #246468
01/15/09 11:38
01/15/09 11:38
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
Hey
Sorry about all the questions lol. I do use the search function before i ask a question to see if it has been answered before. But it tends to pick up every thread across the entire forum that contains the word "shoot"... which is quiet a few heh smile

I just have a simple question regarding shooting. I know that on_click activates the left mouse button. I am just wondering-
a) how to use left OR right click to fire
b) how to actually create a projectile from the middle of my tank (or any vehicle)

laugh


HURRR DERP DERP DEERRPP HURR
Re: How to fire an object? [Re: pewpew] #246470
01/15/09 11:43
01/15/09 11:43
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
if(mouse_left == 1) or if(mouse_right == 1)

if(shoot)
{
bullet = ent_create("model.mdl", vector_pos, action_bullet);
vec_set(bullet.pan, tank.pan);
}

*action_bullet actually moves the bullet..ofc smile



Ubi bene, ibi Patria.
Re: How to fire an object? [Re: pewpew] #246609
01/15/09 21:04
01/15/09 21:04
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Also, I'd use flag2 on the bullet and the player tank so that the bullet ignores the tank.


I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: How to fire an object? [Re: heinekenbottle] #246634
01/15/09 23:01
01/15/09 23:01
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
awesome thanks again laugh laugh laugh


HURRR DERP DERP DEERRPP HURR
Re: How to fire an object? [Re: pewpew] #246767
01/17/09 01:10
01/17/09 01:10
Joined: Oct 2008
Posts: 67
pewpew Offline OP
Junior Member
pewpew  Offline OP
Junior Member

Joined: Oct 2008
Posts: 67
how do you make the bullets remove-on-impact?
the help menu says to use:

Code:
	me.emask |= ENABLE_IMPACT;
	me.event = game_bullet_collide;


then to have another function where:

Code:
function game_bullet_collide()
{
	if(event_type == EVENT_IMPACT)
	{
		ent_remove(me);
	}
}


doesnt seem to make bullets asplode frown


HURRR DERP DERP DEERRPP HURR

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