Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by k_ivan. 04/25/26 19:13
ZorroGPT
by TipmyPip. 04/25/26 16:09
Stooq now requires an API key
by jcl. 04/13/26 09:42
Strange "Alien" Skull created with >Knubber<
by NeoDumont. 04/10/26 18:58
400 free seamless texture pack downl. here !
by NeoDumont. 04/08/26 19:55
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (AndrewAMD, Grant, valino), 3,361 guests, and 13 spiders.
Key: Admin, Global Mod, Mod
Newest Members
valino, juergenwue, VladMak, Geir, ondrej
19209 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
RTS Game - Selecting Units #325145
05/24/10 22:47
05/24/10 22:47
Joined: Apr 2010
Posts: 12
Australia
Brad_Mclain Offline OP
Newbie
Brad_Mclain  Offline OP
Newbie

Joined: Apr 2010
Posts: 12
Australia
What I am trying to do is make an RTS game where I can select groups of units using a selection rectangle. I want every unit to have its own health and selection circle when I this.

To achieve this I have been trying to set up the skills of the unit entities to hold a PANEL* but haven't had any luck so far.

When I try to call set(my.health_panel, SHOW) I get an error about flags not existing.
I get a syntax error if I try a cast to (PANEL*).

Is this possible?, what would be the best way to achieve this?

Re: RTS Game - Selecting Units [Re: Brad_Mclain] #325149
05/24/10 22:56
05/24/10 22:56
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
You define a local panel:

Code:
action MyAction () {
   PANEL* health_bar = pan_create ("your panel definition here",1);
   ...
   ...
   ...
// you must remove this panel before the entity is removed.
   pan_remove (health_bar);
   ent_remove (me);}



you can set the position of the panel to the position of the entity by using vec_to_screen (example):

Code:
...
...
vec_set (my.skill60,my.x);
vec_to_screen (my.skill60,camera);
health_bar.pos_x = my.skill60;
health_bar.pos_y = my.skill61;
...
...




Last edited by wdlmaster; 05/24/10 22:59.
Re: RTS Game - Selecting Units [Re: wdlmaster] #325150
05/24/10 22:59
05/24/10 22:59
Joined: Apr 2010
Posts: 12
Australia
Brad_Mclain Offline OP
Newbie
Brad_Mclain  Offline OP
Newbie

Joined: Apr 2010
Posts: 12
Australia
Is it possible to create a window with a local panel definition?

Re: RTS Game - Selecting Units [Re: Brad_Mclain] #325151
05/24/10 23:00
05/24/10 23:00
Joined: Apr 2010
Posts: 172
W
wdlmaster Offline
Member
wdlmaster  Offline
Member
W

Joined: Apr 2010
Posts: 172
yes.

Re: RTS Game - Selecting Units [Re: wdlmaster] #325154
05/24/10 23:33
05/24/10 23:33
Joined: Apr 2010
Posts: 12
Australia
Brad_Mclain Offline OP
Newbie
Brad_Mclain  Offline OP
Newbie

Joined: Apr 2010
Posts: 12
Australia
Thank you very much, got it working just like I wanted.


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

Gamestudio download | 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