Modding Help Pointable throwables?

Discussion in 'Starbound Modding' started by CaptainMadoc, Dec 18, 2013.

  1. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    I'm still trying (and failing) to find any way to make throwing items that can be pointed in any directions similar to guns. The reason is so that I would try to make this into a workaround to compensate for the lack of guns or anything similar having a number pool or ammunition stack. So far, I have found that all weapon types have their attributes hardcoded into the game, and that I cannot, say, implement ammoUsage or Durability on a gun, or anything similar.

    This is unfortunately driving me into a corner, and making me consider abandoning the idea of limited ammunition stacks by means of a "throwable gun", and instead settle for a potentially substandard compromise, such as high energy consumption, to emulate weapon reloading.

    And here I was hoping I could do something to put all unused metal bars to good use. Oh well... If anyone has any ideas on how to solve this issue (it doesn't have to be limited to throwable guns, as some in IRC has told me), I would highly appreciate it. Time to brace myself for the worst, in the meantime...
     
  2. Bucketlamp

    Bucketlamp Giant Laser Beams

    you mean like the throwing knives/stars, needles, etc? Except, using energy.
     
  3. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    That's one way of putting it. But no, I was more referring to something more similar to a repeating crossbow or something silly like that, that relies on limited numbers of ammunition stacks of itself, basically a throwable, but with the paintjob of another weapon that is not a throwing weapon. Not quite sure what you refer to though.
     
  4. Bucketlamp

    Bucketlamp Giant Laser Beams

    There are a large variety of throwing weapons early on in the game in chests, throwing stars\throwing knives. Also, there isn't really a lack of guns in Alpha-beta. More and more airships are being found. However if you're talking about weapons that are ranged with durability or limited ammo pools, I believe that was discussed multiple times on multiple threads, I had seen one based on ammo just earlier today.
     
  5. codebracker

    codebracker Subatomic Cosmonaut

    I wish someone made a railgun, It could fire anything metalic for heavy damage, but would use all your energy per shot.
     
  6. Westeller

    Westeller Space Penguin Leader

    You can make that, if you want.
    Throwables, like guns, consist of weapon + projectile

    The projectile for throwables tends to look like the weapon, ofc, but it doesn't have to.
    A throwable crossbow that has ammoUsage and shoots bolts is absolutely doable.
     
  7. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    You're certain of this? I must have overlooked something crucial, because I was not able to even bring a craftable javelin to work, as it does not appear in game, for testing purposes.

    I will perhaps see to scrambling a quick crossbow for further testing of your advice later today. I'm not looking forward to failing this again, though...
     
  8. Westeller

    Westeller Space Penguin Leader

    Hmmm? No, of course I'm not certain. I'm always full to the brim with self doubt, can'tcha tell?
    Anyway, check it out, here's the .thrownitem for a javelin:

    Code:
    {
      "itemName" : "javelin",
      "rarity" : "Common",
      "inventoryIcon" : "javelinicon.png",
      "image" : "javelin.png",
      "shortdescription" : "Javelin",
      "description" : "A sharp javelin.",
    
      "ammoUsage" : 1,
    
      "edgeTrigger" : true,
      "windupTime" : 0.0,
      "cooldown" : 0.4,
    
      "projectileType" : "javelin",
      "projectileConfig" : {
      "speed" : 45,
      "power" : 20
      }
    }
    
    This is under \items\throwables\
    The .thrownitem is what you equip. This is the weapon.
    Notice that it has a projectile, type "javelin".
    If you mosey on over to the projectiles folder, you'll find javelin.projectile....

    ...errrr....

    Whaaa, it's under \projectiles\guns\unsorted\javelin\ !

    What on earth is it doing there!?

    ...Anyway, here we have javelin.projectile:

    Code:
    {
      "projectileName" : "javelin",
      "physics" : "arrow",
      "frames" : "javelin.png",
      "level" : 5,
      "animationCycle" : 0.25,
      "frameNumber" : 1,
      "damageKindImage" : "icon.png",
      "timeToLive" : 30,
      "pointLight" : false,
      "actionOnReap" : [
      {
      "action" : "config",
      "file" : "/projectiles/explosions/bulletexplosion/bulletexplosion.config"
      }
      ],
      "power" : 25,
      "damageKind" : "default"
    }
    
    This is the projectile, what you actually "throw".

    Both the weapon and the projectile have their own images.
    You can change the weapon image without changing the projectile images.

    If you want, then, you can totes make a weapon that looks like a crossbow, has ammoUsage as a throwable, and fires bolts as projectiles.
    You could also make guns that use ammo and other stuff, as well.
     
    michealv likes this.
  9. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    Ah, yes, I have tried to do something like that, but wouldn't making the crossbow a throwable at its base make it so that the weapon stays aimed at the bottom? I recall that throwables would have a throwing animation, but... I don't think it quite works the same way as pickaxes or axes do.

    Is there some sort of sprite sorcery that makes throwables stay aimed at the bottom, but not guns?
     
  10. Westeller

    Westeller Space Penguin Leader

    Well let's take a look, shall we?

    Here we have everyone's favorite gun, the brain extractor:

    [​IMG]

    Hmmm. It just has an icon and a single image, aye?
    There are no full sprite sheets involved.
    Let's take a look at the .gun:

    Code:
    {
      "itemName" : "brainextractor",
      "inventoryIcon" : "brainextractoricon.png",
      "dropCollision" : [-8.0, -3.0, 8.0, 3.0],
      "maxStack" : 1,
      "rarity" : "Rare",
      "description" : "Terminating a common monster with this gun will extract its brain.",
      "shortdescription" : "Brain Extractor",
      "image" : "brainextractor.png",
      "handPosition" : [-3.5, -3],
      "firePosition" : [20, 1.5],
    
      "fireTime" : 1,
      "twoHanded" : true,
      "level" : 1,
    
      "projectileType" : "brainshock",
      "projectile" : { "speed" : 2,
      "power" : 12,
      "color" : [10, 255, 10]
      }
    }
    
    Right off, we can see that it has a handPosition and a firePosition. Do you think those are relevant, and can they be added to a throwable?
     
  11. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    Admittedly, I have not looked into handposition and fireposition. I have doubts those will work for a throwing weapon, but I will give that method a try later today.
     
  12. michealv

    michealv Industrial Terraformer

    @ Westeller you are a master my friend, thanks so much for your example its perfect!
     
  13. kirbydunker85

    kirbydunker85 Poptop Tamer

    Just fyi, .thrownitems cant use fireSound, so they cannot make a sound when throw, at least in my experience. I made scorpions spear from Moral Kombat, and I can only get it to play a sound when thrown when using a .gun file.
     
  14. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    That... is not good. Have you heard of any workaround for *that* specific issue?
     
  15. kirbydunker85

    kirbydunker85 Poptop Tamer

    No, and Im mad because custom sounds aren't working, even when I convert them to the proper bit, I dunno, i feel like there is no help on this forum.
     
  16. CaptainMadoc

    CaptainMadoc Phantasmal Quasar

    Well, Westeller, I tried putting in HandPosition and FirePosition on a throwable item's .throwable file. Sadly, it did not work, the weapon still aims down.

    Back to the drawing board.
     
  17. tifel100

    tifel100 Void-Bound Voyager

    Really.. just cause you couldn't fix your problem, it means that there is no help, you can see above that there were around 5 people who tried to help, and a lot more on different posts.
     
  18. michealv

    michealv Industrial Terraformer

    Don't give up just yet.

    You could try manually typing in the code that guns use, for sound, and maybe just edit the muzzle effect a bit.

    "muzzleEffect" : {
    "animation" : "/testgun/muzzleflash/testgunMF.animation",
    "fireSound" : [ { "file" : "/testgun/sfx/testgunsound.wav" } ]
    }
     

Share This Page