Avali-Triage-Team / Avali

Avali mod with community additions. See Trello for an easier way to see what we're working on:
https://trello.com/b/gXXkQ3Lw/avali-starbound
65 stars 44 forks source link

Human spacevillager NPCs die when spoken to by non-avali players #447

Closed ItsTheKais closed 3 years ago

ItsTheKais commented 3 years ago

This mod adds a human key to spaceconverse.config, making human NPCs use that instead of default, but doesn't provide a default subkey inside it. Thus, human NPCs try to look up dialog that doesn't exist when spoken to by non-avali players, causing the NPC to die and this error to show up in the log:

[Error] Exception while invoking lua function 'update'. (LuaException) Error code 2, [string "/npcs/bmain.lua"]:162: (StarException) Lua Exception caught running action node sayToEntity in behavior villager: (LuaException) Error code 2, [string "/scripts/actions/dialog.lua"]:113: Dialog type dialog.converse not specified in spacevillager

It looks like you do the same thing with ningen as well, but I don't have that mod and can't say for sure.

Most elegant fix: instead of creating /converse/human wholesale, copy /converse/default to /converse/human and then add /avali into it.

Fevix commented 3 years ago

Both the Ningen and the Human appear to be using the same logic for adding the text, as seen here

I'm afraid I'm not entirely sure what your suggested fix entails, but I think I got the gist of it. Can you try using the recent version posted to the spaceconverse branch? If that fixes it, I'll go ahead and merge with master and ship the update

ItsTheKais commented 3 years ago

Not quite.

After the copy, the add's path should be changed from /converse/human to /converse/human/avali, and the value just the list of dialog lines, like is done with the other races. As it is, the add just overwrites what the copy did and it's right back where it started.

Fevix commented 3 years ago

As it is, it SHOULD be adding values (Hence "op": "add as opposed to "op": "replace")

The "value": {"avali": part is where it then adds items to /converse/human/avali.

Fevix commented 3 years ago

Okay, I've pushed a new commit. Used a json patch tester and it looks like it's doing things correctly now. Please regrab the spaceconverse branch and test to make sure it's fixed the issue.

ItsTheKais commented 3 years ago

It is fixed now, thanks!