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.

Dark GDK / .3dw Loader Question

Author
Message
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 14th Aug 2009 01:52 Edited at: 15th Aug 2009 04:44
Nevermind! I figured out how to properly setup objects made with the 3dws importer with sparky collision! If anyone is curious how what you have to do is:

1. Scale the object back to 100
2. Setup the object with sparky's and allow object scaling.
3. Scale the object back to the original size
4. Update the object
5. It works!

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 14th Aug 2009 02:35
hmm, I use that loader myself for 3dws levels, but I havent had a problem with it.

What kind of meshes do you mean it's not showing ?

I think what you need to do is call the commands that generate a list of entities when you load the level, the list names should be the same as the names you used in 3dws, then you call dbLoadObject and use the positional information from the entity to position it.

Sorry if you mean something else, ive not had trouble with it loading object meshes and things, just that you need to load "entity" meshes yourself basically.

It wouldnt be hard to alter the code though, to load an object, just have to name the entity the same as the file or something..

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 14th Aug 2009 02:57 Edited at: 14th Aug 2009 03:49
I just did a small test for entities. It checked how many entities were originally in my map and it came back as 6. So I went into 3DWS made one of my crate objects part of the visgroup entities. And then to make sure it was part of the group on the right I made entities disappear and the crate disappeared too. So I saved it and put it into my game and now I should have 7 entities right? But, no I run it and I still have 6. So I'm not sure what the problem is but it's not that I can't load things it's that they aren't in the file...

For now I just made a new entity and placed it in the level, but I don't like doing it this way because I can't place it exactly how I would like it. Because it's not a model just an entity with a sprite as a place holder (in 3DWS). So any other way would be greatly appreciated!

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 14th Aug 2009 04:41 Edited at: 14th Aug 2009 04:42
did you make sure that you copied the file bak into wherever you are loading it from after you changed it in 3dws ?

sorry for asking an obvious question, but i have overlooked simple things like that myself sometimes...

Otherwise, the only thing I can suggest is pulling apart Pixel Perfect's code and figuring out how its working and making it work how you want it too, I do remember readin that the entity system was new when he did the loader and that it may have troubles. I dont know if the loader has been updated since then, it was awhile ago now though.

Can you post a zipped demo of your code and media and ill have a look at it for you if u like.. I have 3dws myself.

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 14th Aug 2009 04:59 Edited at: 14th Aug 2009 06:35
Yea, I did copy the 3dw file to the media so that was definitely updated. It would be great if you could take a look at it! I attached it to this post but I did remove my media not needed for the level, and code that doesn't pertain to the 3dws loader.

READ THIS:
Well I got it to load the models. The reason it wasn't working is because the directx model was defected and didn't work with Dark GDK, but it loaded in 3DWS. But I also have another file the same model but this one works in Dark GDK and not 3DWS . So I use the one that's defected in 3DWS, and then copy the one that doesn't work in 3DWS and put that into my media folder so that's loaded, and it works! Yay and all of that just because of a defected file... Well because of this now I want to find the proper way of getting a directx file. So how do you do Mista? My modeling tool options are: 3ds Max 2010, Milkshape 3D, CharacterFX, and Lithunwrap. I know how to export X in all of them but I'm not sure which actually work with Dark GDK and 3DWS so if you happen to know that would be great! Thanks for your help!

Use Google first... it's not rocket surgery!

Attachments

Login to view attachments
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 14th Aug 2009 06:42
No worries, as long as it loads the level and shows the problem a bit thats cool ill post bak once ive had a look for u.

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 14th Aug 2009 07:16 Edited at: 14th Aug 2009 07:36
Well now I have entity reading working perfectly so I got my lights rendered through the 3dw file now I'm working on interpreting the mesh info, now that I got loading sorted out. Ok now I got the directx file confusion fixed (just have to export my models form 3ds max 2010 in directx as a text file).

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 14th Aug 2009 09:06
ahh, no worries, I was gonna say, ive just had alook and the entity info thats in the file you gave me was being loaded, but thats all... there wasnt anything wrong with the loader..

Im glad you got it figured out

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 14th Aug 2009 21:10 Edited at: 15th Aug 2009 02:28
Ok... Well now it seems that I can setup objects (using Sparky's Collision) loaded and made with 3dws loader but it doesn't detect that the object has been scaled, and it isn't detecting the correct position of the object (it's always a bit over on the x axis). So anyone know how to fix this? I know about SC_AllowObjectScaling (...), but that's suppose to be used if I'll be scaling the object later in the game right?

This is the code I'm using to setup my level with sparky's:


Use Google first... it's not rocket surgery!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 15th Aug 2009 03:39
For now I guess I can just make a cube in 3dws and apply my crate texture because my normal crate is just a cube, but I still want to know how to fix this for when I add more complex objects to my map. Thanks!

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 15th Aug 2009 04:43
What do you mean by objects made with 3dws ?

Do you mean the brushes that you use and apply csg too, to make models from, usually for rooms and buildings and things ?

Does the problem affect other meshes(.x models) that you are loading from 3dWS ?

Im not sure, perhaps there is a problem in the way the object is being interpreted by GDK in relation to its bounds. But that would be the answer I think, you would need to recalculate the objects bounds, sparky's has a command to show the object's collision bounds, I cant remember it off the top of my head but if you turn that on, and also dbShowObjectBounds, you will get an idea of how the object is behaving, you may need to setup the bounds manually if you cant get it to recacl it normally..

One way to force GDK to recalc bounds is to make a mesh from the object, delete the object, then make a new object from the mesh and delete the mesh, its slow though and inefficient, but it works, code would looks somethnig like : (using object 1 as an example)



I know there is a command in DBPro for recalculating an objects bounds, but im not sure if it is included in GDK or not(I havent looked thoroughly, but i havent seen it in the GDK headers)

You would need to experiement with where you added that code in though if you used something like it, try putting it just after the object is loaded/created and before anything else if you can, but if doing that affects the way your level looks, then putting it after all of the positioning has been done would be best.

I havent actually had a problem like this though heyufool, so im just givin u some ideas you could try to fix it...

Good Luck

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 15th Aug 2009 04:54
Thanks the original problem was that the meshes scale factor wasn't being recognized by sparky's. So to fix it I had to set it back to it's original scale, set it up with sparkys, then set back to it's old scale, and update it. And it worked Thanks for the response though!

Use Google first... it's not rocket surgery!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 15th Aug 2009 07:16
Ahh good to know glad you got it sorted

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-11-20 17:35:18
Your offset time is: 2024-11-20 17:35:18