??? What Do I Do ???C:\Documents and Settings\Lotus Wolf\My Documents\X2Solid\
Importing C:\Documents and Settings\Lotus Wolf\My Documents\X2Solid\Sword.x
:
Parsing C:\Documents and Settings\Lotus Wolf\My Documents\X2Solid\Sword.x...
Exception in thread "main" java.lang.NullPointerException
at Direct3DImport.ImportFile<X2Solid.java:27>
at X2Solid.Go<X2Solid.java:863>
at X2Solid.main<X2Solid.java:853>
Press Any Key To Continue...
Reverse Engineering Lugaru assets
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
Re: Reverse Engineering Lugaru assets
ummm, rudel? i've got a .X file, Sword.X, and when i use your converter to make it a .solid, Sword.solid, it says:
-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
You didn't export properly. Either there is no Root Frame or it contains no Subframes.
In line 27, an Iterator<Frame> on all Subframes of the Root Frame is referenced, that's how I know - either the Root Frame is null or the Subframes are.
What you could do is put the .X file into a zip archive and attach it to a post here. "Upload attachment" under the Save, Preview, Submit buttons. I could investigate and tell you what you did wrong. Or at least try.
To export a model as .X from Blender, by the way, select the Model, choose "File -> Export -> DirectX" from the main menu and choose "Export Sel", then put it somewhere.
Edit: Also remember that a Model needs a UV map. If there is none, it doesn't throw this Exception, but it's easy to forget this. Just go to UV Face Select Mode in Blender, select all faces, press U to open the unwrap menu, choose 'Unwrap' - that generates a trivial UV map. It is automatically exported along with the other Model data and goes into the .X file.
In line 27, an Iterator<Frame> on all Subframes of the Root Frame is referenced, that's how I know - either the Root Frame is null or the Subframes are.
What you could do is put the .X file into a zip archive and attach it to a post here. "Upload attachment" under the Save, Preview, Submit buttons. I could investigate and tell you what you did wrong. Or at least try.
To export a model as .X from Blender, by the way, select the Model, choose "File -> Export -> DirectX" from the main menu and choose "Export Sel", then put it somewhere.
Edit: Also remember that a Model needs a UV map. If there is none, it doesn't throw this Exception, but it's easy to forget this. Just go to UV Face Select Mode in Blender, select all faces, press U to open the unwrap menu, choose 'Unwrap' - that generates a trivial UV map. It is automatically exported along with the other Model data and goes into the .X file.
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
Re: Reverse Engineering Lugaru assets
Here it is.
- Attachments
-
- Sword.zip
- The faulty .X file...
- (2.25 KiB) Downloaded 152 times
-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
Please give me a few minutes.
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
I can tell you that the parsed RootFrame is null. You aren't using Blender, I think - the .X file you provided can't be parsed properly.
In fact, the .X file you provided is based on a different .X specification, as I can see in the key in the first line of the file. That results in issues, as you can see.
What contributes as well is the fact that my parser assumes a certain .X structure, that may be insufficient. I may have to write a grammatic for .X files, generate a scanner with JFlex or something like that and go from there. That may take some time though..
In the meantime, I'll give you a working version of the sword - I just imported the sword into Blender and exported it again, which results in a structure my parser can handle.
What you did wrong anyway is you didn't flip the normals, the individual parts of the sword are separate (fix this by joining them into one mesh), the scale is wrong (DimX should be around 1000), the orientation was wrong (the top of the blade should look towards global -X if I recall correctly) and there was no UV map.
After scaling and rotating, both actions have to be applied specifically.
Anyway, I fixed all of this for you and attached the .X file, the generated .solid, textures that you should use for texture painting because they show the UV mapping - all in a .zip archive.
Summing up, it seems to be necessary to use Blender for exporting .X. I wasn't aware of that and am sorry for the inconvenience.
The sword looks cool, by the way!
In fact, the .X file you provided is based on a different .X specification, as I can see in the key in the first line of the file. That results in issues, as you can see.
What contributes as well is the fact that my parser assumes a certain .X structure, that may be insufficient. I may have to write a grammatic for .X files, generate a scanner with JFlex or something like that and go from there. That may take some time though..
In the meantime, I'll give you a working version of the sword - I just imported the sword into Blender and exported it again, which results in a structure my parser can handle.
What you did wrong anyway is you didn't flip the normals, the individual parts of the sword are separate (fix this by joining them into one mesh), the scale is wrong (DimX should be around 1000), the orientation was wrong (the top of the blade should look towards global -X if I recall correctly) and there was no UV map.
After scaling and rotating, both actions have to be applied specifically.
Anyway, I fixed all of this for you and attached the .X file, the generated .solid, textures that you should use for texture painting because they show the UV mapping - all in a .zip archive.
Summing up, it seems to be necessary to use Blender for exporting .X. I wasn't aware of that and am sorry for the inconvenience.
The sword looks cool, by the way!
- Attachments
-
- Sword.revision1.zip
- (113.91 KiB) Downloaded 148 times
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
Re: Reverse Engineering Lugaru assets
Thank you SO MUCH, man i forgot to do a lot of stuff... but thanks 
-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
Thanks for modding!
Please report back whether the .solid works in-game. And I'd like to know which modeling software you used, if you don't mind me asking.
Please report back whether the .solid works in-game. And I'd like to know which modeling software you used, if you don't mind me asking.
-
Ragdollmaster
- Posts: 2343
- Joined: Mon Jul 30, 2007 11:49 am
- Location: Island of Lugaru
Re: Reverse Engineering Lugaru assets
Rudel is smart 
-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
Say hello to your mother for me.Ragdollmaster wrote:Rudel is smart
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
Re: Reverse Engineering Lugaru assets
The model does work, very well, and im working on textures as we speak. i was using misfit model 3d, i guess its a lot different. cause i thought i had done everything right... but hey it works now
Thanks again. I'll post this up in a little while.
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
Re: Reverse Engineering Lugaru assets
ok i'm hittin myself in the head here. i know what i'm doing wrong, cause you explained it ^up there^, but i'm still unclear on how to fix what i did wrong... i got Blender, and i still have a model i made in misfit model 3d (a cool ax). but after i import it into blender, im not sure what to do. i read your blender tutorial, but i can't say i understand it all... so if you could explain it to me, i'd be much obliged.
-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
Sure!
After you've imported the model:
For the following actions, the mouse has to be in the 3D view.
1. Select all parts of it:
- Press A repeatedly until nothing is selected (nothing has a purple outline)
- Hold SHIFT and right-click all parts of the model
2. Join all parts:
- Press CONTROL-J
3. Bring the model to the center:
- Press SHIFT-S
- Choose "Selection -> Center"
4. Go into Edit Mode:
- Press TAB
5. Select all vertices:
- Press A until all vertices are yellow
6. Convert all faces to triangles:
- Press CONTROL-T
7. Recalculate all normals, then flip them:
- Press CONTROL-N
- Press W, choose "Flip Normals"
8. Move all vertices so that the handle is at the center:
- Press G
- Press X or Y or Z to restraint movement to the global X, Y or Z axis
- Move the axe on the X, Y or Z axis by moving the mouse
- Press X, Y or Z again to switch to another axis
- Hold CONTROL while moving the mouse to snap to grid
- Scroll the wheel to zoom in / out
- Left-click to confirm movement, right-click to abort
- Press 1, 3 or 7 on the NUMPAD to switch between top, side and front view
- Repeat until it's perfect
9. Exit Edit Mode:
- Press TAB
10. Rotate the axe so that it points towards -X:
- Press 1, 3 or 7 on the NUMPAD to switch between top, side and front view
- Press R to rotate, move mouse, left-click to confirm rotation, right-click to abort
- Hold CONTROL while moving the mouse to snap to big fractions of rotation angles
- Scroll the wheel to zoom in / out
11. Activate the info box for your mesh:
- Press N
12. Scale the model up:
- Press 1, 3 or 7 on the NUMPAD to switch between top, side and front view
- Press S to scale, move mouse, left-click to confirm rotation, right-click to abort
- Hold CONTROL while moving the mouse to snap scaling to grid
- Scroll the wheel to zoom in / out
- While scaling, make sure to watch the value DimX in the info box, it has to be over 1000
13. Apply scale and rotation:
- Press CONTROL-A
14. Go into UV Face Select Mode:
- Press F
15. Select all faces:
- Press A until no face is grey
16. Unwrap faces for UV map:
- Press U
- Choose "Unwrap (smart projections)"
- Confirm the new dialogue by clicking OK
17. Go into the Image Mode:
- Press SHIFT-F10
18. Make a screenshot of the UV map:
- Zoom in so that it's big enough
- Press ALT-PrintScreen
19. Open MSPAINT:
- Press WINDOWSKEY-R
- Enter "mspaint"
20. Paste the UV screenshot:
- Press CONTROL-V
21. Crop the screenshot:
- Click once onto the rectangular selection tool
- Select the screenshot so that only the grid is in the selection
- Press CONTROL-X to cut it out
- Press CONTROL-N to make a new image (don't save)
- Resize the image so that it's rather small (the resize handle is on the lower right corner of the paint surface)
- Press CONTROL-V to paste the cut UV-map scheme
22. Mirror the picture vertically (it's in the main menu somewhere)
23. Save this as a jpeg with the name "Sword.jpg" into your working folder
24. Go back to Blender
25. Go back to 3D View:
- Press SHIFT-F5
26. Go out of UV Face Select Mode:
- Press F
27. Save the project:
- Press CONTROL-S, navigate to working folder, enter FILENAME.blend instead of untitled.blend, click Save File
28. Export to .X:
- Choose "File -> Export -> DirectX (.x) ..."
- Click "Export Sel"
- Go to working folder, enter FILENAME.x, click Save
29. Convert the .X file, you know how that works
30. Backup original Sword.solid and the textures, copy over the generated solid, rename, copy over the UV texture, play Lugaru, watch the axe slice wolves as you click.
I hope that's detailed enough to get you started.
In the attachment is the Blender Hotkey Reference - really helpful!
Have fun.
After you've imported the model:
For the following actions, the mouse has to be in the 3D view.
1. Select all parts of it:
- Press A repeatedly until nothing is selected (nothing has a purple outline)
- Hold SHIFT and right-click all parts of the model
2. Join all parts:
- Press CONTROL-J
3. Bring the model to the center:
- Press SHIFT-S
- Choose "Selection -> Center"
4. Go into Edit Mode:
- Press TAB
5. Select all vertices:
- Press A until all vertices are yellow
6. Convert all faces to triangles:
- Press CONTROL-T
7. Recalculate all normals, then flip them:
- Press CONTROL-N
- Press W, choose "Flip Normals"
8. Move all vertices so that the handle is at the center:
- Press G
- Press X or Y or Z to restraint movement to the global X, Y or Z axis
- Move the axe on the X, Y or Z axis by moving the mouse
- Press X, Y or Z again to switch to another axis
- Hold CONTROL while moving the mouse to snap to grid
- Scroll the wheel to zoom in / out
- Left-click to confirm movement, right-click to abort
- Press 1, 3 or 7 on the NUMPAD to switch between top, side and front view
- Repeat until it's perfect
9. Exit Edit Mode:
- Press TAB
10. Rotate the axe so that it points towards -X:
- Press 1, 3 or 7 on the NUMPAD to switch between top, side and front view
- Press R to rotate, move mouse, left-click to confirm rotation, right-click to abort
- Hold CONTROL while moving the mouse to snap to big fractions of rotation angles
- Scroll the wheel to zoom in / out
11. Activate the info box for your mesh:
- Press N
12. Scale the model up:
- Press 1, 3 or 7 on the NUMPAD to switch between top, side and front view
- Press S to scale, move mouse, left-click to confirm rotation, right-click to abort
- Hold CONTROL while moving the mouse to snap scaling to grid
- Scroll the wheel to zoom in / out
- While scaling, make sure to watch the value DimX in the info box, it has to be over 1000
13. Apply scale and rotation:
- Press CONTROL-A
14. Go into UV Face Select Mode:
- Press F
15. Select all faces:
- Press A until no face is grey
16. Unwrap faces for UV map:
- Press U
- Choose "Unwrap (smart projections)"
- Confirm the new dialogue by clicking OK
17. Go into the Image Mode:
- Press SHIFT-F10
18. Make a screenshot of the UV map:
- Zoom in so that it's big enough
- Press ALT-PrintScreen
19. Open MSPAINT:
- Press WINDOWSKEY-R
- Enter "mspaint"
20. Paste the UV screenshot:
- Press CONTROL-V
21. Crop the screenshot:
- Click once onto the rectangular selection tool
- Select the screenshot so that only the grid is in the selection
- Press CONTROL-X to cut it out
- Press CONTROL-N to make a new image (don't save)
- Resize the image so that it's rather small (the resize handle is on the lower right corner of the paint surface)
- Press CONTROL-V to paste the cut UV-map scheme
22. Mirror the picture vertically (it's in the main menu somewhere)
23. Save this as a jpeg with the name "Sword.jpg" into your working folder
24. Go back to Blender
25. Go back to 3D View:
- Press SHIFT-F5
26. Go out of UV Face Select Mode:
- Press F
27. Save the project:
- Press CONTROL-S, navigate to working folder, enter FILENAME.blend instead of untitled.blend, click Save File
28. Export to .X:
- Choose "File -> Export -> DirectX (.x) ..."
- Click "Export Sel"
- Go to working folder, enter FILENAME.x, click Save
29. Convert the .X file, you know how that works
30. Backup original Sword.solid and the textures, copy over the generated solid, rename, copy over the UV texture, play Lugaru, watch the axe slice wolves as you click.
I hope that's detailed enough to get you started.
In the attachment is the Blender Hotkey Reference - really helpful!
Have fun.
- Attachments
-
- BlenderHotkeyReference.zip
- (252.56 KiB) Downloaded 147 times
-
Lotus Wolf
- Posts: 2218
- Joined: Sun Aug 31, 2008 6:03 pm
Re: Reverse Engineering Lugaru assets
THANK YOU *bows to rudel* its actually starting to work! OMG, im gonna go crazy with this! Thanks a whole lot man. im giving you props every time i upload a new weapon, or other model.

-
rudel_ic
- official Wolfire heckler
- Posts: 2193
- Joined: Sun Aug 28, 2005 11:19 pm
- Location: Hamburg City
- Contact:
Re: Reverse Engineering Lugaru assets
You don't really have to give me props, it's your work. I thank you for using my shit!Lotus Wolf wrote:THANK YOU *bows to rudel* its actually starting to work! OMG, im gonna go crazy with this! Thanks a whole lot man. im giving you props every time i upload a new weapon, or other model.![]()
Remember though that if you make anything other than weapons, the scale isn't that crazy and the normals aren't inverted. And it's tough to make stuff you can walk on, I wouldn't recommend putting effort into that.
Furthermore, there is a bug in the program, I'll upload a fixed version for you, hold still..
Edit: Actually, don't hold still, the bug is just relevant for parsing .solid files to .x files, which you don't do. I'll fix the bug in a proper release.