View previous topic :: View next topic |
Author |
Message |
Zylyx_
Joined: 05 Dec 2007 Posts: 111 Location: scotland, uk
|
Posted: Thu Dec 06, 2007 12:41 pm Post subject: loading dpm models in quakec |
|
|
I'm having some trouble loading a DPM model for Darkplaces.
This is the code I have, minus the comments (added to weapons.qc)
//model precache (added at the beginning of the file
precache_model ("models/weapons/ak/v_ak47.dpm");
//Set the weapon up in players viewport
if ((self.weapon == IT_SHOTGUN))
{
self.currentammo = self.ammo_shells;
self.weaponmodel = "models/weapons/ak/v_ak47.dpm";
self.weaponframe = FALSE;
self.items = (self.items | IT_SHELLS);
}
When I try this out, the model doesnt show up, and the console reports "cant find <tex name> for mesh <tex name>, using default grey_checkerboard" (or something along those lines)
I'm using the the test v_ak47.dpm model that came with the dpm model viewer utility.
The model directory is as follows:
mygame/models/weapons/ak/v_ak47.pm
Inside the ak directory I have the following files (including the textures that the engine reports it cant find, in TGA file format):
-v_ak47.pdm
-10 of the TGA textures corresponding to the model
I would really appreciate if someone could tell me how to load and display DPM models in darkplaces.
Thanx again in advance!
-Zylyx _________________ ....noodle... |
|
Back to top |
|
 |
jim

Joined: 05 Aug 2005 Posts: 400 Location: In The Sun
|
Posted: Tue Dec 11, 2007 8:43 pm Post subject: |
|
|
If you can't see the model in the view, then it's been offsetted wrong. Check the offset in the text file for the compiler and try various different ones. I had offsetted a view weapon 0 0 160 and in the model editor the weapon was positioned a bit under the origo.
The textures you can fix with .skin files, they look like this:
Code: |
replace "models/weapons/ak/v_ak47_main" "models/weapons/ak/v_ak47_main.tga"
replace "models/weapons/ak/v_ak47_mag" "models/weapons/ak/v_ak47_mag.tga"
replace "models/weapons/ak/v_ak47_hand" "models/weapons/ak/v_ak47_hand.tga"
|
The first stuff in the " " is the mesh name and the second stuff in the " " is the texture you want to assign to it. I've noticed that they (or just the mesh name) can't be more than 31 characters for DPM models.
You would name the file as
_________________ zbang! |
|
Back to top |
|
 |
Zylyx_
Joined: 05 Dec 2007 Posts: 111 Location: scotland, uk
|
Posted: Wed Dec 12, 2007 4:13 pm Post subject: |
|
|
cool, thnx, I'll try that out! _________________ ....noodle... |
|
Back to top |
|
 |
Zylyx_
Joined: 05 Dec 2007 Posts: 111 Location: scotland, uk
|
Posted: Mon Dec 17, 2007 12:31 am Post subject: |
|
|
Hmmm...I still can't see model. I modified the origin of the model in the models.qc file, but it still shows me nothing. Anyone got any code examples or tutorials or something on this? It seems to me that info on loading on DPM models is very hard to come by.
I dont mind loading MD3 models either, so is it possible that I request a tutorial or something that shows you how to load models other then MDL's into Darkplaces.
n.b. Do I have to use any of those QSG extensions in my code when loading the models? Is this perhaps the issue? I havent tried the .skin thing coz I onyl have 1 mesh, and I dont know how it is grouped, coz I cant open the DPM file in any model editor to view the grouping...
Note: This is the code I have in models.qc for the model that I'm trying to load:
$modelname v_ak47
$cd mygame/progs
$origin 100 100 160
$base base
$skin skin
$frame frame0
I moved the v_ak47.dpm model to the "progs" dir in "mygame" dir, and put the model textures in the "textures" folder in the "mygame" dir.
Sorry if I'm being a bit of a pain on this issue, lol.
Thnx! _________________ ....noodle... |
|
Back to top |
|
 |
jim

Joined: 05 Aug 2005 Posts: 400 Location: In The Sun
|
Posted: Thu Dec 20, 2007 5:53 pm Post subject: |
|
|
I've noticed that the only thing that actually does something from these:
Code: |
$modelname v_ak47
$cd mygame/progs
$origin 100 100 160
$base base
$skin skin
$frame frame0
|
is the $frame <then some frame names>
With the compiler I meant dpmodel.exe. Here's a text file I've used for some character with it...
Code: |
# the output dir
outputdir ./model/
# load textures from this dir, this can be 31 characters long, including the texture file excluding the file type extension
# the texture file names are defined in the SMD files.
texturedir model/cloaked/
# save the model with this name:
model cloaked
# move the model this much before saving:
origin 0 0 60
# rotate the model this many degrees around Z axis:
rotate 90
# scale the model by this amount:
scale 1
# load the mesh files, first is stored as the frame 0, other sequences/scenes are saved after it and then after them
scene base.smd
scene aim.smd
|
_________________ zbang! |
|
Back to top |
|
 |
Zylyx_
Joined: 05 Dec 2007 Posts: 111 Location: scotland, uk
|
Posted: Mon Dec 24, 2007 11:35 pm Post subject: |
|
|
alright, cool, thnx, i'll give that a try as well. _________________ ....noodle... |
|
Back to top |
|
 |
|