About Store Forum Documentation Contact



Post Reply 
Programming: memc array for CHR
Author Message
andrake Offline
Member

Post: #1
Programming: memc array for CHR
Greetings
in my game there is dynamically creating personages.

for this i early use static array:
Code:
class UnitAI : Game.CHR
UnitAI unitAI[100];
unitAI[1].create(ID of fbx model)

but now i want to use dynamic array
Code:
memc<UnitAI> m;
//what i should use for creating character in dynamic array???????
UnitAi unitAI
m.add(unitAI.create(ID of fbx model));

but in this case even if it will be works in memory there is will be:
every time when i inflate new character will be create two instances of UnitAI in memory: first is unitAI and second is m[i].

what is right solution?

m.New().create(ID of fbx model) ?
(This post was last modified: 07-17-2014 01:21 PM by andrake.)
07-17-2014 01:15 PM
Find all posts by this user Quote this message in a reply
andrake Offline
Member

Post: #2
RE: Programming: memc array for CHR
really i need destructor for cur class
07-17-2014 02:17 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: Programming: memc array for CHR
m.New().create(ID of fbx model) is the proper way of using Memc in the situation you described. But are you sure you aren't wanting the ObjMap/ObjMemx as to let the engine handle them?
I'm not sure what you are talking about with the destructor.... Memc will call the destructor on object removal...
07-17-2014 03:08 PM
Find all posts by this user Quote this message in a reply
andrake Offline
Member

Post: #4
RE: Programming: memc array for CHR
ops... i mean destructor of CHR class instance
07-17-2014 03:18 PM
Find all posts by this user Quote this message in a reply
andrake Offline
Member

Post: #5
RE: Programming: memc array for CHR
>>But are you sure you aren't wanting the ObjMap/ObjMemx as to let the engine handle them?
i do not know how to add character to the world at runtime with this feature

a ok . now i see Esenthels approach for this. thank you Rubeus!
(This post was last modified: 07-17-2014 05:20 PM by andrake.)
07-17-2014 05:08 PM
Find all posts by this user Quote this message in a reply
Post Reply