|
1 registered members (EW_bytes),
15,961
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Perfect copy of an entity
[Re: Aku_Aku]
#328219
06/11/10 02:13
06/11/10 02:13
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I use alternate paths to load entities. Fortunately i stored the needful info of that. Also, can you please explain how you've done this? (the alternate paths part) FI, if I try this ent_create("mods_1\\block.mdl", ... ); ent_create("mods_2\\block.mdl", ... ); BOTH entities appear with the model from folder "mod_1". thanks dude... Is this what you mean? Is there a trick?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Perfect copy of an entity
[Re: Aku_Aku]
#328245
06/11/10 09:23
06/11/10 09:23
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Excellent, and thanks.
I like to get feedback on my work, and LOVE to get compliments for it!
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Perfect copy of an entity
[Re: EvilSOB]
#328289
06/11/10 16:21
06/11/10 16:21
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
If you're still interested Aku, here is an ALMOST elegant way of doing it... Complete duplication, including "prime" action, and its fully tested too.
action MyAction()
{
my.skill99 = (void*)MyAction;
...
}
action YourAction()
{
my.skill99 = (void*)YourAction;
...
}
ENTITY* ent_duplicate(ENTITY* source_ent)
{
ENTITY* target_ent = ent_create(source_ent.type, 0, (void*)source_ent.skill99);
memcpy(&target_ent.x, &source_ent.x, sizeof(ENTITY)-(sizeof(C_LINK)+sizeof(var)));
// ent_clone(target_ent); //if required
return(target_ent);
}
This seems not to be an good solution. 32 Bit Void Pointer are 32 Bits (4 bytes) big and 64 Bit Pointer are 64 Bits (8 Bytes) big. The problem is, that the 32 Bit size of the skill variable won't increase when you use 64 Bit. So it is possible that you save a wrong pointer which can cause terrible bugs.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Perfect copy of an entity
[Re: WretchedSid]
#328324
06/12/10 00:01
06/12/10 00:01
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Can anyone else verify Sylars point here?
In concept he is correct, but I was under the assumption that A7 still uses 32bit void pointers even when running on a 64bit system. But this is just an assumption, I would like some backup of this please...
I dont have access to any 64bit operating systems, so I cant test it myself.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Perfect copy of an entity
[Re: EvilSOB]
#328328
06/12/10 00:39
06/12/10 00:39
|
Joined: Oct 2007
Posts: 5,211 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
|
acknex executables are 32 bit. there fore all pointers are 32bit.
and even in a 64 bit environment it runs in 32 bit mode. logically, all arrays(therefor strings) would fail, if a 32bit app uses 64bit pointers.
if it were to be compiled to a 64-bit executable, that still would not be a problem since all 64 bit pointers are 64bit, and longs are 64bit too.
Last edited by Quadraxas; 06/12/10 00:46.
3333333333
|
|
|
Re: Perfect copy of an entity
[Re: Quad]
#328329
06/12/10 01:26
06/12/10 01:26
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Thanks Quadraxas, that what I thought.
Sorry Sylar, if lite-c was 32bit & 64bit you would be right. Luckily for me its not. I hadnt even thought of that...
Thanks all the same for pointing out a potenial problem. I need other people to shine light into corners Ive never looked in...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Perfect copy of an entity
[Re: EvilSOB]
#328330
06/12/10 02:14
06/12/10 02:14
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
In concept he is correct, but I was under the assumption that A7 still uses 32bit void pointers even when running on a 64bit system. But this is just an assumption, I would like some backup of this please... Yep, but as you develop not for now, but for a date in the future, you should think about this too. It can happen that conitec offers a 64 Bit compiler while your are still developing your game. So this can be a serious bug source. Quadraxas is right that a 64 bit Windows will provide your app with an virtual 32 bit adress space, but according to the manual, a long is just 4 bytes big! So this will be real problem if you run native 64 bit code! (Source: http://www.conitec.net/beta/aarray.htm )
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Perfect copy of an entity
[Re: WretchedSid]
#328331
06/12/10 03:08
06/12/10 03:08
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
I see your point, but I see switching from a 32-bit compiler to a true 64-bit is going to require some pretty major overhauling of any code anyway.
Assuming of course that conitec dont "build in" those sort of fixes into the compiler. ie to make void* and skills all 64-bit.
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|