Gamestudio Links
Zorro Links
Newest Posts
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
contractUpdate() is filtering if >2 rows
by mistery. 11/09/26 12:06
New Zorro version 3.15
by jcl. 11/09/26 09:24
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
1 registered members (EW_bytes), 15,961 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 3 of 4 1 2 3 4
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 Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Originally Posted By: Aku_Aku
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: EvilSOB] #328244
06/11/10 09:21
06/11/10 09:21
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
My first thought was: WOW!
The second one was also WOW!
Thanks for this solution.
I study it and today i will play with it and test.
I'll report my results here.

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 Offline
Expert
EvilSOB  Offline
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] #328246
06/11/10 09:29
06/11/10 09:29
Joined: Sep 2009
Posts: 1,035
Budapest
Aku_Aku Offline OP
Serious User
Aku_Aku  Offline OP
Serious User

Joined: Sep 2009
Posts: 1,035
Budapest
Hmmm...
I never tried different folders but identical names.
I test that and i write here what i got.

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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: EvilSOB
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.
Code:
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 Offline
Expert
EvilSOB  Offline
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 Offline
Senior Expert
Quad  Offline
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 Offline
Expert
EvilSOB  Offline
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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: EvilSOB
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 Offline
Expert
EvilSOB  Offline
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
Page 3 of 4 1 2 3 4

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