Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Handles and pointers #118585
03/20/07 22:11
03/20/07 22:11
Joined: Mar 2004
Posts: 281
England
frescosteve Offline OP
Member
frescosteve  Offline OP
Member

Joined: Mar 2004
Posts: 281
England
Hey guys, I havn't been on 3dgs for about a year and almost forgot the stuff i had learnt. Can someone help me remember how to use handles for a bunch of entitys.

TIA

Re: Handles and pointers [Re: frescosteve] #118586
03/21/07 12:14
03/21/07 12:14
Joined: Feb 2004
Posts: 217
Wennigsen, Germany
Gordon_Shumway Offline
Member
Gordon_Shumway  Offline
Member

Joined: Feb 2004
Posts: 217
Wennigsen, Germany
Hi !!!

A handle is nothing more than a "number". Just think of the starting numbers in a sport event.
So, you can easily point the entities of intrest.

For example:
you.parent_handle=handle(my); // saves the handle "number" of the my-entity in the parent_handle-skill of the you entity.

When the you entity want something from this my-entity,
just call in the you-entity-action:
you=ptr_for_handle(my.parent_handle); // the you entity is now the my entity above.

I hope this will help you.

Bye G.S.


***Neue Webseite!! Mit vielen neuen Infos! http://www.2662-thegame.de.vu***
Re: Handles and pointers [Re: Gordon_Shumway] #118587
03/21/07 17:23
03/21/07 17:23
Joined: Sep 2006
Posts: 148
Ireng Offline
Member
Ireng  Offline
Member

Joined: Sep 2006
Posts: 148
Now talk about being nice. =D


"When the battlefield is under total control, war becomes routine." Old Snake
Re: Handles and pointers [Re: Ireng] #118588
03/22/07 00:03
03/22/07 00:03
Joined: Mar 2004
Posts: 281
England
frescosteve Offline OP
Member
frescosteve  Offline OP
Member

Joined: Mar 2004
Posts: 281
England
How do i reference an entity? (I want to assign one action to 10 different entitys using handles? and reference them like so?)

Entity1.x += 1;

Re: Handles and pointers [Re: frescosteve] #118589
03/22/07 02:57
03/22/07 02:57
Joined: Sep 2006
Posts: 148
Ireng Offline
Member
Ireng  Offline
Member

Joined: Sep 2006
Posts: 148
You don't need to do that.
When you put an entity in WED, you can assign an action to it, and it will behave independently of any other entity that has the same action assgined.
To do that command you mentioned (Entity1.x += 1;) you will need to use something like this (corroborate with tutorials):
First, in WED, set each entity's skill1 to 1,2,3... never repeating.
Code:
 //before any function, at the script start:
define Id, skill1;
//then, inside the entity's action:
...
if(my.Id=1){Entity1=me}
if(my.Id=2){Entity2=me}


Hope this helped.


"When the battlefield is under total control, war becomes routine." Old Snake

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