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

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #30 on: January 03, 2013, 05:30:37 pm »
Good news, I figured out the problem... Well, almost. I have no idea why did that happen, but I copied the code from a previous item that was working and just rewrote everything that needed changes (like the file names). And now it works! Don't ask why, it just does!

EDIT:

Code: [Select]
Value 308 Attach MISC_Super_Tool_Kit.x Texture 0 ITEM_Super_Tool_Kit.bmp Link R_Handle_1 Scale 50
 Value 428 Attach MISC_Medical_Supplies.x Texture 0 ITEM_Medical_Supplies.tga Link R_Handle_1 RotY 80 Scale 1.25
 Value 408 Attach MISC_Field_Medic_Kit.x Texture 0 ITEM_Field_Medic_Kit.jpg Link R_Handle_1 RotY 15 MoveZ -1 MoveY -2 MoveX -0.2
 Value 126 Attach MISC_V13_Flask.x Texture 0 ITEM_V13_Flask.png Link R_Handle_1 Scale 0.25 RotY 90 MoveX 1.2
 Value 124 Attach MISC_Beer.x Texture 0 ITEM_Beer.bmp Link R_Handle_1 Scale 2.37
 Value 116 Attach WP_ripper.x Texture 0 ITEM_ripper.bmp Link R_Handle_1 scale 2 RotY -90 MoveZ -0.5 MoveX 1.5

Download
« Last Edit: January 03, 2013, 06:16:56 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 Luther Blissett

  • Moderator
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #31 on: January 03, 2013, 07:49:34 pm »
Given the amount of larger objects which are clipping through the leg, is it worth adding an extra idle/walk/run with a slightly repositioned arm? Would be very easy to adjust the animation, but I'm not sure how the object>animation bit is linked (i.e. currently a rifle is held differently from a knife, there must be some way for a "large box" holding position to be added).

I'm not sure where it's defined, but I'd imagine it possible to add an "N" set of animations
Code: [Select]
Unarmed,  Knife, [other stuff], Rocket Launcher, Large misc
   A        D       EFGHIJKL          M             N     

I'd imagine you'd add stuff in the fopro files, like knife has "Weapon.Anim1=4" (4 referring to D?) and club has "Weapon.Anim1=5" (5 referring to E?), but first you'd need to define an "N" somewhere (though it looks like "N" is taken by an "aim" animation section that we've not used).

I'd say it's probably low priority at the moment, compared to just sticking things on an angle, but if anyone knows the scripts well enough to find where this stuff goes, would be very useful in future if adding extra weapon classes, or for carrying boxes of ore etc.

Anyway, excellent work you guys :)

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #32 on: January 03, 2013, 09:19:08 pm »
Hear ye, hear ye,  ye scurvy landlubbin' roleplayers! Now ye can drink ma' rum! All this fine 'n' dandy 3D technology!


Code: [Select]
Value 125 Attach MISC_Booze.x Texture 0 ITEM_Booze.png Link R_Handle_1 Scale 2.37 MoveX 1 MoveZ 0.55
 Value 310 Attach MISC_Gamma_Gulp.x Texture 0 ITEM_Gamma_Gulp.png Link R_Handle_1 Scale 2.43 MoveX 1.5 MoveZ 0.5 RotY 90
 Value 311 Attach MISC_Roentgen_Rum.x Texture 0 ITEM_Roentgen_Rum.png Link R_Handle_1 Scale 0.6 MoveX 2 MoveZ -0.75
 Value 469 Attach MISC_Rot_Gut.x Texture 0 ITEM_Rot_Gut.png Link R_Handle_1 Scale 2.28 MoveX 1.5 MoveZ 1
 Value 106 Attach MISC_Nuka_Cola.x Texture 0 ITEM_Nuka_Cola.png Link R_Handle_1 Scale 18 MoveX 2 MoveZ 1

Download
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 Cyber Jesus

  • I piss excellence
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #33 on: January 03, 2013, 09:24:05 pm »
Keep up the good work, maybe we can get 3D working next session

Offline Karpov

  • Moderator
  • Come Together
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #34 on: January 04, 2013, 12:18:19 am »
Luther: You are right there are in fact more animation sets

# None, Empty, KO/Dead, KO Rise, Knife, Club, Hammer, Spear, Pistol, Uzi, Shootgun, Rifle, Minigun, Rocket Launcher, Aim, None, Sniper, Wakizashi, Rip, Unused
#  _      A       B        C       D     E      F       G      H      I      J        K       L           M           N    O      P         Q       R     ST

There is Aim, which I don't understand. There's None, that seems to be using the letter O somehow. I succesfully used the one for the Wakizashi on the letter Q. There seem to be an extra set for Sniper and another for Ripper. I wonder if S and T can be used as well.

I changed Weapon.Anim1= instead of Weapon.Anim2_0= which gave no result. The first one on 17 worked just fine, but only with 3d characters. Sprites would stay locked in idle position when the item was active. That's the only problem.

Good work with the items Haraldx

PS: if anyone wants to re do or re-texture the leather jacket I'm totally ok with that. It was the first armor I made, and I was not actually trying to make it look like the sprite.
« Last Edit: January 04, 2013, 12:22:32 am by Karpov »

Offline Alvarez

  • Forget the past, go outside and have a blast
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #35 on: January 04, 2013, 12:05:48 pm »
You guys are awesome.

It would be cool to see some animations with these. Karpov, do you want to release your animations?

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #36 on: January 04, 2013, 02:03:21 pm »
Also, speaking of retextures, I redid the texture for the sawed off. It still looks like crap, but it isn't that stupidly bright colored anymore.


What do you think? Worth uploading the new texture file?

EDIT:
Some more stuff. If you are interested in progress check out these 2 tables made by Graf. Table for weapons | Table for misc items



Code: [Select]
Value 409 Attach MISC_Paramedic_Bag.x Texture 0 ITEM_Paramedic_Bag.jpg Link R_Handle_1 Scale 1.3 RotY 207 MoveZ 0.85 MoveX 2 MoveY -1.75
 Value 91 Attach MISC_Doctor_Bag.x Texture 0 ITEM_Doctor_Bag.jpg Link R_Handle_1 RotY 112 Scale 1.35
 Value 47 Attach MISC_First_Aid_Kit.x Texture 0 ITEM_First_Aid_Kit.jpg Link R_Handle_1 Scale 0.5 RotX 180 RotY -15

Download Includes the redone sawed off shotgun texture, just in case.

I'm done for today, not adding anything new for now. As much as I enjoy (yes, I actually enjoy this what others would call a chore) this thing just eats all my time.
« Last Edit: January 04, 2013, 03:02:38 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.

JovankaB

  • Guest
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #37 on: January 04, 2013, 02:59:49 pm »
I think the guy could have slightly more hair on the front of head.
I drew example based your screen Haraldx.



Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #38 on: January 04, 2013, 03:05:31 pm »
I see your point, Jovanka. I'm not entirely sure, but I think there was a haircut you can select and it gives a bit more hair. I might be wrong. Going to check the files.
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.

JovankaB

  • Guest
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #39 on: January 04, 2013, 03:24:00 pm »
Also he doesn't seem to wear any kind of shirt (or anything) under the leather jacket.
Which is slightly weird... and makes me wonder if he doesn't have underpants either...  :P

You wouldn't normally wear a leather jacket on a bare skin.
« Last Edit: January 04, 2013, 03:35:08 pm by JovankaB »

Offline Graf

  • Moderator
  • "Next Day" developer
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #40 on: January 04, 2013, 04:16:14 pm »
Today I've got something special to show you. This is a plasma torch, that doesn't exist in the SDK originally. How to add such item into the game? That's easy:

1. Find a PID in the range of 1 to 500, that isn't occupied with another important (weapon, armor or misc) item. To do this simply enter the "~ais x x" command, and take a look at your inventory. If nothing appeared in there - you're good to go.
2. Open up a "weapon.fopro" file (stored in server/proto/items folder)
3. Find an item, that uses the same animation.
4. Copy-paste it and set path to both - "inventory" and "map" images.
5. Change the PID for this item and voilĂ  - you've got this item in the game available via "~ais x x" command.

You can also change the description and other stuff in "FOOBJ.MSG" but it's not important for us at the moment.



Code: [Select]
Value 399 Attach WP_super_cattle_prod.x Texture 0 ITEM_super_cattle_prod.jpg  Link R_Handle_1 Scale 0.35 RotY 10 RotZ 10
 Value 498 Attach WP_plasma_torch.x Texture 0 ITEM_plasma_torch.jpg  Link R_Handle_1 Scale 0.35 RotY 10 RotZ 10
 Value 6 Attach WP_sledgehammer.x Texture 0 ITEM_sledgehammer.jpg Link L_Handle_1 RotX 90 Scale 3 RotY 6 RotZ -70
 Value 25 Attach WP_GrenadeFrag.x Texture 0 ITEM_GrenadeFrag.jpg Link R_Handle_1 Scale 1.7 MoveX 3 RotY -60
 Value 26 Attach WP_plasma_grenade.x Texture 0 ITEM_plasma_grenade.jpg Link R_Handle_1 Scale 0.2 MoveX 3 RotY -60
 Value 27 Attach WP_pulse_grenade.x Texture 0 ITEM_pulse_grenade.jpg Link R_Handle_1 Scale 1.7 MoveX 3 RotY -60
 Value 421 Attach WP_holy_hand_grenade.x Texture 0 ITEM_holy_hand_grenade.jpg Link R_Handle_1 Scale 0.6 MoveX 3 RotY -60
 Value 159 Attach WP_molotov_cocktail.x Texture 0 ITEM_molotov_cocktail.jpg Link R_Handle_1 Scale 2.5 MoveX 3 RotY -60

Download link
« Last Edit: January 04, 2013, 04:22:59 pm by Graf »

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #41 on: January 04, 2013, 04:19:24 pm »
EDIT: Good job, Graf. Nicely done. :)

It's because I didn't apply any clothing on the skin layer. :-[
Sorry, that was my bad.
Is this better?


Also, as it turns out, there indeed is no haircut that is a tad bit longer. I think I found something to occupy myself with...
« Last Edit: January 04, 2013, 04:21:26 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 #42 on: January 04, 2013, 05:43:07 pm »
I'm glad you are enjoying this Haraldx. I've uploaded all these items to the repository, and corrected the animation so that he stops playing with the knife.

I was working on the "walking" animation, but I could not achieve what I wanted, and I still can figure out a way to do it. So i might as well focus on something else. If anyone notices a  missing animation please tell me because I don't remember which of them are. 

For those who are working on this, please make a copy your folder before you update, just in case.

I set the coordinates for the sawed off to work as a pistol, and it seems that Graf did the same thing with the light support weapon. To make this work properly edit the file weapons.fopro inside server/proto/items.
 Find the ID 385 (sawed off) and change the value of Weapon.Anim1= from 10 to 9
 Then the ID 355 is the LSW. Change it to 10 to make it work as a rifle. I think both weapons look great that way.

Offline Haraldx

  • This forum... The memories... The history...
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #43 on: January 04, 2013, 08:46:42 pm »
Behold, boys and girls! Arguably the dumbest thing I've ever created! Should have some somekind of nude skin for extra immature laughs.


Do we REALLY need this?

EDIT: ImageShack removed my image... Reuploaded to imgur.com. Let's hope they understand 3D art.
« Last Edit: January 04, 2013, 09:08:51 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 Alvarez

  • Forget the past, go outside and have a blast
Re: [TUTORIAL] Importing models for Items/Weapons into the game.
« Reply #44 on: January 04, 2013, 09:18:54 pm »
Mods on 2238 hate immature jokes, too.