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
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 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 | 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