Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, TedMar, dr_panther, Ayumi), 1,072 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
my.skill.. confused. #249866
02/04/09 18:00
02/04/09 18:00
Joined: Nov 2008
Posts: 42
Philippines
gagamBRYAN Offline OP
Newbie
gagamBRYAN  Offline OP
Newbie

Joined: Nov 2008
Posts: 42
Philippines
confused at my.skill... what it does? is it predefined? i dont used WED, is that means i cant use it?.. i'd check the manual but it is not ckear to me.

hope anyone can enlighten me.

tnx in advance!


Secrets are stolen from deep inside..
Re: my.skill.. confused. [Re: gagamBRYAN] #249869
02/04/09 18:04
02/04/09 18:04
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
It IS pre-defined. Every entity 100 defined var's called .skill1 to .skill100
Thay are ALSO called .skill(0) to .skill(99), two ways to access the same data,
that is available for every entity...
Look in atypes.h in the include folder of A7, youls fund the structures there.
(just dont change anything, weird sh*t happens then, but I learned!)


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: my.skill.. confused. [Re: gagamBRYAN] #249870
02/04/09 18:08
02/04/09 18:08
Joined: Jan 2005
Posts: 605
Deutschland, NRW
G
garv3 Offline
User
garv3  Offline
User
G

Joined: Jan 2005
Posts: 605
Deutschland, NRW
Any entity got some parameters (skill1 ... skill100).
You may set these parameters by doing something like
Code:
entity.skill3 = 23.578
The min and max allowed values for each skill are -999999.999 ... +999999.999
Additionally entities have 8 Flags calles flag1 ... flag8. These flags can only be set to ON or OFF.

You may define other "names" for these skills and flags. To do so use something like.
Code:
#define health skill2

Now you can set the entities health (==skill2) by using code like
Code:
entity.health = 93

You can use skills and flags as normal variables. But you must use them as a parameters of the specific entity.

Last edited by garv3; 02/04/09 18:09.

GameStudio Version: A7 Pro v7.86
Re: my.skill.. confused. [Re: EvilSOB] #249871
02/04/09 18:14
02/04/09 18:14
Joined: Nov 2008
Posts: 42
Philippines
gagamBRYAN Offline OP
Newbie
gagamBRYAN  Offline OP
Newbie

Joined: Nov 2008
Posts: 42
Philippines
so it is okay if in the "ent_animate(bagoboenemy, "run", anim_percentage, ANM_CYCLE);" i used varable anim_percentage to all these ent_animate rather than using the my.skill values?


Secrets are stolen from deep inside..
Re: my.skill.. confused. [Re: gagamBRYAN] #249873
02/04/09 18:20
02/04/09 18:20
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
If anim_percentage is a global variable it means that every entity has the same animation speed and every entity is for example at the 4th frame of its animation cycle.

I would recommend to define a skill as anim_percentage and use it for each entity individually:
Code:
#define anim_percentage skill50;


Re: my.skill.. confused. [Re: Xarthor] #249877
02/04/09 18:27
02/04/09 18:27
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
skill is an array of 100 vars in the entity struct.

normall they are used lik

entity.skill[0]
or
entity.skill[1] ...

skill1,skill2 are aliases for these.

you can also rename/realies them like the way Xarthor shows


3333333333
Re: my.skill.. confused. [Re: Quad] #249880
02/04/09 18:40
02/04/09 18:40
Joined: Nov 2008
Posts: 42
Philippines
gagamBRYAN Offline OP
Newbie
gagamBRYAN  Offline OP
Newbie

Joined: Nov 2008
Posts: 42
Philippines
tnx guys!.. i'll just explore on that matter


Secrets are stolen from deep inside..
Re: my.skill.. confused. [Re: Quad] #249884
02/04/09 18:44
02/04/09 18:44
Joined: Oct 2008
Posts: 218
Nashua NH
heinekenbottle Offline
Member
heinekenbottle  Offline
Member

Joined: Oct 2008
Posts: 218
Nashua NH
A skill is a variable that is similar to a local variable. However, instead of being specific to a function, it is specific to an entity. So if you want an entity to have a certain parameter, unique to that entity, you use a skill.

For example, .skill11 could be health. You could have player.skill11 = 100; and this won't effect enemy.skill11.

Skills can also be defined, as has already been stated to improve readability. #define health skill1

Skills can also be vectors. If skill3 is used as a vector, than skill4 and skill5 take the y and z components automatically (so take care when you use a skill as a vector, to not do anything with the two consecutive skills).

Skills are accessed by the entity[dot]property method such as player.health = 100; or you.speed = 75;

Last, a skill can also hold two numbers like this:

my.ammo = 100.25;

integer(my.ammo) = numOfBullets; //take the integer of my.ammo, assign that to numOfBullets
frx(my.ammo) = numOfClips; //take the fraction of my.ammo, assign that to numOfClips

what this does, is it holds two values in one spot (this is useful if you exceed the number of skills.) In this example, we have 100 bullets and 25 clips.

You can do this trick with any variable by the way, but since you can run out of skills, this trick is usually seen with skills.


Last edited by heinekenbottle; 02/04/09 18:48.

I was once Anonymous_Alcoholic.

Code Breakpoint;
Re: my.skill.. confused. [Re: heinekenbottle] #249914
02/04/09 20:27
02/04/09 20:27
Joined: Apr 2008
Posts: 437
dracula Offline
Senior Member
dracula  Offline
Senior Member

Joined: Apr 2008
Posts: 437
For my clarification please:

I'm assuming we are not using WED here.

1. A single entity can have 100 skills.
2. A skill can be attached using dot notation as in object oriented programmming
3. They are effectively variables that are used exclusively with entities
4. They can be aliased for clarity

local/global or both kind of "variables" ????

Could someone list the properties of flags please. I know they are boolean but I still get confused by them.

Thanks

Last edited by dracula; 02/04/09 20:31.
Re: my.skill.. confused. [Re: dracula] #249924
02/04/09 21:02
02/04/09 21:02
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
well

1. yeah
2. they are not attached, they are always there, you just access them using dot.(like you are using a element in a struct)
3. entites can store variables, in fact entites consistes from diffren type of variables/arrays, it has 100 vars(skills) a model(the visual apperance of entity) x,y,z,pan,tilt,roll and so on. If your entity is global(like you defined a Global ENTITY*) you can use them globally. Like you can use player.skill1 on another action. if you use me.skill# then it refers to skill of the entity that is running the action. Multiple entites running same action, can have diffren skill values, i mean:

action random_num(){
my.skill1 = random(1000);
}

all entites using thsi action will have diffrent number stored in their skill1.

4. yeah


3333333333
Page 1 of 2 1 2

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