Search Unity

Gun Scripting Framework (artist oriented)

Discussion in 'Works In Progress - Archive' started by why789, Apr 19, 2012.

  1. why789

    why789

    Joined:
    Sep 23, 2011
    Posts:
    184
    Hey!

    I want to know what you guys think of a framework to script guns easily!

    When I say framework I'm referring to having most of the worker functions and very common operations automated and all YOU need to do to get access to those is a one line piece of code.

    Here's an example of all you need to do to make a simple semi automatic rifle:
    Code (csharp):
    1.  
    2. public class scr_Rifle : BaseGun {
    3.  
    4.     void Update () {
    5.     GF_CheckInput(isAutomaticWeapon);
    6.         GF_CommonUpdate();
    7.     }
    8.        
    9.     public override void Fire () {
    10.         if (GF_CanShoot()) {
    11.         GF_CommonFire();
    12.         }
    13.         else {
    14.         Reload();
    15.         }
    16.     }
    17.    
    18.     public override void Reload () {
    19.         if (GF_CanReload()) {
    20.                 GF_CommonReload();
    21.         }
    22.         else return;
    23.     }
    24. }
    25.  
    All of the functions that have Common in them are just very common things that would need to be done. Like in GF_CommonUpdate() there would be the checks for the reloading and shooting variables, things that would pretty much be the same in any gun. CommonFire() is pretty much a very common shooting, it would work for: Sniper Rifles, Machine Guns, pistols any other gun that shoots one projectile at a time.

    GF_CommonReload would be used in any gun that reloads all the bullets possible, and if there aren't enough bullets to fully reload, use all of the bullets available.

    What do you guys think? Would this help you? Would you buy it? If you would buy it what would you pay for it?

    Looking forward to your replies!
    why789
     
  2. why789

    why789

    Joined:
    Sep 23, 2011
    Posts:
    184
    bump, is anyone interested in this?
     
  3. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,877
    I think the Dastardly Banana guys already have a pretty robust weapons framework in place and not only that, but they also have it setup for FPS controls as well. Not to mention their entire package and setup is 100% free. I think you might be on an uphill battle.
     
  4. why789

    why789

    Joined:
    Sep 23, 2011
    Posts:
    184
    it's free??? I just checked it and it says $75 on the Asset Store..

    anyway, I didn't see that something similar has already been released.

    thanks,
    why789
     
  5. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,877
    Ah maybe they do charge for it now? In that case jump in the ring. It used to be free download from their own website as a Unity package file. Sometimes I catch stuff like this, and I thought it would help. I know time is money or time doing something and not getting the payoff is lost money...so it's best to try and get into a niche that isn't offered free already or isn't really oversaturated with products.
     
  6. why789

    why789

    Joined:
    Sep 23, 2011
    Posts:
    184
    I see. gotcha,

    thanks
     
  7. davew175

    davew175

    Joined:
    Aug 10, 2008
    Posts:
    56
    @JamesArndt - The Dastardly Banana Free package is still available for download but we're not enhancing it anymore. The 1.x version is on the Asset Store for $75.00. We'll be releasing an update in May to add iOS and Android support and will follow that with multi-player.
     
  8. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,877
    @davew175 - well it's a great free product. Thanks for putting that out there!
     
unityunity