Modding Discussion Aggressive behavior of accompanying NPCs, any mod that solves it?

Discussion in 'Starbound Modding' started by davoker, Sep 14, 2018.

  1. davoker

    davoker Cosmic Narwhal

    I always go with NPCs that I contract for the ship, but these NPCs often attack innocent races like the Frogg or the shadows, because they attack them? Is this behavior linked to the type of NPC you carry with you? or is it an error?

    Is there any mod that prevents the NPCs that I carry from classmates from attacking other innocent NPCs like the ones I mention?
     
  2. Nexus Of Chaos

    Nexus Of Chaos Parsec Taste Tester

    it seems these "npcs" are actually considered monsters, but appear like an NPC wearing Frogg equipment or Shadow equipment respectfully. as these are actually monsters, crew will attack them
     
  3. davoker

    davoker Cosmic Narwhal

    There is no way to change the monster condition to that of NPC? if the monster form was changed to NPC they could not be attacked, poor Froggs and Shadows U_U

    The NPCs of other races, Avian, Floran, etc, can not be attacked, BUT, if you steal constantly they turn against you and you can kill all those NPCs.

    That means that NPCs change their status from NPC to monster, right? Can not this be done with the Sombra and Frogg races?
     
    Last edited: Sep 14, 2018
  4. projectmayhem

    projectmayhem Spaceman Spiff

    From frogvillager.npctype
    Code:
     "behaviorConfig" : {
          "hostileDamageTeam" : { "type" : "enemy", "team" : 1 }
        },
    from crewmember.npctype

    Code:
    "behaviorConfig" : {
          "emptyHands" : false,
    
          // Wander behavior config
          "wanderTime" : 1,
          "idleTime" : 10,
          "outerHomeRange" : 20,
          "innerHomeRange" : 15,
    
          "hostileDamageTeam" : {"type" : "friendly", "team" : 1}
        },

    I would assume, if you patch the frog npc's to be friendly, your crew shouldnt attack them
     
    davoker likes this.
  5. davoker

    davoker Cosmic Narwhal

    With that I have to start, thank you, I'll investigate the subject hehe

    Edit:

    It does not work, switch to friendly where it says enemy but if I can attack them, the NPCs that accompany me can also, if it works, I should not be able to attack them, I will continue investigating to see if I get it
     
    Last edited: Sep 14, 2018
  6. projectmayhem

    projectmayhem Spaceman Spiff

    try maybe adding this line of code, it only has to be inside the main { } tags.

    "damageTeamType" : "friendly"



    EDIT

    just to show you where i got that from, this is a bit of the top portion from the villager.npctype

    Code:
    {
      "type" : "villager",
      "baseType" : "base",
    
      "levelVariance" : [3, 3],
      "persistent" : true,
    
      "damageTeamType" : "friendly",
    
      "scriptConfig" : {
        "behavior" : "villager",
    
        "behaviorConfig" : {
          "greetingChance" : 0.5,
    
          "hostileDamageTeam" : { "type" : "enemy", "team" : 1 }
        },
    As you can see, it adds the damageTeamType inside the main { } and the hostileDamageTeam is seperate in the scriptConfig{}
     
    davoker likes this.
  7. davoker

    davoker Cosmic Narwhal

    I'm not sure I understand, I'll patch it to .patch, and add where that line adds json error, I'm still doing something wrong.

    Is that line to replace another? just add? I tried to "add it" but it does not matter where I put it in the file, when I want to pass the file to .patch I get a JSON error.

    Edit: I tried this now (to try xD)

    Code:
    [
      {
        "op": "remove",
        "path": "/scriptConfig/behaviorConfig/hostileDamageTeam"
      },
      {
        "op": "add",
        "path": "/scriptConfig/behaviorConfig/damageTeamType",
        "value": "friendly"
      }
    ]
    This does not give JSON error but it does not work, I'm doing tests to see if something works haha but as I told you I tried to add that line as you said but nothing, I do not know if I'm not getting it right.

    This has to be able to be done in some way xD
     
    Last edited: Sep 14, 2018
  8. The Avelon

    The Avelon Phantasmal Quasar

    https://community.playstarbound.com/threads/basic-patching-now-with-path-guide-v1-9.84496/

    Check out the input - expected output tool. Patching tables has a slightly different syntax than patching string values. Remember, the vanilla code on the left for for instance Frogg NPCs and then the code as you want it to appear on the right.

    You may also need to go to a new world to see the effects due to them being flagged hostile by default - I'm not sure if this is the case but if your patch works they may already be in 'hostile mode' and so you don't see the effects right away.
     
  9. davoker

    davoker Cosmic Narwhal

    If yes, I know how the patch works, I have a nexus translation and I have made many changes, I have added pages to the codex for a proper translation, I have modified the graphics and edited the parameters so that the texts appear correctly in the new graphics, in definitively I made many changes and additions, that's not a problem, but I still have to learn many things hehe

    I have not tried to go to a new world to see if the changes are effective, I'm going to try it now to see the result, thank you.

    Edit: Nothing, I've gone to another world in another system, I've even tried another savedata, I should not walk away from this but I'm getting away from it xD...
     
    Last edited: Sep 15, 2018
  10. projectmayhem

    projectmayhem Spaceman Spiff



    Try this patch, for frogvillager.npctype.patch

    Code:
    [
      {
        "op": "add",
        "path": "/damageTeamType",
        "value": "friendly"
      },
      {
        "op": "replace",
        "path": "/scriptConfig/behaviorConfig/hostileDamageTeam/type",
        "value": "friendly"
      }
    ]
     
    davoker likes this.
  11. davoker

    davoker Cosmic Narwhal

    heemmm, it works xD you told me to add this line:

    "damageTeamType": "friendly"

    It was my fault, that line did not add it to the file correctly, when I tried to patch (.patch) it gave me syntax error xD

    By putting it directly in .patch file like you have done, add the line in the right place and that's why it works, I feel like a fool xD

    I have gone to several worlds with Froggs and everything is fine, I can not attack them anymore *O*

    I'm going to see if I can do the same with the race of the Shadows in the file "shadowvillager.npctype", even though it looks different from the Frogg, shadowvillager.npctype does not have the line "" hostileDamageTeam ": {" type ": "enemy", "team": 1} "to change enemy for friendly.

    Maybe it's enough just to add that line that you told me, the "damageTeamType": "friendly", I'll try to see hehe

    Thank you very much for your help, it took me hours with this and in the end it was me that was not doing things correctly :facepalm:

    Edit:
    Yes, with the addition of the same line:
    Code:
    [
      {
        "op": "add",
        "path": "/damageTeamType",
        "value": "friendly"
      }
    ]
    
    It also works with shadows, that added in the file "shadowvillager.npctype.patch", What makes that you can not attack is that line that you told me, the file shadowvillager.npctype does not have the line "hostileDamageTeam": {"type": "enemy", "team": 1}, but works equally with that added hehe

    Problem solved, thank you very much for taking the trouble and for having so much patience :love:
     
    Last edited: Sep 15, 2018
    projectmayhem likes this.
  12. projectmayhem

    projectmayhem Spaceman Spiff

    Not a problem, always try to help with what I can, others have been so helpful with the massive amounts of questions I've asked lol
     
    davoker likes this.
  13. davoker

    davoker Cosmic Narwhal

    hehe, well, I'm going to add your name to the credits of the translation mod that I have in nexus mods, for the help with this code, it's the least I can do hehe

    It's something I wanted to do for a long time, it bothered me a lot to kill these races unintentionally, or that my companions (ship crew) that I was carrying with me attacked them indiscriminately xD

    And thanks in addition for the patience, that also the English is not my strong one, as you will have been able to verify, to read my texts in English is almost like to decipher a strange code haha

    PS: I wanted to do this with the Deadbeat, but I think with these it is not possible, using your code, to apply it to the Shadows and it works perfectly, but with the Deadbeats I think you can not because they seem to share files with the enemies, and if you change to "friendly" the enemies also become friendly haha

    I'm looking in case something escapes me, but maybe I can not deal with them.

    Regards!
     
  14. projectmayhem

    projectmayhem Spaceman Spiff

    Here is the beginning of the deadbeatthug.npctype

    Code:
    "type" : "deadbeatthug",
      "baseType" : "hostile",
    Since his baseType is hostile, changing or adding the other code wont work I think. But you could patch this, so that his baseType is "base" like the others.
     
    davoker likes this.
  15. davoker

    davoker Cosmic Narwhal

    I leave in spoiler what I had written before, you do not have to read it if you do not want xD I have achieved the same in the same way as with the Frogg and the Shadows, I explain.

    There are 3 deadbeat files in npcs:

    deadbeatbruiser.npctype ("baseType": "hostile",)
    deadbeatthug.npctype ("baseType": "hostile",)
    deadbeatscrounger.npctype ("baseType": "villager",)

    The key is in the one that says "villager", that seems to be the Deadbeat NPC that "does not attack", the friendly NPC, the other 2 files are the enemy deadbeat.

    I just had to change that in this file:

    "damageTeamType": "enemy",

    For this:

    "damageTeamType": "friendly",

    As the others, now that friendly deadbeat can not be attacked by the player or by contracted NPCs, only the local fauna can attack them, as any NPC by default.

    I took for granted that the file "deadbeatscrounger.npctype" had to be the friendly deadbeat because its basetype is "villager", the enemies are not "villager" ever, I think xD

    It has been quite simple, tested and working like the other 2 races hehe

    PS: What I had written before, no longer matters but here I leave it.


    What effect would that change have on the harmless Deadbeat and the enemies? I could still attack the harmless Deadbeat, right?

    The file "deadbeatscrounger.npctype" says:

    Basetype villager

    Would not this be the file of the harmless Deadbeat? those that do not attack, maybe it would be the correct file to edit with the appropriate command, I have to prove, if this file only refers to those Deadbeat, to the good ones, maybe something of what you told me with the Frogg will work.

    The other 2 files, "deadbeatbruiser.npctype" and "deadbeatthug.npctype", their basetype is "hostile", then I guess those 2 files are the enemy deadbeat, and the other, the one that says villager, would be the harmless Deabeat, I guess .

    I only suppose, if you look at the file, its dialogues:
    Code:
           "attack": "/dialog/deadbeat.config:attack",
           "reattack": "/dialog/deadbeat.config:reattack",
           "killedTarget": "/dialog/deadbeat.config:killedTarget",
           "lostTarget": "/dialog/deadbeat.config:lostTarget",
           "outOfSight": "/dialog/deadbeat.config:eek:utOfSight",
           "cheerOn": "/dialog/deadbeat.config:cheerOn",
           "cantReach": "/dialog/deadbeat.config:cantReach"
    That means that the dialogues that your basetype is "villager", are the dialogues of the enemies, the file deadbeat.config are the dialogues of the enemy deadbeat, the dialog of the harmless deadbeat is in the file "converse.config" , in the "human / generic" section within that file.

    Then that file ("deadbeatscrounger.npctype") must also be of enemy deadbeat? a bit confusing xD

    My theory is that the deadbeat NPC, the good NPC that does not attack, must be in another file, those 3 deadbeat files are enemies, and all 3 have deadbeat.config dialogues, that dialogue is only of the enemy deadbeat.

    Where is the harmless deabeat file that the converse.config file requires in its dialogues? that is the file that I have to find, it can not be any of those 3, I think.
     
    Last edited: Sep 15, 2018
  16. Charge Cannons

    Charge Cannons Void-Bound Voyager

    what does outerhomerange/innerhomerange do, is it something I should change for my mod?
     

Share This Page