FOnline Development > 3D Development

[TUTORIAL] Importing models for Items/Weapons into the game.

(1/20) > >>

Karpov:
Hello. I made this tutorial so that people that are not graphic artists or coders can help as well. As you know, there are lots of items in the game, and a lot of people was willing to model them all. But now that almost all of them are done, we need to import them. But who is going to do such job? don't look at me...

I found this little standalone application which fits perfectly our needs. It will work for static meshes.

Download here: http://www.teamxtcgames.com/files/3D%20Object%20Viewer%20v3.5.zip
 
Lets begin...
We need: 1 model file in 3ds format. 1 texture in any image format.

-Open the application and load the mesh.


-Once it is loaded, select Texture Object and search for the texture file to check if the mapping works.


-After that you will have to reposition the gun so that the handle is right in the center of all three axis'.
To do this select Limb Control from the menu. And move (or type in) the Offset values until the gun is centered. Remember, the center is where the character's hand will be.
Change rotation if needed.


-Now export as DirectX mesh, and place that model inside data/critters, and the texture file inside data/textures. Please name the mesh with the prefix "WP_" and the texture with "ITEM_"


-Now open _fohuman.fo3d and locate the "Right Handle" Layer. Below this first line there are a series of "Values". Add the value for the new weapon in a new line, with the item ID number (found in server/data/itemlist.lst).  Then Attach WP_modelfilehere.x Texture 0 Item_texturehere.tga.
 
example

--- Code: ---Value 394 Attach WP_gausspistol.x  Texture 0 item_gauss_pistol.tga
--- End code ---



-After that, paste the line from another weapon, from Link to the end. I used 10mm pistol coordinates. These coordinates should work for all pistols in theory. If it's a rifle, copy it from some other rifle, and so...



-Test it. In my case it looks bigger than it should. So I have to change this Scale value.


That's it.
 
ps: yeah, it's still big.

The weapons in 3ds are here, but they might be outdated. You might need to check Graf's repository.
http://www.mediafire.com/?afu2uifjqaccc01

I'll see if I can find something that converts into 3ds from obj.

Post your exported file along with it's _fohuman line here. I'll download them and add them to the repository

Horatio:
Karpov, you're ALIVE!!!  ;D

Graf:
I've been following the tutorial, but after all I couldn't get the model in game. Nothing changes, even if I simply replace the existing model with another one. I suppose the problem is in my client-server build, so would like to do a clean install to make sure. So if anyone still have "FOnline_v2_200111.zip" file - I would appreciate it.

Another weird thing - I've got "_FOHuman.fo3d" and "_FOHuman_death.fo3d". Any clue on what's the difference between them? I've been trying to replace one file with another, but still no success with importing models.

Luther Blissett:
I've uploaded the old FOnline_v2_200111.zip here : http://www.sendspace.com/file/evk938

Not sure how long the link will stay up on sendspace, but I can always re-upload if it's needed in future.

[Edit]
Old file has fallen off the internet. By request, reuploaded here:
Google Drive Upload 12/09/2021

Luther Blissett:
Is this by equipping the weapon, or using a "~param 0 151 x" sort of thing?

If the former, how is the "client_main" in the server/scripts folder? There's a bit near the end which connects the item/model things :

Original default one, which is dependent on the naming of objects etc :

--- Code: ---#ifdef PLAYERS_3D
int GetHandleValue(uint16 pid)
{
if(pid == 0 || (pid >= 1000 && pid <=1100)) return 0;

int handle = 0;
switch(pid)
{
case PID_ZIP_GUN:                        handle = ATTRIBUTE_Handle_Weapon_22Autoloader;               break;
case PID_9MM_MAUSER:                     handle = ATTRIBUTE_Handle_Weapon_9mmAutoloader;              break;
case PID_10MM_PISTOL:                    handle = ATTRIBUTE_Handle_Weapon_22Autoloader;               break;[...]
--- End code ---

One Karpov altered, which just attached by number and therefore may be easier to add new models to :

--- Code: ---#ifdef PLAYERS_3D
int GetHandleValue(uint16 pid)
{
if(pid == 0 || (pid >= 1000 && pid <=1100)) return 0;

int handle = 0;
switch(pid)
{
case 1 : handle = 1 ;                break;
case 2 : handle = 2 ;                break;
case 3 : handle = 3 ;                break;
[...]
--- End code ---

Navigation

[0] Message Index

[#] Next page

Go to full version