Gamestudio Links
Zorro Links
Newest Posts
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,459 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
my bullet do not removed after impact ? why ? #218678
07/29/08 20:59
07/29/08 20:59
Joined: Jul 2007
Posts: 69
fat32 Offline OP
Junior Member
fat32  Offline OP
Junior Member

Joined: Jul 2007
Posts: 69
Code:
//my bullet do not removed after impact .and cause ent limit error
action gun_barrel_act{
	gun_barrel_ent=me;

	my.passable=on;
	my.pan=180;
	while(1){
		wait(1);
		if(mouse_left){ent_create("bullet.mdl",my.pos,move_bullet_func);wait(5);
		}
	}
}

function move_bullet_func{

	my.pan=you.pan;
	my.roll=you.roll;
	my.tilt=you.tilt;
	
	my.skill40=100;
	my.ENABLE_IMPACT=on;
	my.event=impact_func;
	while(mouse_left){
		WAIT(1);
		
		ent_move(my.skill40,nullvector);
		my.skill40+=20;	//speed bullet
	}
}

function impact_func{
	var pos_tmp;
	var pan_tmp;
	var roll_tmp;
	var tilt_tmp;
	vec_set(pos_tmp,my.pos);
	ent_remove(me);
	
	if(event_type==event_impact){
		wait(1);
		vec_scale(normal,10); // produce an explosion into the normal direction
		effect(effect_explo,50,pos_tmp.x,normal);	
	}
}



dobidob hosein_dig and max_man7000 game

HAPPY NEW YEAR !!
Re: my bullet do not removed after impact ? why ? [Re: fat32] #218698
07/30/08 00:13
07/30/08 00:13
Joined: Oct 2004
Posts: 4,134
Netherlands
Joozey Offline
Expert
Joozey  Offline
Expert

Joined: Oct 2004
Posts: 4,134
Netherlands
wait(1);
if(mouse_left){ent_create("bullet.mdl",my.pos,move_bullet_func);wait(5);
}

You know what this does? It creates a bullet every 5 ticks, and those are alot of bullets in one second. More than your current entity limit (max_entities) which causes that error.

And you should declare your functions with parantheses behind them:
function blabla() {
}

Probably doesn't solve your non-removing bullets problem, but fix this first.


Click and join the 3dgs irc community!
Room: #3dgs
Re: my bullet do not removed after impact ? why ? [Re: Joozey] #218707
07/30/08 02:10
07/30/08 02:10
Joined: Dec 2005
Posts: 116
T
tD_Datura_v Offline
Member
tD_Datura_v  Offline
Member
T

Joined: Dec 2005
Posts: 116

Follow Joozey's instructions.

Ignore the following:

Code:
//my bullet do not removed after impact .and cause ent limit error

define _hit, flag7;
define _sp, skill40;
define _normal, skill50;
define _tm1, skill69;
define _reloadTm, skill70;

function wpf_bullet1();
function wpf_bulletEvent();

STRING md_bullet1 = "bullet.mdl";
ENTITY* wp_eBarrel;
action gun_barrel_act {
	wp_eBarrel = me;
	my.passable=on;
	my.pan=180;
	my._reloadTm = 16 * 1.5;
	while(me != NULL){
		if (my._tm1 <= 0) {
			if (mouse_left) {
				my._tm1 = my._reloadTm;
				ent_create(md_bullet1, my.x, wpf_bullet1);
			}
		}
		wait(1);
	}
}

function wpf_bulletEvent() {
	if(event_type == event_impact
	|| event_type == event_entity){
		my.event = NULL;
		my._hit = on;
		vec_set(my._normal, normal);
	}
}
function wpf_bullet1() {
	vec_set(my.pan, you.pan);
	my._sp = 100;
	my.ENABLE_IMPACT=on;
	my.event = wpf_bulletEvent;
	while(me != NULL) {
		if (my._hit == ON) {
			break;
		}
		ent_move(my._sp, nullvector);
		my._sp += 20 * time; //speed bullet
		wait(1);
	}
	if (my._hit == ON) {
		vec_scale(my._normal ,10);  // produce an explosion into the normal direction
		effect(effect_explo, 50, my.x, my._normal);	
	}
	ent_remove(me);
}


Re: my bullet do not removed after impact ? why ? [Re: Joozey] #218802
07/30/08 16:52
07/30/08 16:52
Joined: Jul 2007
Posts: 69
fat32 Offline OP
Junior Member
fat32  Offline OP
Junior Member

Joined: Jul 2007
Posts: 69
YES NOT MY SOLVE


dobidob hosein_dig and max_man7000 game

HAPPY NEW YEAR !!

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