|
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
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2007
Posts: 69
|
//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: Joozey]
#218707
07/30/08 02:10
07/30/08 02:10
|
Joined: Dec 2005
Posts: 116
tD_Datura_v
Member
|
Member
Joined: Dec 2005
Posts: 116
|
Follow Joozey's instructions. Ignore the following:
//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
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2007
Posts: 69
|
dobidob hosein_dig and max_man7000 game HAPPY NEW YEAR !!
|
|
|
|