Modding Help The Stepping-Stones to Genocide

Discussion in 'Starbound Modding' started by jjusalol, Apr 2, 2017.

  1. jjusalol

    jjusalol Void-Bound Voyager

    Hello fellow modders!

    Me and a few buddies have recently come together to create a new mod for Starbound, focusing more on making exploring the universe empty and atmospheric, (Very similar the good 'ol beta!). However, throughout the last few days, my group has run into quite the predicament! One of our points of interest was the ability to kill any NPC that the player wishes to attack, lending more player freedom that what is currently available in Starbound (And again, like the 'ol days). While most of our other features are currently underway, the ability to kill any NPC is the only brick wall (In terms of coding) that we've run into. If anyone knows of a variable or can even give us some baby-steps on how to make this possible, please post below!​
     
  2. bk3k

    bk3k Oxygen Tank

    I can try to help you with this, but probably not until tomorrow. Others might have it covered before that.

    However this has given me an excellent idea for a mod.
     
  3. Cyel

    Cyel Scruffy Nerf-Herder

    I think one easy way to do it would be to patch every .npctypes to change their "damageTeamType" to something like "passive" instead of "friendly"; damageTeams is what the game uses to decide what hits what.

    One thing that might cause problems is that, when being hit, npcs will go in their defined "hostileDamageTeam" (usually, enemy #1), and "broadcast" that to every other npcs near them, making them all run away from you if they're villagers, or attack you if they're guards; but that might be something you want.
     
  4. jjusalol

    jjusalol Void-Bound Voyager

    Thanks buddy, that's just what I'm looking for! :nurutease:
     
  5. Cyel

    Cyel Scruffy Nerf-Herder

    ^(if you want to test it out without patching everything, while hovering your cursor on an npc:
    Code:
    /entityeval npc.setDamageTeam({type = "passive", team = 1})
     
  6. XxMUGGESxX

    XxMUGGESxX Void-Bound Voyager

    Hello everybody,

    @jjusalol : Are you and your friends still working on this? If not can you tell me if you made any progress in making npcs attackable?

    So far I was able to make npcs ( expect like 2 guards in a town - maybe due to a specific subtype of guard which i did not change? ) attackable and killable. The main goal for me would also be to respond to the action you expose them to, for example: retaliate fire, turn hostile etc.
    Right now when I shoot such a npc they take damage but remain passive until getting killed ( for guards ) while villagers behave somewhat reasonable ( they run and scream in fear ^^ ). i mostly fiddled around with "damageteam" and corresponding things ^^

    Any input is highly appreciated and welcome :)
     
  7. ThreeTen22

    ThreeTen22 Astral Cartographer

    I believe you can just set them to hostile. The running behaviors from villagers and attack behavior from village guards are controlled by the behavior table rather than the "hostile" damageteamtype. Shadow villagers and friendly scavengers are proof of this, as even though they are intractable and "friendly" their damageteamtype is set to "hostile".

    (I believe the "attack on sight" behavior of hostile npctypes come from the "hostileguard" behavior table)

    damageteam determines who will react after you attack someone, as once attacked it broadcasts your action to every npc with the same damageteam in a given range. (so enemies can attack in groups, and multiple villagers run after you attack someone)
     
    Last edited: May 25, 2017

Share This Page