Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
runtime names #330305
06/26/10 19:41
06/26/10 19:41
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
hello
how o di add entity names in runtime

lets say:

i want this function:

function add_ent("obj1");

Entity* R= "obj1";

obj1.x=20; ...

how i can make that possible?
Giving a name and using the function to add that name to the entity.. so i can control it, by that name..
and not by giving a pre defined name.

Re: runtime names [Re: MMike] #330307
06/26/10 19:52
06/26/10 19:52
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
i think thats not possible, because to control an entity, you need its pointer.


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: runtime names [Re: Rackscha] #330313
06/26/10 20:54
06/26/10 20:54
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
How about controlling the Entity by using his Entity* definition? You can define a name. f.e. Entity* Peter or Entity* Ghünter.


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: runtime names [Re: alibaba] #330314
06/26/10 20:57
06/26/10 20:57
Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
Rei_Ayanami Offline
Expert
Rei_Ayanami  Offline
Expert

Joined: Feb 2009
Posts: 3,207
Germany, Magdeburg
ghünter could not work wink

Re: runtime names [Re: Rei_Ayanami] #330321
06/26/10 21:25
06/26/10 21:25
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
You can store the names in entity.string1 or string2. If you want to find an entity by its name, you can go through the linked list and check if it's string1/2 is the name you are searching for.

Instead of using string1 or string2 you can also create strings and store their pointers in entity skills. But don't forget to destroy them when you remove the entity.

Re: runtime names [Re: Lukas] #330324
06/26/10 21:33
06/26/10 21:33
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
@ Rei
You are right grin


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: runtime names [Re: alibaba] #330329
06/26/10 21:51
06/26/10 21:51
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
or use a map.


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