2 registered members (Ayumi, 1 invisible),
584
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: little problem
[Re: mEnTaL]
#285822
08/20/09 11:49
08/20/09 11:49
|
Joined: Jul 2004
Posts: 1,710
MMike
Serious User
|
Serious User
Joined: Jul 2004
Posts: 1,710
|
try this: right on the first line of wall function:
if(is(you,FLAG2)==1){return;}
by the way your gun, and player, must have set(my,FLAG2); to work
Last edited by MMike; 08/20/09 11:53.
|
|
|
Re: little problem
[Re: MMike]
#285832
08/20/09 14:06
08/20/09 14:06
|
Joined: Jul 2009
Posts: 96
mEnTaL
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 96
|
function bullet() { .........
while(me) { c_move(me,vector(40,0,0),nullvector,USE_BOX|IGNORE_MODELS); c_scan(me.x,me.pan,vector(360,0,200),SCAN_ENTS|IGNORE_FLAG2|IGNORE_ME); if (result<5) { if(is(you,FLAG2)==1){return;} ent_remove(me); } wait(1); } }
and also the player and the gun have Flag2 set, but the engine crashes. Can you correct it if you find mistake in the code pls
|
|
|
Re: little problem
[Re: mEnTaL]
#285837
08/20/09 14:45
08/20/09 14:45
|
Joined: Sep 2003
Posts: 5,900 Bielefeld, Germany
Pappenheimer
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
|
You probably have to assure that the 'you' isn't empty.
Other suggestions: - you could start the scan a few moments later, when the bullet already left the gun. - Did you try IGNORE_YOU? Although, it has to reset after leaving the gun. - you could scan from a position ahead the bullet: vec_for_angle(temp, my.pan);//Get a 'direction' from the angle //Now, when the position is one quant ahead the bullet, scale the vector/direction to get the position a few quants more ahead, let's say 10: vec_scale(temp, 10);
|
|
|
Re: little problem
[Re: Pappenheimer]
#285844
08/20/09 16:23
08/20/09 16:23
|
Joined: Jul 2009
Posts: 96
mEnTaL
OP
Junior Member
|
OP
Junior Member
Joined: Jul 2009
Posts: 96
|
I tried all the suggestions: I made check if(you!=NULL) to do the rest I made the bullet start the scanning 10 frames after it's created I put IGNORE_YOU i made the bullet scan 10 quants ahead it but maybe I miss something or do something wrong cuz the engine crashes again. Can you post here the shortest and fastest code for moving entity which destroys itself when hit static entity. Thx
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|