Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
1 registered members (henrybane), 1,499 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19054 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 3
Page 1 of 4 1 2 3 4
free Alien VS Predator radar code #62243
01/18/06 14:09
01/18/06 14:09
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)
Hello.
A simple contribution :

short video
Download !

It works well for 'unlimited' (radar) objects using pan_create.
Have fun !

gOmO_3

EDIT :
Adjust the radar's range by changing the make_scan.z value :
function init_radar {
panel_radar.visible = on;
make_scan.z = 2000; // radar's range
panel_radar.pos_y = screen_size.y-198;
shadow_threshold = 30;
}

If you wanted constant radar elements, you should use this code :
Code:
 ///////////////////////////////////////////////////////////////////////////////////
// Radar code for unlimited objects
// by Felix Pohl aka gOmO_3 | 2006
// no credit required, though I would be grateful
// how to use : call "init_radar" once (for example in
// your main function) and assign "g3_handle_radar" to
// your actions. don't forget to include this wdl !
// Predator model : Kai Kieschnick (soulreaver2@gmx.de)
////////////////////////////////////////////////////////////////////////////

entity* ent_temp;

var make_scan;

bmap bmp_radar = <radar.tga>;
bmap bmp_radar_enemy = <enemy.tga>;

font fnt_dist = "Porky's",1,40;

panel panel_radar {
pos_x = 32;
pos_y = 570;
bmap = bmp_radar;
flags = refresh;
layer = 2;
}

panel* pan_temp;

function init_radar {
panel_radar.visible = on;
make_scan.z = 2000; // radar's range
panel_radar.pos_y = screen_size.y-198;
shadow_threshold = 30;
}

function g3_handle_radar {
while(me) {
if(vec_dist(my.x,camera.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,camera.x) < make_scan.z) {
pan_temp = ptr_for_handle(my.skill92);
vec_set(temp,camera.x);
vec_sub(temp,my.x);
vec_to_angle(my.skill97,temp);
my.skill98 = vec_dist(my.x,camera.x);
pan_temp.scale_x = 0.85-my.skill98/(make_scan.z*1.5);
pan_temp.scale_y = pan_temp.scale_x;
pan_temp.pos_x = panel_radar.pos_x+96-my.skill98/(make_scan.z*1.2/100)*sin(camera.pan-my.skill97)-16*pan_temp.scale_x;
pan_temp.pos_y = panel_radar.pos_y+96+my.skill98/(make_scan.z*1.2/100)*cos(camera.pan-my.skill97)-16*pan_temp.scale_x;
wait(1);
}
pan_temp = ptr_for_handle(my.skill92);
pan_remove(pan_temp);
}
wait(1);
}
}




Last edited by gOmO_3; 01/18/06 14:19.

"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] #62244
01/18/06 19:51
01/18/06 19:51
Joined: Jul 2002
Posts: 5,181
Austria
Blattsalat Offline
Senior Expert
Blattsalat  Offline
Senior Expert

Joined: Jul 2002
Posts: 5,181
Austria
loved that in the movies! one of the best radars i know

thanks and cheers


Models, Textures and Levels at:
http://www.blattsalat.com/
portfolio:
http://showcase.blattsalat.com/
Re: free Alien VS Predator radar code [Re: Superku] #62245
01/18/06 22:11
01/18/06 22:11
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
Thank you, gOmO_3!
good contrib, but have to look at code deeply (demo not functioning properly for me /A6_comm_3.14/, do you use 6.40 update ?)

Re: free Alien VS Predator radar code [Re: Lion_Ts] #62246
01/19/06 00:10
01/19/06 00:10
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
A great contribution definately credits worthy thanks!
By the way, does anyone have some tips concerning a 'level radar' ? My plan is to make a radar on which also lines are visible from buildings (most probably they are models too, but I only want an outline), I remember I must have got some code which will draw a the boundary box lines, so it must be possible somehow.. I want to keep it simple though, anyone some suggestions for this?

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: free Alien VS Predator radar code [Re: PHeMoX] #62247
01/19/06 01:00
01/19/06 01:00
Joined: Jan 2003
Posts: 1,142
California
Daedelus Offline
Senior Developer
Daedelus  Offline
Senior Developer

Joined: Jan 2003
Posts: 1,142
California
@Gomo_3: Awesome job!
@Phemox: I don't know how the lines would be drawn like you want 'em, but have you looked at Locoweed's Minimap/radar scripts?
Maybe the minimap would be a good start for this?
http://www.thekidgame.com/Locoweed3DGS/misc.htm


Formula Games - A place to buy and sell Indie games.
Re: free Alien VS Predator radar code [Re: Daedelus] #62248
01/19/06 01:20
01/19/06 01:20
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
This radar code is great, I've changed somethings so it works as a regular radar, usable in my top-down game (i mean, camera indepent, player dependent, just changed 3 words in the code ) and it works great, I'm using A6.4 com btw...

@Daedelus: Thanks for the link to Locoweed's site, I think that his radar code will be pretty useful indeed for what I had in mind, thanks. I've also seen some other interesting topics there, like a simple AI example, I'm going to check those out asap...

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: free Alien VS Predator radar code [Re: Lion_Ts] #62249
01/19/06 14:31
01/19/06 14:31
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 to everyone.
@Lion_Ts : I'm using the 6.40 Update but it should work with 6.314, too. The only new functions I have used are pan_create and panel.scale_x which have been available since 6.3. What is the error message ?

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] #62250
01/19/06 17:30
01/19/06 17:30
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Mmm, after some fiddling with this code, and changing it for my needs, there's something strange happening. At the edges of my radar, when the enemies are just getting in range (or just out of range) the dots get like twice the size, instead of being really small, or invisible. Anyone have an idea why this happens? Like I said in one of my previous posts, only things I've changed is camera.x into player.x, wherever the camera was involved. It must be the math when certain values get past some range, it's kinda confusing, because it's working fine, except this size blow-up when they are at the range area of the radar...
Code:

_____________
|O . . |
| * |
| * * * |
| . . |
|O_____O_____|



The zeros are my 'problem' , I want them either invisible, or super small sized, not twice the normal size ...

EDIT: Nevermind, I've got it solved ... I've just added ;
Code:
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;}




Cheers

Last edited by PHeMoX; 01/19/06 18:08.

PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: free Alien VS Predator radar code [Re: PHeMoX] #62251
01/19/06 22:43
01/19/06 22:43
Joined: Aug 2005
Posts: 1,185
Ukraine
Lion_Ts Offline
Serious User
Lion_Ts  Offline
Serious User

Joined: Aug 2005
Posts: 1,185
Ukraine
gOmO_3,
hero in downloaded demo flies up, marks on radar not at the 'real' places (all at radar bottom). but nevermind. i think your code is good (for 6.4), i'll try to look closer at it (for my old 6.314 ), when have free time. thank you for contribution

Re: free Alien VS Predator radar code [Re: Lion_Ts] #62252
01/20/06 00:20
01/20/06 00:20
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline
Senior Expert
PHeMoX  Offline
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
How big is your radar panel? You might have to adjust certain values. The 96 in 'radar.pos_x+96' and radar.pos_y+96' has to be your panels size/2, to get the dots in the middle of your radar panel. Do you use the radar for a first person shooter? Because the way it's originally coded is for a radar dependent on the camera, not the player.

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Page 1 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