1 registered members (TipmyPip),
18,449
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: free Alien VS Predator radar code
[Re: PHeMoX]
#62264
10/16/06 07:23
10/16/06 07:23
|
Joined: Aug 2005
Posts: 1,558 HK
vlau
Serious User
|
Serious User
Joined: Aug 2005
Posts: 1,558
HK
|
Just a guess : Probably the problem is in your enemy's script, if it is really removed, it should no longer call the g3_handle_radar().
EDIT ---- Maybe the enemy was removed, then it never reach to these lines of code :
pan_temp = ptr_for_handle(my.skill92); pan_remove(pan_temp);
Last edited by vlau; 10/16/06 07:35.
|
|
|
Re: free Alien VS Predator radar code
[Re: Superku]
#62266
10/16/06 19:09
10/16/06 19:09
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
Aaargh, this is confusing. You are right, it should work, but it doesn't.  I keep having a panel on the radar visible, and it'll simply stop moving, frozen in place. It must be some sort of pointer problem. I'm only calling the g3_radar code once at the start of the enemy's funktion, off course outside of his while loop. Edit: The distance to the player is still within the range, doesn't that cause the problem and make it still create a new panel for the radar? Code:
function g3_handle_radar { while(!playerrr){wait(1);} while(me) { if(vec_dist(my.x,playerrr.x) < make_scan.z) { pan_temp = pan_create("bmap = bmp_radar_enemy; flags = visible,refresh,filter;",101); my.skill92 = handle(pan_temp); while(vec_dist(my.x,playerrr.x) < make_scan.z) { pan_temp = ptr_for_handle(my.skill92); vec_set(temp,playerrr.x); vec_sub(temp,my.x); vec_to_angle(my.skill97,temp); my.skill98 = vec_dist(my.x,playerrr.x); //was camera pan_temp.scale_x = 0.50-my.skill98/(make_scan.z*2); //1.5 pan_temp.scale_y = pan_temp.scale_x; pan_temp.pos_x = rader.pos_x+80-my.skill98/(make_scan.z*1.2/100)*sin //pos_x+96 -> nu 85 , 75 (camera.pan-my.skill97)-16*pan_temp.scale_x; pan_temp.pos_y = rader.pos_y+70+my.skill98/(make_scan.z*1.2/100)*cos
(camera.pan-my.skill97)-16*pan_temp.scale_x; //solving bug problem // //dots appear at the edges .. fixed ni // if(pan_temp.pos_x - rader.pos_x < 25){break;} if(pan_temp.pos_y - rader.pos_y < 25){break;} if(pan_temp.pos_x - rader.pos_x > 100){break;} if(pan_temp.pos_y - rader.pos_y > 100){break;} //if(me==null){beep; pan_temp.visible = off;break;} wait(1); } pan_temp = ptr_for_handle(my.skill92); pan_remove(pan_temp); } my.skill92 = 0; wait(1); } if(my.skill92==0){beep;return;} wait(1); }
This doesn't beep when my enemy is dead and removed strangely enough. It should beep, right? Cheers
Last edited by PHeMoX; 10/16/06 20:23.
|
|
|
Re: free Alien VS Predator radar code
[Re: Superku]
#62268
10/17/06 16:53
10/17/06 16:53
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
Code:
function g3_handle_radar { while(!playerrr){wait(1);} while(me) { if(vec_dist(my.x,playerrr.x) < make_scan.z) { pan_temp = pan_create("bmap = bmp_radar_enemy; flags = visible,refresh,filter;",101); my.skill92 = handle(pan_temp); while(vec_dist(my.x,playerrr.x) < make_scan.z) { pan_temp = ptr_for_handle(my.skill92); vec_set(temp,playerrr.x); vec_sub(temp,my.x); vec_to_angle(my.skill97,temp); my.skill98 = vec_dist(my.x,playerrr.x); //was camera pan_temp.scale_x = 0.50-my.skill98/(make_scan.z*2); //1.5 pan_temp.scale_y = pan_temp.scale_x; pan_temp.pos_x = rader.pos_x+80-my.skill98/(make_scan.z*1.2/100)*sin //pos_x+96 -> nu 85 , 75 (camera.pan-my.skill97)-16*pan_temp.scale_x; pan_temp.pos_y = rader.pos_y+70+my.skill98/(make_scan.z*1.2/100)*cos
(camera.pan-my.skill97)-16*pan_temp.scale_x; //solving bug problem // //dots appear at the edges .. fixed ni // if(pan_temp.pos_x - rader.pos_x < 25){break;} if(pan_temp.pos_y - rader.pos_y < 25){break;} if(pan_temp.pos_x - rader.pos_x > 100){break;} if(pan_temp.pos_y - rader.pos_y > 100){break;} //if(me==null){beep; pan_temp.visible = off;break;} wait(1); } pan_temp = ptr_for_handle(my.skill92); pan_remove(pan_temp); my.skill92 = 0; } wait(1); } if(my.skill92!=0){beep;return;} //wait(1); } This is my code now, still doesn't work, but also doesn't beep  Perhaps this is an engine bug off some sort? Code-wise, this should work, however the radar dot of the enemy keeps freezing in place after I shot him, but there's no beep, eventhough the panel is still 'visible'. Cheers
Last edited by PHeMoX; 10/17/06 16:59.
|
|
|
Re: free Alien VS Predator radar code
[Re: PHeMoX]
#62269
10/17/06 17:17
10/17/06 17:17
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Here is a workaround (ignore my version of the radar code):
function g3_handle_radar { my.skill99 = 1; while(player == null) { wait(1); } while(me && my.skill99 ) { if(vec_dist(my.x,player.x) < 3100) { if(my.hv_team == 1) { pan_temp = pan_create("bmap = bmp_radar_friend; flags = visible,refresh,filter;",4); } else { pan_temp = pan_create("bmap = bmp_radar_enemy; flags = visible,refresh,filter;",4); } my.skill92 = handle(pan_temp); while(vec_dist(my.x,player.x) < 3100 && my.skill99 ) { pan_temp = ptr_for_handle(my.skill92); vec_set(temp,player.x); vec_sub(temp,my.x); vec_to_angle(my.skill97,temp); my.skill98 = bmap_width(bmp_radar)/192*vec_dist(my.x,player.x); // because the code was for 192pixel radar pan_temp.scale_x = 0.85-vec_dist(my.x,player.x)/(4500); pan_temp.scale_y = pan_temp.scale_x; pan_temp.pos_x = panel_radar.pos_x+bmap_width(bmp_radar)/2-my.skill98/(36)*sin(player.pan-my.skill97)-16*pan_temp.scale_x; pan_temp.pos_y = panel_radar.pos_y+bmap_height(bmp_radar)/2+my.skill98/(36)*cos(player.pan-my.skill97)-16*pan_temp.scale_x; wait(1); } pan_temp = ptr_for_handle(my.skill92); pan_remove(pan_temp); my.skill92 = 0; } wait(1); } if(my.skill92 != 0) { pan_temp = ptr_for_handle(my.skill92); pan_remove(pan_temp); } }
and when your enemy dies:
my.skill99 = 0; wait(1); ent_remove(me);
Felix
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: free Alien VS Predator radar code
[Re: Superku]
#62270
10/17/06 18:43
10/17/06 18:43
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
The workaround works great! Thanks man, I owe you one (or two, or three hehehe). Thanks for looking into this for me, Still, I don't quite understand why your first solution didn't work. A well, a 5 star rating well deserved.  Cheers
Last edited by PHeMoX; 10/17/06 18:44.
|
|
|
|