Modding Help Can I make the player's own projectiles affect themselves?

Discussion in 'Starbound Modding' started by The Observer, Oct 13, 2014.

  1. The Observer

    The Observer Phantasmal Quasar

    Is there something I can add to a sword or other weapon to make its projectile affect the player as well? For example, I made a sword spawn rungas and runstatusprojectile, but the player doesn't seem to be affected by it. "universalDamage" : true doesn't seem to do anything.

    Alternatively, I understand that statuses can be called during the windup and cooldown, etc, phases of a swing, but is there any way to prevent those form expiring immediately after the phase is over?
     
  2. Riuny

    Riuny Big Damn Hero

    Not really sure this is right or not but I assume it has to do with "damage team" and "parentID" variables. The parentID of the projectile spawned by .sword or .gun file is automatically set as the owner of the weapon. It shares same damage team with its parent so it cannot damage its owner.
     
  3. Not that I have been able to find. Im assuming you want to give the player a status effect while the player has out a specific weapon? I don't really know if that is possible. One thing you could TRY (And I dont know if it will work) is to add in the status effect JSON data that corresponds to the armor effects and see if it registers. I dont think the weapon class has those properties though but it is worth a shot.
     
  4. Riuny

    Riuny Big Damn Hero

    I tried that once and it didn't work. As far as I know, I don't think it is possible to spawn projectile that affects the owner without using LUA.
     
  5. I agree completely, but unfortunately we dont have Lua access at this point.
     
  6. The Observer

    The Observer Phantasmal Quasar

    I'm in nightly, so I DO have Lua access.

    All right. Think this might work?

    status on cooldown -> calls projectile with world.spawnProjectile -> That projectile calls the required status.
     
  7. Riuny

    Riuny Big Damn Hero

    Hmm. Never tested in nightly build(since it always crashes in my computer somehow). But, if you can get access to LUA, I believe you can modify the damage team of spawned projectile and make it possible to affect the owner.
    And about the thing you asked that might work or not, I think you can implement it without using status effect if you're accessible to LUA.
     
  8. The Observer

    The Observer Phantasmal Quasar

    Understood. For the moment, I'll see if my method works, since I'm a noob at modding and have no idea how Lua might be used to change its damage team on the fly, or how I might inject the script into the weapon.
     
  9. You cant right now unless it is a generated gun... not a sword.
     
  10. The Observer

    The Observer Phantasmal Quasar

    Nope, it doesn't work. The status spawns the projectile just fine, but it keeps its damage team.

    Bah, will just have to think of another way.
     
  11. The | Suit

    The | Suit Agent S. Forum Moderator

    The sad part is back in December you could have. They removed the feature where you can hurt your self.
     
  12. Riuny

    Riuny Big Damn Hero

    I think they should re-implement that. I mean, really, it is kind of absurd that you can fire rocket launcher in zero-distance and take no damage at all.
     
    The | Suit likes this.
  13. Enel

    Enel Scruffy Nerf-Herder

    You can try, add an statuseffect with direct damage, like burn.
    you can do that in a sword for example
     

Share This Page