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 / Model loading

Author
Message
DarkComplicated wtf
13
Years of Service
User Offline
Joined: 6th Oct 2010
Location: NARNIAAAA!!!!!!
Posted: 12th Oct 2010 02:36
so im having trouble loading in models in dbc.... i've only used it for about a week and in school we are making projects but i cant load any freakin models and we are not allowed to use 3ds creator or whatever its called to make our own. so i need to know a few things about models seeing as the schools tutorials were so vague.
1-do i load them as an animation or something else (adding the pre-made models saves them as a .x or .3ds format but under the animation folder so hopefully you can understand how i'm confused)
2-how can i texture pre-made models?
3- how do i load an animation to models?
4-is there anything extra you can add please?
i'm not sure if this is significant but the models in school are loaded from the media tab
any help appreciated

I'll make Halo look like poke'mon!
LBFN
16
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 12th Oct 2010 06:04
1. Animations are different than objects and are made up of .avi files. To load an object, simply use
(i.e. load object "MyMan.x",12)
3D animation with DBC is a chore, as it does not allow for boned animation. Some on here have figured out how to manipulate the limbs efficiently -- search the threads to find out how it is done.

2. Put the texture image into the same folder as the model. Normally, when the model is loaded, it will automatically texture it. If for some reason it does not work, you can load in the image and object separately and use


3.
. Never really messed with using this much at all, as it seemed like it was real slow.

4a. Use the help files (if you have the original editor anyway). Type in the command, put the cursor on it and press F1.
4b. If you get stuck, post what you have (Click the CODE box, paste your code, Click the CODE box again).
4c. Pictures are worth 1000 words. Sometimes grabbing a screen pick and uploading it here can be helpful in diagnosing a problem (use .jpg format).

I'm not really a programmer.....I only play one on TGC.
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 12th Oct 2010 14:12
The objects you load will only load the textures in the same file if the model has been textured with those textures in a modelling program.

It is possible that you have multiple models of the same object, but each of different animations. For example, you might have:

"idle.x" - The idel animation of the object
"walk.x" - The walk animation of the object
"attack.x" - The attack animation of the object

Now how do you bring all of these files together as one object in the program?

First of all, you load one of them. It doesn't matter which one. Here I picked "idle.x":



Next step is to append the rest of the objects to the idle object, using the append object command. When you load an animated object, there is a certain amount of frames it contains. Make sure you append the other objects at the end of the loaded objects frames. You can find the amount of frames the object has with the total object frames command:



And there you go, that's all there is to know about loading animated objects.

BTW, you can play the animations with play object or loop object, and stop them with stop object.

TheComet

DarkComplicated wtf
13
Years of Service
User Offline
Joined: 6th Oct 2010
Location: NARNIAAAA!!!!!!
Posted: 13th Oct 2010 01:07
Thank you both very much you both helped alot
now if you guys can help me with one more thing please?
my ground is a giant box and my floor texture is a steel grated floor with blood splatters but im having trouble because the dimensions of my floor are 10000,-500,10000 but that just stretches my texture and it makes it extremely odd looking so i thought i would try a for then loop with 1/100 size boxes so the texture would look how it was intended to look and it sorta worked i just dont have the code for the positioning here is an example of the code i used that did not work

floor=1
for floor=1-100
make object cube (6+floor) 100,-500,100
position object (6+floor) (floor+50),-500,0
texture object (6+floor),4
next floor

there are a few other commands like an rgb coloring and collision in there but i dont think thats what matters or makes a difference in this. so yah if you know how to generate floors like that adjacent to one another could anyone please tell me?
P.S. i'm sorry but its kinda hard to show screen shots and codes from my game since this site is blocked at school lol
ill try to put some on a usb drive though and show you so hopefully my problem can be resolved

I'll make Halo look like poke'mon!
TheComet
16
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 13th Oct 2010 16:48 Edited at: 13th Oct 2010 16:51
This site's blocked? Use a proxy. Here's one one of my friends wrote himself : www.widerstand.fvzr.ch

I use it all the time, and it's really secure.

Now to your problem.

Creating cubes is an innovative idea, but this means you will be creating 100*100 cubes, so 10'000 objects. THAT will run slow...

There is a command for scaling the texture:

scale object texture <obj>,<u>,<v>

So instead of making 100 cubes along each axis, you would just scale the texture 100 times bigger:

scale object texture <floor>,100,100

Note that after scaling a texture, the uv data will be reset to 1. So to scale it back, you need to do scale object texture <floor>,0.01,0.01

TheComet

DarkComplicated wtf
13
Years of Service
User Offline
Joined: 6th Oct 2010
Location: NARNIAAAA!!!!!!
Posted: 14th Oct 2010 01:56
im actually trying to find out how to tilepattern my texture to recreate the blood splatter on the floor instead of just having three throughout the map so basically ▄<---that would be a texture and it would go like:
▄ ▄ ▄ and not one big one like this

▄▄▄▄
if you understand what im getting at, sorry sometimes i cannot articulate what i mean correctly
uhm if the attachment is working correctly this should kinda show what im trying to get except of course with my texture and not the plant pattern

I'll make Halo look like poke'mon!

Attachments

Login to view attachments
DarkComplicated wtf
13
Years of Service
User Offline
Joined: 6th Oct 2010
Location: NARNIAAAA!!!!!!
Posted: 14th Oct 2010 01:59
also can you email that proxy server thing? i may have trouble trying to access it since this site is blocked lol
heres my adress
kayorrx2@yahoo.com

I'll make Halo look like poke'mon!
DarkComplicated wtf
13
Years of Service
User Offline
Joined: 6th Oct 2010
Location: NARNIAAAA!!!!!!
Posted: 14th Oct 2010 23:20
oh noez the proxy wont work at school D: oh well
the scale worked exactly like i wanted it to thank you very much

I'll make Halo look like poke'mon!

Login to post a reply

Server time is: 2024-03-28 21:00:54
Your offset time is: 2024-03-28 21:00:54