Modding Help Is there a way to make a weapon which harms the user?

Discussion in 'Starbound Modding' started by Melendroach, Apr 25, 2017.

Tags:
  1. Melendroach

    Melendroach Subatomic Cosmonaut

    I want to make some weapons like stabbing knife and vampire knife, and I want them to harm the user. Is there a way to do this?
     
  2. Cyel

    Cyel Scruffy Nerf-Herder

    Yes, if you make your own script, you could use
    Code:
    #### `void` status.applySelfDamageRequest(`DamageRequest` damageRequest)
    
    Directly applies the specified damage request to the entity using this status controller.
    
     
  3. Melendroach

    Melendroach Subatomic Cosmonaut

    I'm kind of confused...
    Where do I put this?
     
  4. Cyel

    Cyel Scruffy Nerf-Herder

    What you want to do is doable via the Lua API; you wouldn't just "put" that somewhere, you'd have to make your own Lua script that'd use it, and require it in your weapon's config
     
  5. Melendroach

    Melendroach Subatomic Cosmonaut

    oh... so it's impossible to do it in vanilla.
    Well, nevermind then.
     
  6. Cyel

    Cyel Scruffy Nerf-Herder

    activeItem scripts are client-side, so you could use it on vanilla servers / with vanilla clients and they'd work, but you wouldn't be able to share them; if you were to give it to someone who doesn't have said script, they'd crash
     
  7. Melendroach

    Melendroach Subatomic Cosmonaut

    yeah yeah, that's what I meant. Thanks for information!
     

Share This Page