2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: free Alien VS Predator radar code
[Re: keinPlan86m]
#62254
01/20/06 13:57
01/20/06 13:57
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
OP
Senior Expert
|
OP
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Oh sorry, updated (relative to the player, not to the camera | bmap size) : Code:
function g3_handle_radar { while(player == null) { wait(1); } while(me) { if(vec_dist(my.x,player.x) < make_scan.z) { 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) < make_scan.z) { 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)/(make_scan.z*1.5); pan_temp.scale_y = pan_temp.scale_x; pan_temp.pos_x = panel_radar.pos_x+bmap_width(bmp_radar)/2-my.skill98/(make_scan.z*1.2/100)*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/(make_scan.z*1.2/100)*cos(player.pan-my.skill97)-16*pan_temp.scale_x; wait(1); } pan_temp = ptr_for_handle(my.skill92); pan_remove(pan_temp); } wait(1); } } gOmO_3
Last edited by gOmO_3; 01/20/06 14:09.
"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]
#62258
04/15/06 07:32
04/15/06 07:32
|
Joined: Aug 2002
Posts: 572 Toronto
MadMark
User
|
User
Joined: Aug 2002
Posts: 572
Toronto
|
What does "and assign "g3_handle_radar" to your actions. " mean? Am I supposed to add "my.action = g3_handle_radar();" to my player's list of attributes?
How do I assign this function to something, and would that something be a player or an enemey or other?
Sorry, I'm struggling with programming.
Mark
People who live in glass houses shouldn't vacuum naked.
|
|
|
Re: free Alien VS Predator radar code
[Re: Superku]
#62260
04/16/06 02:12
04/16/06 02:12
|
Joined: Aug 2002
Posts: 572 Toronto
MadMark
User
|
User
Joined: Aug 2002
Posts: 572
Toronto
|
So, if I had an auto enemy creation function, and an enemy move function, I should place it ABOVE the while function in the move function as you have shown?
Not in the actual while loop?
Cheers! Mark
People who live in glass houses shouldn't vacuum naked.
|
|
|
Re: free Alien VS Predator radar code
[Re: Superku]
#62261
08/29/06 17:12
08/29/06 17:12
|
Joined: Jun 2005
Posts: 656
Grafton
User
|
User
Joined: Jun 2005
Posts: 656
|
Does anyone know where the 1.2/100 figure comes from in the calculation of the position of the temp panel? Code:
pan_temp.pos_x = panel_radar.pos_x+bmap_width(bmp_radar)/2-my.skill98/(make_scan.z*1.2/100)*sin(player.pan-my.skill97)-16*pan_temp.scale_x;
I understand this scales the radars range, but where did this number come from? What is it relevent to?
Not two, not one.
|
|
|
Re: free Alien VS Predator radar code
[Re: Grafton]
#62262
10/13/06 01:14
10/13/06 01:14
|
Joined: Sep 2002
Posts: 8,177 Netherlands
PHeMoX
Senior Expert
|
Senior Expert
Joined: Sep 2002
Posts: 8,177
Netherlands
|
I know this is a terrible old thread, however I'm using this contribution and ran into a problem. I run the g3_handle_radar(); funktion in my enemies funktion, everything is fine.
However, at one point the enemy dies and get's removed. Panel creation of the radar script stops, but it leaves a fixed radar blip at the spot (on the radar) where the enemy died. So I was thinking, this panel didn't get removed at all.
What's wrong?
Summary; -code works fine, when enemy that started the code isn't removed by ent_remove(me); -radar blip continues to be visible after enemies death, but doesn't get updated on his position (which is zero, he's death after all). -How can I really stop this funktion when the enemy who started the radar code is removed?
Cheers
|
|
|
|