Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Copying Objects

Author
Message
047
18
Years of Service
User Offline
Joined: 4th Jun 2006
Location:
Posted: 29th Oct 2006 09:32
Is there any way to copy an object in DBC. I know that DBP has the Clone Object and Instance Object commands for that but those don't seem to exist in DBC. Does anyone know any way to apply the same model to different objects other than loading the object over and over? Thanks.
Robot
20
Years of Service
User Offline
Joined: 27th May 2004
Location:
Posted: 29th Oct 2006 09:34
Not as far as I know.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Oct 2006 17:46 Edited at: 29th Oct 2006 17:59
It can be done. The only thing you have to consider is the texture. If you load the texture separately, then you can retexture the copied objects.

Here's an example I put together. I create my object and texture, but they could have been loaded just as well. I created a function:

copy_object(inobj,outobj,texture)

that does the actual copying. Heres the code:



Enjoy your day.

Login to post a reply

Server time is: 2025-05-25 22:42:26
Your offset time is: 2025-05-25 22:42:26