Author Topic: [TUTORIAL] Importing models for Items/Weapons into the game.  (Read 65378 times)

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #15 on: January 02, 2013, 12:10:02 am »
Which is the whole reason why I ever worked on 3D for FOnline.
I still can be reached over e-mail if you somehow need anything from me. Don't see a reason why you would, but if you do, e-mail remains the safest bet, as I do not visit this forum reliably anymore.

Offline Graf

  • Moderator
  • "Next Day" developer
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #16 on: January 02, 2013, 06:37:15 am »




Rifles, big guns and shotguns sections has been finished.

P.S. Did anyone started to work on importing the misc. items already? The faster we deal with these things - the closer we are to the release.

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #17 on: January 02, 2013, 12:04:01 pm »
Just realized how much the sawed-off I made smells of shit... I wonder if I will ever get the time to recreate the texture...

P.S. Did anyone started to work on importing the misc. items already? The faster we deal with these things - the closer we are to the release.
Sorry man, I still can't seem to get FOnline SDK running properly. I think I'm going to pass this one - it's pretty useless to create anything if the scale is most likely going to be off.
I still can be reached over e-mail if you somehow need anything from me. Don't see a reason why you would, but if you do, e-mail remains the safest bet, as I do not visit this forum reliably anymore.

Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #18 on: January 02, 2013, 12:32:18 pm »
Tried my luck with the misc items but it seems I'm doing something wrongl, especially since the the SDK looks a bit strange on my side no shadows at all and wrong looks for the character.
Code: [Select]
#Misc
 Value 140 Attach WP_AccessCard.x  Texture 0 ITEM_AccessCard.tga Link R_Handle_1  Scale 2.0
RotY -90 RotZ 10 MoveX 4 MoveY 1

Anyway I could go and convert the misc items to x format even though it seems I won't be able to add them in properly for now.

Offline Mike Crosser

  • Gambling: 60%
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #19 on: January 02, 2013, 02:39:55 pm »




Rifles, big guns and shotguns sections has been finished.

P.S. Did anyone started to work on importing the misc. items already? The faster we deal with these things - the closer we are to the release.
I don't mean to be picky but the way he hold the LSW is wrong.
Also the assault rifle should be slightly bigger IMO.

Offline Graf

  • Moderator
  • "Next Day" developer
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #20 on: January 02, 2013, 02:52:51 pm »
Let me help to both of you. I have prepared an archive, which you simply extract, add master.dat and critter.dat (don't forget to specify the new path to it) and you're good to go. You'll have a completely working Fonline SDK with 3D models enabled. To run the game in singleplayer, you'll need to run the server just as usual, and not to forget to set a path to Fonline.exe in FOnlineSingleplayer.exe properties.

Download link

To check the models you'll need to load the save file and enter following commands:

~getaccess admin admin
~param 0 151 x (x stands for the item name, and could be taken from here)

Jotisz, it seems to me, that you're trying to access the added models through the inventory, but it's not yet possible (at least, I don't know how). You can only add items and access then through the console command above. How to combine the inventory and 3D is rather a good question, but the only one who knows something about it is Karpov. Maybe Luther knows something about it, I'm not sure though. My own guess, is that it works via fo3d file. One have to create a separate file for each item, which specify which animations to use and so on (I haven't tried this on practice).

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #21 on: January 02, 2013, 03:59:05 pm »
I don't mean to be picky but the way he hold the LSW is wrong.
Unfortunately it is true - you hold the LSW by the last handle like all other bullpup weapons (a bullpup is a weapon design where the trigger and handle is located AFTER the magazine, unlike other weapons like the M4 and M16 carbines).

Aaanyway. Testing out the SDK, if everything works alright, I should be able to start working today.

EDIT: Tried out the ripper as an initial test to see if I understood everything correctly. Aside from the wrong rotation and the overly huge size, everything else seems OK. Also, Leather jacket clips through body during the animation.


EDIT2: Also, why is the idle animation looping all the time? It's infuriating!!!

EDIT3: Is there any waster way to reload files? Clicking "Exit" and "Load game" all the time isn't very fast.
« Last Edit: January 02, 2013, 08:31:25 pm by Haraldx »
I still can be reached over e-mail if you somehow need anything from me. Don't see a reason why you would, but if you do, e-mail remains the safest bet, as I do not visit this forum reliably anymore.

Offline Karpov

  • Moderator
  • Come Together
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #22 on: January 02, 2013, 09:08:05 pm »
Nice job. There is a file called client_main, inside server/data. I modified it so that the Items in hand call the layer value in the 3d character when they are used, as well as the armors in the armor slot. They go from 1 to 500, I have placed 500 lines at the bottom of that file. If you don't have that file, then the items will not match the 3d item when equipped, and the will use the original setup instead. Same thing for armors. Also, the value for the right hand has to be set to 0, which is neutral. Any other value will lock the item in the character's hand all the time. If you still can't see the item it may be that it is too small. Try to scale it up three times to check.

here's the file I mentioned. Keep the original, of course.
http://www.mediafire.com/?1nyooujn1tp0nsg

The knife animation loops because I made it as the Idle animation. Use the female character instead. I'll correct that one.

Offline Luther Blissett

  • Moderator
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #23 on: January 02, 2013, 09:10:47 pm »
[edit] Short version = what Karpov said a minute ago :)

You can only add items and access then through the console command above. How to combine the inventory and 3D is rather a good question, but the only one who knows something about it is Karpov. Maybe Luther knows something about it, I'm not sure though.

The bits I mentioned here : http://fodev.net/forum/index.php/topic,26833.msg231777.html#msg231777 should resolve that. Karpov sorted it out at some point in the past and has covered it in more detail, but as the 3d repo only covers the client folder, it's not included in the 3d svn thing.

The bits that need to link together are values in client_main.fos (in server/scripts), which should correspond to the objects in the fo3d file. If you need them, you should be able to get item names and numbers from itemnames.lst in Server/data, or from looking at the proto files in server/proto/items, but for now it will function by simply linking the numbers as in the file below.

Anyway the client_main.fos should be uploaded here http://www.sendspace.com/file/nxevzl, which you can drop in your own server/scripts folder and it should work on a basic level.

Note that only the pre-existing weapons/items will work in an "equip object in game>model appears in 3d" sort of way. Anything we've added ourselves (i.e. extra armours, weapons etc) would need adding as items first (with floor icon, inventory icon, short description, long description, stats and values etc).

If you've been looking at different things with ~param 0 151 x, then you'll need to set it to ~param 0 151 -1 to return to the "use linked models" sort of mode.

[edit2] Karpov says above it should be 0 instead of -1, so try that first (~param 0 151 0).
« Last Edit: January 02, 2013, 09:14:26 pm by Luther Blissett »

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #24 on: January 02, 2013, 11:13:41 pm »
Thanks to everyone for the help! Everything works perfectly, working right now on the misc items.
I still can be reached over e-mail if you somehow need anything from me. Don't see a reason why you would, but if you do, e-mail remains the safest bet, as I do not visit this forum reliably anymore.

Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #25 on: January 03, 2013, 10:08:22 am »
3 item is done well actually 2 since the red and yellow access card uses the same mesh but different texture.
A sidenote I just seen that some textures has bmp format at the misc items it would be better to convert them to png, and another thing for weapons the WP naming is ok but I think that for misc items we should use something else like MI so its easier to find them in _FoHuman.fo3d. Anyway here is what I was able to add in:


Code: [Select]
Value 255 Attach MI_DayPass.x Texture 0 ITEM_DayPass.png Link R_Handle_1  Scale 0.6 MoveX 12
Value 144 Attach MI_AccessCard.x Texture 0 ITEM_AccessCardR.png Link R_Handle_1  Scale 1.6 MoveX 10
#Value 144 Attach MI_AccessCard.x Texture 0 ITEM_AccessCardY.png Link R_Handle_1  Scale 1.6 MoveX 10
I wasn't able to find the other AccessCard so I just made a duplicate of the same item not sure how to add new items for Fonline so I left it as it is. Download items from here:
http://db.tt/f2R1Ah2w

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #26 on: January 03, 2013, 02:14:54 pm »
I used MISC_Super_tool_kit.x, works just fine.
I still can be reached over e-mail if you somehow need anything from me. Don't see a reason why you would, but if you do, e-mail remains the safest bet, as I do not visit this forum reliably anymore.

Offline Graf

  • Moderator
  • "Next Day" developer
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #27 on: January 03, 2013, 03:01:43 pm »
Some new stuff has been done.



Download link

Code: [Select]
Value 390 Attach WP_solar_scorcher.x Texture 0 ITEM_solar_scorcher.jpg Link R_Handle_1 Scale 0.1 RotX -90 RotY -15
 Value 393 Attach WP_phazer.x Texture 0 ITEM_phazer.jpg Link R_Handle_1 Scale 0.3 RotX -90 RotY -15
 Value 4 Attach WP_knife.x Texture 0 ITEM_knife.jpg  Link R_Handle_1 Scale 2 RotY -90 MoveZ -5.5 MoveX 2
 Value 236 Attach WP_CombatKnife.x Texture 0 ITEM_combat_knife.jpg Link R_Handle_1 Scale 0.25 RotY -90 MoveZ -5.5 Mov
 Value 21 Attach WP_brassknuckles.x Texture 0 ITEM_brassknuckles.jpg Link R_Handle_1  Scale 0.4

I also had made a table where one can easily mark which miscellaneous items has been imported.

Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #28 on: January 03, 2013, 04:00:37 pm »
Looking nice here I just did the briefcase.

Code: [Select]
Value 72 Attach MI_BriefCase.x Texture 0 ITEM_BriefCase.png Link R_Handle_1  Scale 12 MoveX 10 MoveZ -5 RotX -90 RotZ -110 RotY 180Sadly if he keeps the briefcase a bit more down then he keeps hitting his legs with it during walking.

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #29 on: January 03, 2013, 04:15:30 pm »
Whatever is the reason, I can't seem to get neither the Field medical kit or the medical supplies bag working.
Code: [Select]
Value 428 Attach MISC_Medical_Supplies.x Texture 0 ITEM_Medical_Supplies.tga Link R_Handle 1
 Value 408 Attach MISC_Field_Medic_Kit.x Texture 0 ITEM_Field_Medic_Kit.jpg Link R_Handle 1
Tried every possible scale, from 0.05 up to 60. Nothing seems to do anything. Tried different values, nothing. Looked around the files in case I might have used wrong file names or extensions - nothing.
On the other hand, other things work.


@Jotisz, I feel you. I had to make the super tool kit a little slanted while holding in order to make it not clip through his leg.
I still can be reached over e-mail if you somehow need anything from me. Don't see a reason why you would, but if you do, e-mail remains the safest bet, as I do not visit this forum reliably anymore.