Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 1,103 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 2 of 4 1 2 3 4
Re: free Alien VS Predator radar code [Re: PHeMoX] #62253
01/20/06 10:17
01/20/06 10:17
Joined: Feb 2003
Posts: 320
Vieselbach (bei Erfurt)
keinPlan86m Offline
Senior Member
keinPlan86m  Offline
Senior Member

Joined: Feb 2003
Posts: 320
Vieselbach (bei Erfurt)
"
pan_temp = pan_create("bmap = bmp_radar_enemy; flags = visible,refresh,filter;",4); my.skill92 = handle(pan_temp);
"


Thats it! I don't get this part ready! I thougt about something like exactly this, but i had no idea how to name the panels and let them be controlled by the units!

Greate contribution! Thanks!


"Wenn Wahlen etwas ändern würden, dann währen sie schon längst verboten!" Mein Projekt: Space - The Last Frontier http://www.space-the-last-frontier.de.vu
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 Offline OP
Senior Expert
Superku  Offline 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] #62255
01/27/06 22:28
01/27/06 22:28
Joined: Apr 2005
Posts: 1,058
Luzern
Nicolas_B Offline
Serious User
Nicolas_B  Offline
Serious User

Joined: Apr 2005
Posts: 1,058
Luzern
hey gOmO_3,

veri nice work and thanks.

gg Nicolas_B

Re: free Alien VS Predator radar code [Re: Nicolas_B] #62256
01/29/06 10:00
01/29/06 10:00
Joined: Jul 2003
Posts: 893
Melbourne, Australia
Matt_Coles Offline

User
Matt_Coles  Offline

User

Joined: Jul 2003
Posts: 893
Melbourne, Australia
very nice contribution

Re: free Alien VS Predator radar code [Re: Matt_Coles] #62257
01/29/06 15:36
01/29/06 15:36
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thanks.

gOmO_3


"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 Offline
User
MadMark  Offline
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: MadMark] #62259
04/15/06 19:29
04/15/06 19:29
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You have to call two functions:
init_radar(); // only once, for example in your main function
and "g3_handle_radar" in the enemy's action:

action evil_enemy {
//....
g3_handle_radar(); // this functions creates an individual dot on the radar and must be called for every entity that should be visible in the radar
while(1) { ....

gOmO_3


"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] #62260
04/16/06 02:12
04/16/06 02:12
Joined: Aug 2002
Posts: 572
Toronto
MadMark Offline
User
MadMark  Offline
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
G
Grafton Offline
User
Grafton  Offline
User
G

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 Offline
Senior Expert
PHeMoX  Offline
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


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Page 2 of 4 1 2 3 4

Moderated by  adoado, checkbutton, mk_1, Perro 

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