Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Dastardly Banana -(Free) FPS Weapons Package UPDATE- 0.95

Discussion in 'Assets and Asset Store' started by Jason_DB, Mar 29, 2010.

  1. Mimetic

    Mimetic

    Joined:
    Apr 27, 2010
    Posts:
    35
    No problem, if I figure anything out (highly unlikely), I'll let you know!
     
  2. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Hey Mr.Banana,

    Nice work on the kit, man. It rocks!

    Also - thanks so much for the mention on the radar. I really appreciate it :)

    Cheers!
    Jeff.
     
  3. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Just thought about a nice addition, what about the possibility of changing the crosshair color when you aim at enemies or friends?
     
  4. wizardious

    wizardious

    Joined:
    Dec 31, 2009
    Posts:
    189
    Hey
    I have a couple of questions and hope Banana or someone could help me out. I managed to get my gun model in the game and it fires and reloads fine, however, I get a "deselectWeapon has no reciever" error. Anyone have any idea what I need to do to fix this?
    Also, I am having trouble with the zoom feature. I have tried both downsight (after setting zoom gun position), and scope texture zoom, but can't seem to get them to work. I have set the input fire2 to mouse 1, and it works in the demo, but in the tutorial, I can't get it to work. Any ideas?
    Thanks
     
  5. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    I would suggest opening the Demo scene and seeing if that works properly. If it does, then just find what's different between the demo weapons and yours. "deselectWeapon has no reciever" sounds like an issue with playerWeapons, so make sure that your weapons are dragged into the "weapons" slot of that script.
    Also what specifically goes wrong with the zoom?

    I hope this helped
     
  6. wizardious

    wizardious

    Joined:
    Dec 31, 2009
    Posts:
    189
    Hey Banana
    Thanks for taking the time to help. I went over the demo and now the gun works great! Not really sure what the problem was, but everything works now. I just have to figure out how to make it "pickupable". Seems pretty tricky, but I will try.
     
  7. wizardious

    wizardious

    Joined:
    Dec 31, 2009
    Posts:
    189
    Just a couple pics of the weapon package in action. I managed to make my first weapon "Pickupable". :)



     
  8. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Those look great! (The weapon model is really professional looking). I'm glad you were able to get the pickup working (I'm going to post a tutorial once I have a little more time on my hands).
     
  9. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Banana rocks!
     
  10. psychicparrot

    psychicparrot

    Joined:
    Dec 10, 2007
    Posts:
    884
    Banana rocks!
     
  11. GrimWare

    GrimWare

    Joined:
    Jul 23, 2009
    Posts:
    211
    Yeah I'd like a tutorial for learning how to "pick" and item up 8)

    Looking forward to that :)
     
  12. wizardious

    wizardious

    Joined:
    Dec 31, 2009
    Posts:
    189
    Hey Banana
    I'm having difficulty understanding one of the aspects of the demo scene. None of the weapons appear in the scene view or on the camera's, until they are equipped. How is this accomplished? I thought perhaps it had to do with layers and culling, but that does not seem to be the case.
    I have several guns and I don't understand how to make them "invisible" until selected.
    Thanks :?
     
  13. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    It actually just deactivates the renderers of the unselected weapons. You can easily do this by hitting the "toggle active" button on the gunscript which will automatically deactivate the renderers of that weapon. Also, any weapon equipped by the player (dragged into the weapons array of playerweapons) will automatically deactivate when the game is started.
     
  14. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Hi Banana,

    I just walked through your tutorials and implemented a simple M16 into my game - I noticed a slight bug with aiming down the sights (I checked and it is also present in the official demo scene, so I dont think it's anything that I did)

    When you move and then aim down the sights quickly after, or while you are moving, your accuracy becomes skewed. I'm aware that moving affects accuracy - but in this situation I would be strafing right, stop, and then aim and shoot. When I do this my accuracy is as if I were not aiming down sights. When I click off and click on sight aim again, it reverts to the correct accuracy. So maybe some check is not being applied based on the movement and quick transition to sight aim mode.

    I say small bug, but it is very noticeable especially if you are moving quickly in a fast paced game.

    Other than that I'm very happy with the system! Oh yes and a weapon pickup tutorial would be great too (you make very clear and concise tuts - props!)

    cheers
     
  15. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    I just found the problem and fixed it. I'll put it up in an update (with a little bit of other stuff) soon, but in the meantime you can add in this code to the StopWalking() function in gunscript:
    Code (csharp):
    1.     if(GetComponentInChildren(aimmode).aiming)
    2.         spreadRate = aimSpreadRate;
    3.  
     
  16. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    w00t, you guys rock!

    I added another line to change the spread too as well as the rate and it worked a bit better.

    Code (csharp):
    1.  
    2. if(GetComponentInChildren(aimmode).aiming){
    3.       spreadRate = aimSpreadRate;
    4.       shotSpread = aimSpread;
    5.       }
    6.  
    I was also the schmuck who just emailed you about hitting "Is Trigger" colliders with bullets, figured I probably should have just put it on here.

    This is starting to shape up into a great system!
     
  17. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Okay, the way to fix this is to find the part in the gunscript (function FireOneBullet()) where it says this;
    Code (csharp):
    1. var layerMask = 1<<8;
    and change it to this:
    Code (csharp):
    1. var layerMask = 1<<8 + 1<<2;
    Then all you have to do is put your trigger objects in the "Ignore Raycast" Layer and the bullets won't hit them. I'll put it in the next update, but I need to finish some stuff (shell ejection and bullet penetration) before I post it up (there might also be a new model in it).
     
  18. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Thanks man, that fix worked perfect!

    Shell ejection and bullet penetration - wow! Two great features - add snap targeting in there and we're that much closer to Call of Unity. Ok one terrible pun was enough for the day...

    I'm not sure if you have a roadmap laid out for future releases but here is my little wishlist:

    -Melee weapon support (possibly if you could make it attachable like a secondary weapon it could serve as a solo weapon (HL crowbar) or a secondary weapon (pistol whip/ rifle bash)

    -Head bobbing system - I think there might be some others out there, but having one tied in with this system would be great, as well as being able to change the bob intensity as well as say rate/factor based on if you're sprinting or not.

    -Ability to add custom crosshairs - we made a system that used different textures and then spread them out on the screen using code - probably similar to how you did the GUI rects - it's not polished but I could send the project to you if you wanted.


    Other than that I'm just really impressed with the quality of this work. I'm sending off a very modest paypal, and hope to contribute more when I'm not strapped for cash (moving from China back to the U.S.)

    This is really helping me focus on level design rather than having to spend so much time on combat mechanics.

    You rock.

    Jesse
     
  19. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Oh, probably more important than the others, I forgot about this:

    A better clips system which recycles the ammo you have in case you reload (if you're like me and like to reload every few shots when there's a lull in the action so you go into battle with a full clip) - currently if you do this you throw out the clip.


    Ammo recycling is a bit unrealistic but most games seem to do this now.

    Interestingly Firearms a mod for Half Life had feature where you could do this but you had to press a key to physically merge the clips. That was kind of cool.
     
  20. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Well the ammo recycling actually has already been done (you can choose between that and the more realistic by-clip reloading), I just need to finish the other additions before I can put it up. Also thanks for all your suggestions, they're really helpful since otherwise I wouldn't really know what to change.
     
  21. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Something very important that I think you should add is the possibility to change the Spark effect dependding on what you are hitting.

    It could be done with Tags.

    :D
     
  22. CorruptedHeart

    CorruptedHeart

    Joined:
    May 4, 2010
    Posts:
    379
    Is there anyway the tutorials could be offered in HTML or PDF form? as I have limited bandwidth and downloading movies is off the list for me.

    Regards,
    Garth
     
  23. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Unfortunately typing out the tutorials (while it is something I want to do in the future) isn't something I can realistically complete anytime soon since it would take quite a bit of work to do so and there are a lot of updates I need to do to the code. A lot of it is pretty self-explanatory, though, so I hope that in the meantime you can get the information you need from the demo scenes.

    Also in an unrelated note bullet penetration has just been finished in addition to a crucial change to the way reload animations are played (you will be able to determine how long they take using the reload speed variable), and the next additions should be bullet hole decals and varying spark effects based on what gets hit.
     
  24. CorruptedHeart

    CorruptedHeart

    Joined:
    May 4, 2010
    Posts:
    379
    I understand perfectly... I will just do my best to work through the code and demo scene in order to understand where everything goes and setting up levels and such...

    However thank you for a great product :)
     
  25. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Thanks for understanding; I'm sorry that we can't post typed tutorials right now but if you have any questions feel free to email me at info@dastardlybanana.com
     
  26. Disati

    Disati

    Joined:
    Oct 5, 2009
    Posts:
    111
    Great project. Hope to see more of this.

    And a BIG thanks, banana!
     
  27. hankphone

    hankphone

    Joined:
    Jan 25, 2010
    Posts:
    48
    When do you guys expect to have the next update available for download?

    Thanks!
     
  28. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Today or tomorrow, actually ;-)

    with 0.92 we're adding the following:

    -Bullet Penetration
    -Shell Ejection
    -Ammo conservation for reloading (as an option)
    -Reload Animation of weapons now changes speed based on reload time of gunscript
    -Bullet Hole Decals
    -Color-Changing Crosshair (shows friends, foes, and objects of interest by changing color).
    -Various bug Fixes
     
  29. Armagon

    Armagon

    Joined:
    May 29, 2009
    Posts:
    246
    Really amazing, guys. Thank you for providing such a great project for the community. :wink:
     
  30. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Indeed, this has to be one of the best projects.
     
  31. hankphone

    hankphone

    Joined:
    Jan 25, 2010
    Posts:
    48
    Fantastic, can't wait to check it out.
     
  32. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    The update is done, a little delayed because we ended up spending some time working on a nifty custom editor to add one of the new scripts easily into the scene. At this point we're starting on the documentation (mostly a video walkthrough/tutorial for the new 0.92 features) and testing so the update should be up tomorrow.

    I'm actually pretty excited since the last update was mostly behind-the-scenes improvements where this one adds some neat new features!
     
  33. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    If you are excited, you have no idea how much we are. :D
     
  34. viral-vector

    viral-vector

    Joined:
    Apr 12, 2010
    Posts:
    248
    Thank you soo much. I dint use the cop out method of just slapping your your system on. Simply because i am looking to create my own scripts, but you have been an inspiration, and have been able to look at your examples and scripts, in creating my own system for a learning project. Currently trying to figure out recoil, and sway are done.

    Keep up the good work.

    check out my game as well, and comment as you are an expert i need the best feedback
    http://forum.unity3d.com/viewtopic.php?p=322525

    LONG LIVE THE BANANA lol
     
  35. Mimetic

    Mimetic

    Joined:
    Apr 27, 2010
    Posts:
    35
    how far away is it?! Can't wait to check out the new stuff :D
     
  36. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Very soon, we finished the package and I'm editing the tutorial now! :D
     
  37. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Hey,

    The 0.92 beta release is now available from the Dastardly Banana website! It includes new features such as bullet decals, shell ejection, bullet penetration, context sensitive color for crosshairs, as well as several bug fixes. So check it out!

    There is also a new video tutorial on the site showing off how to use the new features, so make sure to give that a look, too.

    Also, we've had a couple of people donate to the project, and we'd like to give them our sincerest thanks. We've put a lot of work into this and would like to turn this into a career, so getting a donation means a lot and helps us support this project with more updates. To thank the people who've donated (and anyone who decides to donate in the future!) we're going to start putting up extra content for those who donate (special weapons, models and tools including the AK-47 model in the demo scene). Don't worry about these interfering with the project, though; it's just going to be nice bonus stuff as but the main content will always be free and we will continue to expand on it.

    Finally (I know this is getting long), we would also like to thank you guys for the amount of support we've been getting on this post, it's really nice to see that people like what we're doing, and your suggestions are always helpful.

    Now go get it! And keep an eye out for more updates (maybe there'll be melee weapons in the future...)
     
  38. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    If I could pay in the interent I would surely donate.

    Someday I will have to get a credit card.


    Great work on the update, can't wait to test it out!


    edit: I dont know if it possible, but maybe doing something to make the instalation of the updates over the old version easier would be nice.

    I have to manually fix many bugs when I install the updates, sometimes even redo everything.

    Maybe its just me, lol.

    edit2: I keep getting an error and I think its the reason why my weapons seem to have unlimited ammo, no sound, and no muzzle flash effect.

    Its the same error each time i fire a weapon
    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Type[] cacheKeyTypes, System.Object[] args, Boo.Lang.Runtime.DispatcherFactory factory) [0x00000]
    3. Boo.Lang.Runtime.RuntimeServices.Dispatch (System.Object target, System.String cacheKeyName, System.Object[] args, Boo.Lang.Runtime.DispatcherFactory factory) [0x00000]
    4. Boo.Lang.Runtime.RuntimeServices.SetProperty (System.Object target, System.String name, System.Object value)
    5. gunscript.Kickback ()   (at Assets\Weapon Script\Scripts\WeaponScripts\gunscript.js:554)
    6. gunscript.FireShot ()   (at Assets\Weapon Script\Scripts\WeaponScripts\gunscript.js:281)
    7. gunscript+Fire$301+$.MoveNext ()   (at Assets\Weapon Script\Scripts\WeaponScripts\gunscript.js:256)
    8. UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
    9. UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
    10. UnityEngine.Component:BroadcastMessage(String)
    11. playerweapons:Update() (at Assets\Weapon Script\Scripts\WeaponScripts\playerweapons.js:36)
    12.  
     
  39. viral-vector

    viral-vector

    Joined:
    Apr 12, 2010
    Posts:
    248
    Great Work. Like i said " An Inspiration"

    Having some problems with my game, can you guys please look at it. i will def appreciate the help, and soon will donate. As soon i i get paid for mawing lawns
     
  40. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    As far as making installation easier, that is definitely something we'd like to do and which we will work on in the future. The strange thing is that his update shouldn't have caused any problems, since all of the changes either don;t require you to modify anything or are inactive until manually set (if you were to overwrite the scripts on import).

    As far as the glitch is concerned, the problem is that a small error can mess up the entire script. The most likely cause of this problem is that one of the guns has "shell ejection" turned on but no shell or ejector position, so try checking that. Also, is the problem happening with the demo scene guns or only on yours?

    I hope this helps,
    Jason
     
  41. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Thanks for the reply, but Shell ejection is not activated. :?

    Well, dont worry. I will just set up the thing from 0 again.

    The problem is in my project, not the demo.

    edit:
    Wow, fixed it? I deleted the files, and rimported them all.

    Looks like when I replaced them, they didnt replace right. :oops:

    The only thing i have problems with is the color croshair.i think the camera is doing weird stuff, because i point at the object (enemie) and nothing happens.. white croshair.. but sometimes when i aim a bit away from it, like aiming at the sky sometimes the croshair turns red.

    Weird eh?
     
  42. maju

    maju

    Joined:
    Nov 5, 2009
    Posts:
    29
  43. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    You can use it for a commercial project, the only actual requirement is that you mention the dastardly banana weapons package in the credits. Aside from that we would suggest that you make a contribution (via the paypal link on our site) and that you send us a link to a website/demo of the game so that we can put a link to it up :) .
     
  44. Jingle-Fett

    Jingle-Fett

    Joined:
    Oct 18, 2009
    Posts:
    614
    This is a great package, I'd been looking for something like this for a while and it should fit in nicely with the game I'm working on (I notice how it has a lot of the mechanics Modern Warfare has :D)

    I'm incorporating it into my project but I have one question (sorry if it's been asked before or if it's an obvious answer!). I've gotten everything working perfectly but is there a script or something for an ammo pickup? Like to fill up the ammo count of a gun once it's out...
     
  45. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Well there isn't a script included, but you can easily add ammo if you get a hold of the weapon and add to the "clips" variable.
     
  46. NoMaD

    NoMaD

    Joined:
    Feb 1, 2010
    Posts:
    41
    Hi. Great job on your project, I love it. The only thing that bugs me is that when you aim and walk you still get the same sway rate. Can you make like an aim sway rate modifier variable? :)
     
  47. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    Actually the sway rate does change based on the player's speed, so it will sway slower when crouching or aiming. We are looking at adding a new variable so that you can tweak the aim sway rate (or stop it outright), though.
     
  48. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Im enjoing the new update alot.

    Just a few suggestions for next versions:

    -Shells can be affected by gravity and fall on the ground. (After X time they dissapiar)

    -Bullet holes can "adapt" their shape for non planar models (Hope you understand, I dont know how to say it).

    -And well, like diferent bulletholes were added, diferent spark effects should be added.


    Hope to see this in future versions :)
     
  49. Jason_DB

    Jason_DB

    Joined:
    Nov 30, 2008
    Posts:
    495
    - Well we tried making them rigidbodies but the movement speed of the player caused it to look awful when you fired while moving, so that's why they don't have actual physics.

    - We're actually working on this, but it's complicated and could take a while

    - We're also working on this for a future update
     
  50. coin-god

    coin-god

    Joined:
    Jan 21, 2010
    Posts:
    325
    Sounds great, take your time.