Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
1 registered members (AndrewAMD), 599 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
HELP: Declaring variables (only C programmers to read please) #237777
11/22/08 09:00
11/22/08 09:00
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
In C++, I am used to defining variables by their type eg

int age;
float weight;

'skill' confuses me. Even though I own the Commercial version, I only use Lite-C/SED at the moment as I am concentrating on learning Lite-C.

1) Is 'skill' a variable that can be any type of numerial variable ie int, float or double ?

2) If I never used WED, and I wanted to stick as close to the C language as possible, could I avoid using 'skill' and use int or float instead ?

3) On a related matter, in C, we us the 'bool' variable for boolean variables. What is the equiverlent in Lite-C, is it a flag ?

Thanks

Drac.

Re: HELP: Declaring variables (only C programmers to read please) [Re: dracula] #237778
11/22/08 09:10
11/22/08 09:10
Joined: Jul 2001
Posts: 6,904
H
HeelX Offline
Senior Expert
HeelX  Offline
Senior Expert
H

Joined: Jul 2001
Posts: 6,904
Skill is an var array of 100 elements, whereas var is typedef'ed double. The convenience macros, e.g. skill12, are just macros to preserve sort of a downward convenience compatibility to the "old" C-Script language. All struct definitions and by that also all types of variables can be found in the "atypes.h".

See: atypes.h, line 414

Re: HELP: Declaring variables (only C programmers to read please) [Re: HeelX] #237780
11/22/08 09:23
11/22/08 09:23
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Thank you HeelX, I hadn't thought to look in atypes.h

Drac.

Re: HELP: Declaring variables (only C programmers to read please) [Re: dracula] #237807
11/22/08 14:58
11/22/08 14:58
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
Originally Posted By: dracula
In C++, I am used to defining variables by their type eg

int age;
float weight;

'skill' confuses me. Even though I own the Commercial version, I only use Lite-C/SED at the moment as I am concentrating on learning Lite-C.

1) Is 'skill' a variable that can be any type of numerial variable ie int, float or double ?

2) If I never used WED, and I wanted to stick as close to the C language as possible, could I avoid using 'skill' and use int or float instead ?

3) On a related matter, in C, we us the 'bool' variable for boolean variables. What is the equiverlent in Lite-C, is it a flag ?

Thanks

Drac.


There is nothing wrong with using skills at all. Its a great way to store parameters that are specific to an entity, like health or armor or what have you. They're better than local variables for this because they can be accessed by other functions through pointers.

Wait, are you talking about skill as in my.skill1 or skill as in old, ancient, obsolete A4 code?

Last edited by heinekenbottle; 11/22/08 15:00.

I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: HELP: Declaring variables (only C programmers to read please) [Re: heinekenbottle] #237810
11/22/08 15:13
11/22/08 15:13
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
my.skill1

thanks

Drac.

Re: HELP: Declaring variables (only C programmers to read please) [Re: dracula] #237859
11/23/08 00:05
11/23/08 00:05
Joined: Jul 2008
Posts: 1,178
England
M
MrGuest Offline
Serious User
MrGuest  Offline
Serious User
M

Joined: Jul 2008
Posts: 1,178
England
basically it's a pointer to a global variable stored only within the entity


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