Gamestudio Links
Zorro Links
Newest Posts
ZorroGPT
by TipmyPip. 02/27/26 22:06
WFO Training with parallel cores Zorro64
by Martin_HH. 02/26/26 16:03
Zorro version 3.0 prerelease!
by TipmyPip. 02/25/26 16:38
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 5,782 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
the1, alx, ApprenticeInMuc, PatrickH90, USER0328
19200 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Possible or Not #121241
04/03/07 16:17
04/03/07 16:17
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
As I thinkm C-Lite is kinda new, and i have worked alot in C-Script before
and i beginned with C-Lite today, And im asking for a solution to this major problem. 2 teams. when one soldier of a team reqonize an enemy it chould start shooting on that enemy. but how to solve that problem when you need to add a Pointer for each soldier?


//If i posted this tread on wrong place. pardon me.

//Need all help i can get.


Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Re: Possible or Not [Re: Tiinusen] #121242
04/03/07 22:24
04/03/07 22:24
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
there are a number of ways you could go about doing it.

each soldier could have a local pointer called "victim" or something, which would point to their target ("target" is already taken by the engine). also, have each entity set their .skill[0] (or a different skill if you're already using .skill[0]) to what number team they are on (1 or 2). when one soldier sees someone, it could set its "you" pointer to them. then say Code:
if(you.skill[0]!=my.skill[0]) // to check if they are on a different team
victim = you; // braces aren't needed in IF statements if you only have one command

make each soldier shoot at whoever their "victim" is. you could easily put in some conditions to make sure "victim" is always the closest enemy or the one posing the greatest threat. that should get u started! i have to go study now.

hope this helps!

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: Possible or Not [Re: JibbSmart] #121243
04/04/07 06:25
04/04/07 06:25
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
Thanks alot man, one more question.
is it possible to create local pointers in the actions thats attached to the soldiers in each team? could you give me a code snippet of how it would lookslike.

Thanks alot


Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,
Re: Possible or Not [Re: Tiinusen] #121244
04/04/07 07:58
04/04/07 07:58
Joined: Mar 2006
Posts: 3,538
WA, Australia
J
JibbSmart Offline
Expert
JibbSmart  Offline
Expert
J

Joined: Mar 2006
Posts: 3,538
WA, Australia
no problem
in the soldier's action, before any while loops, put "ENTITY* victim;" without the quote marks. that declares a local entity pointer in the action.

then u can use the little bit of code i mentioned before to make it point to someone ("victim = you;" if the predefined "you" pointer is pointing at someone) and then you can check victim.x and victim.pan and stuff like that to see where the victim is and where it is looking.

the victim's local variables cannot be accessed of course, and you probably already knew that. you can look at the victim's skills, for example, if each soldier sets their .skill[2] to their health, you could also check victim.skill[2] to see how healthy they are and determine whether its worth attacking more or retreating (for example ).

julz


Formerly known as JulzMighty.
I made KarBOOM!
Re: Possible or Not [Re: JibbSmart] #121245
04/04/07 08:29
04/04/07 08:29
Joined: Sep 2006
Posts: 128
Sweden
Tiinusen Offline OP
Member
Tiinusen  Offline OP
Member

Joined: Sep 2006
Posts: 128
Sweden
Thanks alot Julz, you have been very helpful. you anserwed my biggest question.
Now i can begin to create som valuable games with my team.

What i thought before was that you was not able to create Local Variables.
but now i understund thats possible. Thanks alot Mate

Last edited by Tiinusen; 04/04/07 09:12.

Where is my manual? i think i lost it. i have been searching everywere. ohh there it is F1 I'm 17 years old, with 4 years of programing I can programming a lot of languages check my Bio out,

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