How to add a new weapon to Neoaxis demo 




How to add a new weapon to NeoAxis demo.

Programs and resources used in this tutorial:
Blender 2.61 -> http://www.blender.org/
Weapon models -> http://www.3drt.com/downloads.htm
WinRar -> http://www.rarlab.com/
NeoAxis non-commercial 1.11 -> http://www.neoaxis.com/neoaxis/downloads#noncommercialsdk

1. Download the weapon models pack from 3DRT.com http://www.3drt.com/3dm/free/3drt.com-ww2-german-guns.zip

2. Use WinRar to extract gun-mp40-3ds.3DS and mp40.tga from the package

3. Open up Blender. Press "Esc" to get remove the welcome screen and "x" to delete the example cube.

4. Use File -> Import -> 3D Studio (.3ds) to import gun-mp40-3ds.3DS

5. Use File -> Export -> COLLADA (.dae) to export your model (mp40.dae) to somewhere

6. Create a directory in \NeoAxis Engine Non-Commercial SDK 1.11\Game\Bin\Data\Types\Weapons called MP40

7. Copy mp40.dae and mp40.tga to this new directory

8. Close Blender and open up Resource Editor

9. Go to \Types\Weapons\MP40 and create a new resource there with right mouse button
Entity type
Name:MP40
Class: Gun

10. Right click on mp40.dae and convert it to .mesh

11. There should now be a mp40.mesh and mp40.highMaterial there. If the material or mesh is black check that the "Diffuse1Map" in material points to mp40.tga and that the MaterialName in mp40.mesh points to mp40.highMaterial

12. Delete the mp40.dae. Following pictures show my setup on .mesh and .highMaterial.

13. Attach a new mesh to your MP40.type and select mp40.mesh

14. I edited the mesh values in the .type so that Rotation is "0 0 270" and scale is "0.5 0.5 0.5"



15. MP40.type values i mostly copied from SubMachineGun.type. Carefully check under NormalMode and different Collections so that all values match the values in SubMachineGun.type



16. Next we need to create an Item that rotates on the map floor and can be picked up

17. Make a new directory called MP40 inside Types\Items

18. With right mouse button create a new resource to that folder
Entity Type
Name: MP40Item
Class: WeaponItem

19. Add your mp40.mesh to that type

20. Rest of the values I mostly copied from SubMachineGunItem.type
Remember to copy all values and also check NormalMode and NormalMode/FireObjects so you get mussle flash too



21. Edit Types\Units\Girl so that Weapons collection has your new weapon too



22. We are ready to put the new blaster to a map!!!

23. Open up MainDemo map if the Map Editor

24. Place Items\MP40.type on the map (if you can see it in Map Editor set AllowEditorCreate=true)

25. Launch map and go play!

PS. Weapon position on the Girl model is not perfect, but pretty good for a tutorial

PPS. MP40.rar