Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
entity id #322167
05/05/10 06:26
05/05/10 06:26
Joined: Mar 2009
Posts: 25
kholis Offline OP
Newbie
kholis  Offline OP
Newbie

Joined: Mar 2009
Posts: 25
i add 2 cube in WED and also add action two both.

in SED i can retrieve cube position with my.x, my.y, and my.z
but how can i retrieve cube id to distinguish from the others?
guessing like my.id or my.idname but its not work.

thanks

Re: entity id [Re: kholis] #322168
05/05/10 06:58
05/05/10 06:58
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
The entity type doesn't have an 'id' member by default. What it does have is a set of skills that you can set your own custom id...

me.skill1 = 50;

... So when checking ids you can easily check the entity skill.

The skill method would require you to manually set the ids. You can use the handle of the entity also. A handle is a number unique to the object which is automatically set by the engine.

Use the 'handle' function (check in manual) or directly access it with 'my.link.index'.

Last edited by DJBMASTER; 05/05/10 06:59.
Re: entity id [Re: DJBMASTER] #322177
05/05/10 09:29
05/05/10 09:29
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
cube 1 skill1 = 1; // set this in WED
cube 2 skill1 = 2; // the same...

ENTITY* cube_1; // Entity Pointer
ENTITY* cube_2;

action cube_action()
{
if (my.skill1 == 1) cube_1 = me;
if (my.skill1 == 2) cube_2 = me;
...
}

Now you can access to that two entities with this two Pointers:

cube_1.x = 20;
cube_2.x = -100;
set (cube_1,PASSABLE);

and so on...

Last edited by Widi; 05/05/10 09:30.
Re: entity id [Re: Widi] #322221
05/05/10 14:19
05/05/10 14:19
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
or you use an array of entities...

ENTITY* ent[n]; //n = size


now you can use an id as array-position..


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: entity id [Re: Espér] #322255
05/05/10 15:34
05/05/10 15:34
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
If you want to be lazy, and are NEVER taking this project to multiplayer,
you could hi-jack the multiplayer property "my.client_id"...

Or if you are NOT using it with view-entities, you can use "my.layer"...


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: entity id [Re: EvilSOB] #323174
05/12/10 00:06
05/12/10 00:06
Joined: Mar 2009
Posts: 25
kholis Offline OP
Newbie
kholis  Offline OP
Newbie

Joined: Mar 2009
Posts: 25
thanks everyone laugh


Moderated by  HeelX, rvL_eXile 

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