Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Working Lite_c radar #458727
03/27/16 01:03
03/27/16 01:03
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
I've been searching a long time for a working radar in lite_c
a radar that shows the player in the middle and all the enemy entities as red dots.

I found some in the old forum but there wdl and the stuff in this forum
has radar topics but none get fully answered or shows one that reallt works laugh

So if some one could provide a working example we will be more the happy with it for sure laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Working Lite_c radar [Re: Realspawn] #458728
03/27/16 05:44
03/27/16 05:44
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
It shouldn't be hard to implement it. Here's an idea:

decide how far you're gonna display enemies (for example 1000 quants). Put an image and for every enemy that is closer than 1000 quants to the player pan_create a dot (save the pointer in an enemy skill, so you can move the pan) and have a function that checks the enemy position, subtracts that position and scales by a factor to fit on your radar image on the screen. When you subtract, if the enemy is (for example) behind the player, you get negative X and the dot will move in the negative direction. The only trouble is that, you have to center this position on the center of your radar...
If you want it rotating with your player, you'll have to multiply the final screen position with cos and sin player pan.
By the way, no need to convert in any way the X/Y of the radar, because you're already using X and Y in world coordinates, I think.

And that's it laugh no math at all.

Re: Working Lite_c radar [Re: EpsiloN] #458730
03/27/16 14:39
03/27/16 14:39
Joined: Dec 2011
Posts: 1,823
Netherlands
Reconnoiter Offline
Serious User
Reconnoiter  Offline
Serious User

Joined: Dec 2011
Posts: 1,823
Netherlands
Similar to a minimap but than relative to the player's position.

Or you can e.g. use a VIEW for it use the NOFLAGs for you radar view and camera view to show & hide what you want on them.

Last edited by Reconnoiter; 03/27/16 14:39.
Re: Working Lite_c radar [Re: Reconnoiter] #458731
03/27/16 22:16
03/27/16 22:16
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
All good plans yet still i lack the skills to master this
i will keep trying but hope to figure it out soon as it is
the last thing my upcoming game need laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Working Lite_c radar [Re: Realspawn] #458732
03/28/16 05:20
03/28/16 05:20
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Assume your radar is positioned at X=100,Y=100 on screen and its wide 300px in diameter.
In the enemy function add code to create a panel and display it:
Code:
if(vec_dist(my.x,player.x) < 1000) {
    // No dot exists for me
    if(my.skill44 == 0) {
        PANEL* tmpPan = pan_create(a dot :));
        my.skill44 = tmpPan;
    } else {
        // A dot exists, correct its position
        PANEL* tmpPan = my.skill44;
        tmpPan.x = (radar.x + 150) + (player.x - my.x) * 6.67;
        tmpPan.y = (radar.y + 150) + (player.y - my.y) * 6.67;
        // Too lazy to check the math, cuz I got drunk and I have a headache
        // 1000(dist from player) / 150(radius of radar pan) = ~6.67, do the opposite 1000/6.67 and it becomes 150px. 500/6.67 gives 75 pixels...
    }
} else {
    // If I'm at a distance, but a dot exists
    // remove it...
    if(my.skill44 != 0) {
        PANEL* tmpPan = my.skill44;
        ptr_remove(tmpPan);
        my.skill44 = 0;
    }
}



All this is not tested and if I have a typo it should be easy to fix, but this should give you the starting point...

The problem comes when you want to use it in multiplayer and don't want to use the "player" pointer laugh You have to do it differently... But for a single player game it should work.

PS.: To do an oriented radar you'll have to play with sin(player.pan) and cos(player.pan) on the final dot position on the screen, after you've placed it...

Oh, my head frown


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: Working Lite_c radar [Re: EpsiloN] #458736
03/28/16 15:04
03/28/16 15:04
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I created one some time ago: download

Salud!

Re: Working Lite_c radar [Re: txesmi] #458737
03/28/16 15:36
03/28/16 15:36
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
That one looks excellent grin thank you for sharing it laugh


Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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