Jump to content

Fully Animated First Person Shotgun


Jason Campbell
 Share

Recommended Posts

Shotgun for Torque 3.6.3 by Jason Campbell


Note: Shotgun Fire Sound and Shotgun Reload Pump have a Creative Commons License please see readme.txt in the archive, if you use them, they are free to use with Attribution.


-BaUutFRskE


Screenshot at bottom of post.


Fully Animated First Person Shotgun. Third person included.


Use however you like.


Skip Part One if you are adding shotgun to existing project.


Part One: Adding shotgun to new stock T3D 3.6.3


Download the package here:


https://www.mediafire.com/?earxhuqvnw4t0nu


Drop the included game folder directly in your projects folder that contains your game folder.


Merge folders and say yes to over-writing.


Your new shotgun is ready to use. Hit 3 key ingame.



Part Two: Adding shotgun to existing project.


For the purpose of this asset, we will replace the Lurker Grenade Thrower(sorry that's what I did.)


Download the package here:

https://www.mediafire.com/?cxa9okrhmhnxivh


1.


Drop the included game folder directly in your projects folder that contains your game folder.


Merge with existing folders.


2.


Open game/scripts/client/default.bind.cs


and replace this:

 

moveMap.bindCmd(keyboard, "3", "commandToServer('use',\"LurkerGrenadeLauncher\");", "");

 

with this:

 

moveMap.bindCmd(keyboard, "3", "commandToServer('use',\"Shotgun\");", "");

 

If you have a config.cs also in game/scripts/client make sure you replace the above also.


3.


Open game/art/datablocks/datablockExec.cs


and under (// Load the weapon datablocks) add:

 

exec("./weapons/Shotgun.cs");

 

4.


Open game/art/datablocks/player.cs


under // Allowable Inventory Items add:

 

  maxInv[shotgun] = 1;
  maxInv[shotgunClip] = 8;

 

5.


Open game/scripts/server/gameCore.cs


in function GameCore::loadOut(%game, %player)


replace this:

 

%player.setInventory(LurkerGrenadeLauncher, 1);
%player.setInventory(LurkerGrenadeAmmo, %player.maxInventory(LurkerGrenadeAmmo));
%player.addToWeaponCycle(LurkerGrenadeLauncher);

 

with this:

 

%player.setInventory(Shotgun, 1);
%player.setInventory(ShotgunClip, %player.maxInventory(ShotgunClip));
%player.setInventory(ShotgunAmmo, %player.maxInventory(ShotgunAmmo));
%player.addToWeaponCycle(Shotgun);

 

6.


Open game/art/shapes/actors/Soldier/FP/FP_SoldierArms.cs



Add to the end of function FP_SoldierArmsDAE::onLoad(%this)


 

// BEGIN: Shotgun Sequences
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE run", "Shotgun_run", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE sprint", "Shotgun_sprint", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE idle", "Shotgun_idle", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE idle_fidget1", "Shotgun_idle_fidget1", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE fire", "Shotgun_fire", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE reload", "Shotgun_reload", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE fire_alt", "Shotgun_fire_alt", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE switch_out", "Shotgun_switch_out", "0", "-1", "1", "0");
%this.addSequence("art/shapes/weapons/Shotgun/shotgun_FP.DAE switch_in", "Shotgun_switch_in", "0", "-1", "1", "0");
  // END: Shotgun Sequences

 

That should do it.

shotgun2.jpg.5c9f67037379021c2bfac34eed9357eb.jpg

Edited by Jason Campbell
Link to comment
Share on other sites

Perhaps I should give instructions on how to leave the grenade launcher alone. The animations are just from the Lurker. The only unrealistic thing about the clip is the bolt animation. You should replace the clip then give one pump to fill the breach. Perhaps I could make that animation happen, actually. Or is there something else unrealistic about it?


This is sort of what I was going for.

IU-9870_LRG.jpg.5ac26fc5c0a3fedb0e68cebde1d6eb09.jpg

Link to comment
Share on other sites

Did not believe this thing really exists, but I looked it up and it is from an air soft shop, I have never seen this kind of design on a real shotgun and I don't think it exists, since this design does not make much sense.


I wondered where you got the animations from, but now I remember the lurker grenade launcher has such an reload animation, so you used that for your reload?


There is an even easier implementation, you don't need all this FP- and TP model stuff or animations in the .dae file, you can just go copy the lurker datablock, rename it and replace the model, change the settings and done.

Link to comment
Share on other sites

Look up the Grizzly semi auto shotgun. I'm confused, the design makes sense to me. Reloading can occur much quicker. They even make semi autos with drum mags.


Yes I used alt fire of the grenade launcher as shotgun fire. Regarding implementation, thats what I did. Copy the Lurker datablock with different spread and projectile count. The reason for two different models is for cleanliness. The third person model doesn't require any animations or bones so why not have a seperate model with only required nodes?


Of course you need animations in the .dae file. That is where they exist. The first person arms are not animated by themselves. They require the weapon for that.

Link to comment
Share on other sites

This looks great Jason, thanks for sharing! And thanks for sharing the script changes too, I'm sure that'll help out a lot of people, looking to add new weapons :P


Would you mind if I use this as a reference for a new wiki page?

 

No problem. I hoped it might be useful. Please do use it for the wiki. Though Torque does have a steep learning curve , once parts of it are demystified it becomes pretty easy to digest. Thanks

Link to comment
Share on other sites

You have to admit that you used quite some tricks for this resource, you rebranded existing animations and datablocks, but at least your weird shotgun looks good, even though it is amateurishly modeled.

Where did you get the sound files from?

Link to comment
Share on other sites

You have to admit that you used quite some tricks for this resource, you rebranded existing animations and datablocks, but at least your weird shotgun looks good, even though it is amateurishly modeled.

Where did you get the sound files from?

Duion please stop that tone, it's fine that you don't think it's a good model, I think it's good. If you think something could be improved, feel free to post tips, suggestions or point out specific flaws. No one can use "it is amateurish" for anything.


0la5DBtOVNI

Link to comment
Share on other sites

I would like to address those remarks, I'm not offended.


I mentioned on the GG forum post that this is my absolute first 3D Model that I have ever created and so I admit that I am an amateur but am relatively happy with this first effort.


I readily admit that I reused MIT resources to create the animation effect. I thought that it looked rather seamless with the other weapons since it uses their existing animations. I am not trying to take credit for anything except the 3D Model.


Before I start another project I want to learn about replacing the FPS arms and adding new weapon animations. Creating this resource really helped me to understand how everything works and gets me closer to better reaching my goal.


I would have loved this resource when I first got into T3D. The archive that contains all the files that need to be changed to create a new FPS weapon would have been real handy.


I put a lot of time into this resource on my free time it was more then just copying the lurker.cs and adding a model. Learning about weapon states for instance or learning how to skin/weight the bolt, clip and pump action to make the animation occur.


Finally, thank you Duion! I totally forgot to attribute the sounds! I re-upped the files and they now contain a README.txt with Attribution to the original sounds for the fire and pump action sounds. Both sounds are free to use under Creative Commons in any way as long as you attribute the sounds. Everything you need is in the readme.


Edit: False advertising? It is fully animated, some people lack the knowledge or tools to skin the weapon to the nodes and export correctly to make those animations work. I think it was pretty straight-forward and creative.


If you still think this shotgun is unrealistic here is a picture that isn't a air rifle.

http://i14.photobucket.com/albums/a335/67Rebel/magfed870pg.png


and another

http://i91.photobucket.com/albums/k293/mleduc/870%20-%2014/DSCF3912_zps9f2f9966.jpg

Link to comment
Share on other sites

Ok, I admit that you were right with the shotgun. And yes it takes a lot of time even for simple things, but I would have been amazed if you really had made a fully animated shotgun.

Once I tried to make an animated weapon with integration, but it was a pain and I gave up. Torque's system is just very complicated with that, you need first person animations, third person animations, animations for the arms, animations for the weapon etc and the soldier is not very modding friendly.

Link to comment
Share on other sites

I agree. I certainly have a lot to learn but I have made some gains on the FPS arms but no matter how well I weight the mesh it still deforms weirdly. I may have to suck it up and buy the Soldier Pack, I heard they have the original files included.


Seriously, thank you again for reminding me about the sounds!

Link to comment
Share on other sites

@Jason Campbell:


Thanks for this! Mind if I include it in my upcoming resource? Every pilot needs a shotgun ;)


Would you care to share how you used the Lurker anims? I thought to do the same as you've done here by adding my weapons to the existing anims, given that I'm still learning MAX and am not quite up to doing the anims from scratch.

Link to comment
Share on other sites

@Jason Campbell:


Thanks for this! Mind if I include it in my upcoming resource? Every pilot needs a shotgun ;)


Would you care to share how you used the Lurker anims? I thought to do the same as you've done here by adding my weapons to the existing anims, given that I'm still learning MAX and am not quite up to doing the anims from scratch.

 

Use it anyway you like. :)


Just be mindful of the sounds being CC Attribution 3. This just means that you can include the readme.txt I placed in the archive with your resource and it is legal. CC 3 means you can do anything commercially or not just as long as you give some credit, though I wonder who Sun of RA is?


I could go into more detail about getting your weapon animated but right now I'll be brief. This is what I did.


Created the Shotgun and saved it as a .max file.


Imported the FP_Lurker.DAE into MAX using OpenCollada.


Increased Animation frames to 692


Rotated and resized the Shotgun until the handle, trigger, and muzzle lined up with the Lurker.


Selected the Lurker mesh and deleted it. Unfortunately you have to delete the muzzle flashes. They don't export correctly. Something I am trying to learn.


I then added a skin modifier to the shotgun mesh and added the four nodes(bones) called bn_Ammo, bn_Bolt, bn_Grenade Launcher and bn_Root.


Then I selected edit envelopes and "ticked" vertices. I opened up the weight tool. It's the wrench by the weight table.


I selected bn_Gun_Root in the bones window. Selected all vertices by dragging the mouse over the whole model, and pressed the 1 in the top right corner of the weight tool.


I selected the bn_Ammo_Clip in the bones window and selected as many vertices as I could easily do and set them to 1.


Then I opened the Weight Table and scrolled through until I saw where I had given some vertices a weight of 1 and made an educated guess as to where the clip started and stopped. I selected that group by dragging my mouse to highlight the bunch and selected one in the group and turned it to 1. All selected turned to 1.


I then selected the bolt and isolated it vertices and gave it weight and likewise for the grenade launcher. The shotgun was pretty easy to isolate the vertices.


Through trial and error I got it and then when I played the animation it cycled through all the animations of the lurker.


I exported using OpenCollada making sure that animations were included and that it went to 692 frames.


All the animations are set and separated in the FP_Lurker.cs or in this case the FP_Shotgun.cs, then you have to mess about with the weapon states.


I have to go to bed.


Anyway, it would be easy enough to use a m16 or ak47 in the same way.


Enjoy. :)

Link to comment
Share on other sites

Selected the Lurker mesh and deleted it. Unfortunately you have to delete the muzzle flashes. They don't export correctly. Something I am trying to learn.

 

I thought it had to do something with a custom Collada exporter used by GG and not available for the public. But I could be mistaken...

Link to comment
Share on other sites

Found another issue, you made no shell ejector at the right side of the weapon, you have it on the left side, which is wrong, combined with a bolt the player handles, which is more wrong.

Textures are also wrong and do not load properly.

Link to comment
Share on other sites

I noted the bolt action as unrealistic in one of my first responses. I never claimed an ultra-realistic shotgun. I never claimed a fully animated third person weapon. The exit for spent casing, though wrong,is barely noticeable and easily fixable.


@Dioun, my new suggestion is that you do not use this. Understandably because of it's many flaws. :) Again, I'm not offended but you must admit, that you have a strange obsession with breaking this apart. I never claimed perfection but as a very first model I've ever made, it's not bad. I noticed it in that resource for WorldLab/Gamelab and sorry, it just doesn't look that out of place.


@Everyone else, I hope that this is a good base for making your own new weapons.


Edit: I'll fix the spent casing ejection and look into the texture mapping.

Edit2: I take that back, I'm leaving the shell ejection alone. This is a fantasy gun really that allows a bolt action to place a fresh round into the breach. Plus you never see the other side of the gun in first person so...I need to move on to other things.

Link to comment
Share on other sites

Yeah I gave it a try in my GameLab project and it's working. Wasn't that hard to make it an extra weapon but I noticed the bad material naming/texture mapping. I was planning to give a try to see if it's fixable with 3dsmax by loading the .dae. I never really tried to open animated .dae for edit.


Let me know if you plan to fix it, else I will proceed with updating the mapping.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...