Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 692 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Mino, squik, AemStones, LucasJoshua, Baklazhan
19061 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How can I make a bullet ? #300308
12/01/09 13:03
12/01/09 13:03
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
A key to my game when I need a code that will be shot at. I have tried but I could not do much. Waiting for your help. Thanks in advance.

Re: How can I make a bullet ? ( I have a code / look here ) [Re: WickWoody] #300316
12/01/09 14:16
12/01/09 14:16
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
I create a action and event for bullet.
Code:
function mermi_event()
{
	if(event_type == ENABLE_IMPACT)
	{
		ent_remove(me);
	}
}

function mermi()
{
	set(my, ENABLE_IMPACT);
	my.event = mermi_event;
	reset(my, PASSABLE);
	my.pan = player.pan + 270;
	my.tilt = player.tilt;
	my.ambient = 100;
	while (1)
	{
		you = player;
		c_move(me, vector(0,60*time_step,0), nullvector,IGNORE_FLAG2+IGNORE_CONTENT+IGNORE_PASSABLE+IGNORE_ME+IGNORE_SPRITES+IGNORE_YOU);
		wait (1);
	}
}



But, event is don't work. Below is picture. Bullet not disappeared.


Last edited by WickWoody; 12/01/09 17:35.
Re: How can I make a bullet ? ( I have a code / look here ) [Re: WickWoody] #300465
12/02/09 16:42
12/02/09 16:42
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
Mach doch bei mermi_event um das If ne while(1) schleife sonst prüft es das nur ein einziges mal!


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: How can I make a bullet ? ( I have a code / look here ) [Re: Liamissimo] #300474
12/02/09 17:20
12/02/09 17:20
Joined: Nov 2009
Posts: 43
Turkiye
M
Machera Offline
Newbie
Machera  Offline
Newbie
M

Joined: Nov 2009
Posts: 43
Turkiye
gamestudio wiki den weapons part 1'e bak ve kendi koduna uydurmaya calis.
link part 1

ayrica; mermin ne olursa olsun carpinca yok olacagina göre;

set(my,ENABLE_IMPACT); yerine, my.emask = ENABLE_IMPACT|ENABLE_ENTITY|ENABLE_BLOCK; de.

mermi_event'in içine
wait(1);
ent_remove(me); yaz.




Last edited by Machera; 12/02/09 17:24.
Re: How can I make a bullet ? ( I have a code / look here ) [Re: Machera] #300697
12/04/09 14:27
12/04/09 14:27
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Thanks but now I have a other problem. If player is closest an object when firing weapon, player is moving to up. My code is below.

On press CTRL key:
Code:
if(key_ctrl == 1)
		{
			my.durum = saldir;
		}
		if(my.durum == saldir)
		{
			hareket_vektoru.x = 5*time_step;
			ent_animate(me, "attack", anim, ANM_CYCLE);
			ent_create("mermi.mdl", vector(me.x+2, me.y+5, me.z+13), mermi);
		}



Bullet's event & action:
Code:
action mermi_event()
{
	wait(1);
	ent_remove(me);
}

action mermi()
{
	my.emask |= ENABLE_IMPACT | ENABLE_BLOCK | ENABLE_ENTITY;
	my.event = mermi_event;
	my.pan = player.pan;
	my.tilt = player.tilt;
	while(1)
	{
		you = player;
		c_move(me, vector(60*time_step, 0, 0), nullvector, IGNORE_ME+IGNORE_YOU);
		wait(1);
	}
}



Edit: I capturing video for this problem. Please wait some.

Last edited by WickWoody; 12/04/09 14:35.
Re: How can I make a bullet ? ( I have a code / look here ) [Re: WickWoody] #300700
12/04/09 14:58
12/04/09 14:58
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
Video is below.
http://rapidshare.com/files/316224241/bulletproblem.wmv
Format: WMV
Size: 5,76 MB
Resolution: 640 x 480

Re: How can I make a bullet ? ( I have a code / look here ) [Re: WickWoody] #300855
12/05/09 22:52
12/05/09 22:52
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline
Member
Erick_Castro  Offline
Member
E

Joined: Mar 2009
Posts: 207
do you want the bullet for the enemy against the player, or create
the bullet from player against the enemy?

Re: How can I make a bullet ? ( I have a code / look here ) [Re: Erick_Castro] #300872
12/06/09 10:13
12/06/09 10:13
Joined: Oct 2009
Posts: 90
WickWoody Offline OP
Junior Member
WickWoody  Offline OP
Junior Member

Joined: Oct 2009
Posts: 90
I create bullet for against enemy. Now I don't have problem for bullet creating but enemy don't detect bullet. I using EVENT_IMPACT but enemy don't detect bullet. I using this code for bullet & enemy:

Code:
ENTITY* mermie;

function enemy_event()
{
if(you == mermie && event_type == EVENT_IMPACT)
{
ent_remove(me);
}
}

action bullet()
{
mermie = me;
..
...
....
}



But, this code don't run.

Re: How can I make a bullet ? ( I have a code / look here ) [Re: WickWoody] #300878
12/06/09 13:39
12/06/09 13:39
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline
Member
Blackchuck  Offline
Member
B

Joined: Jul 2009
Posts: 150
here this musted work;
________________________________________________________________________________

function enemy_event();
function remove_bullets();

action your_player()
{
VECTOR bullet_pos;
.....
if (mouse_left && (total_frames % 24 == 1))
{
vec_for_vertex(bullet_pos, my, ...);
ent_create("....mdl", bullet_pos, move_bullets);
}
......
}
.....

action your_enemy()
{
my.emask = ENABLE_IMPACT | ENABLE_ENTITY;
my.event = enemy_event;
.....
}

function enemy_event()
{
if (you.skill100 != 999999) {return;}
my.event = NULL;
wait (1);
set (my, PASSABLE);
wait (1);
ent_remove(me);
}

action bullet()
{
VECTOR bullet_speed[3];
my.emask = ENABLE_IMPACT | ENABLE_ENTITY | ENABLE_BLOCK;
my.event = remove_bullets;
my.pan = you.pan;
my.tilt = you.tilt;
my.skill100 = 999999;
bullet_speed.x = 35 * time_step;
bullet_speed.y = 0;
bullet_speed.z = 0;
while (my)
{
c_move (my, bullet_speed, nullvector, IGNORE_PASSABLE | IGNORE_YOU);
wait (1);
}
}

function remove_bullets()
{
wait (1);
ent_remove (my);
}
________________________________________________________________________________

Last edited by Blackchuck; 12/06/09 13:48.

I have know Gamestudio/A7 Commercial Edition 7.84
Re: How can I make a bullet ? ( I have a code / look here ) [Re: Blackchuck] #300879
12/06/09 13:53
12/06/09 13:53
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline
Member
Erick_Castro  Offline
Member
E

Joined: Mar 2009
Posts: 207
if you see the bullet go through the enemy without hurt him , you have to write

c_setminmax ( me );

in the enemy action declarations. That adjust the collicion box of the enemy.



Last edited by Erick_Castro; 12/06/09 13:55.
Page 1 of 2 1 2

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