Starbound

Starbound

161 ratings
Custom species are curious too
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
104.450 KB
21 Feb, 2022 @ 8:17am
21 Feb, 2022 @ 10:11pm
2 Change Notes ( view )

Subscribe to download
Custom species are curious too

Description
Allows crew members of custom species to inspect objects in the environment as vanilla species do.

NOTICE: My new mod "Corbent's Interactive Crew" includes the custom species inspection fix, if you are subscribed to that one, you can unsubscribe from this one.

About a year ago, before stepping away due to life getting tough all of a sudden, while doing some experiments with crew members I created a random human and was surprised when while strolling around a planet... she talked! She randomly said the description of a torch we passed by. This is a behavior I had never seen before. I went to the creators of some mods I use like Datebound to see if it was something their mod did. Turns out the behavior is vanilla but I had never seen it because I have used the Lyceen since forever and this didn't work for them.

Recently I have been poking around Starbound again. And I discovered that the inspect behavior has a "hasSpeciesSpecificDescription" check. Therefore if objects don't have a species specific inspect line (which is the case for most if not all custom races since it would be an endeavor of biblical proportions), NPCs won't inspect it.

This tiny mod patches this file to remove this check, allowing custom species to be curious about things around them.

As usual bug reports, comments, obsrvations are much appreciated.

UPDATE 1: It now also modifies the "inspectEntity" function inside dialog.lua (using a new file and hooking it, don't panic) so that it takes human dialogs instead of abstract descriptions. (Thanks for the observation Kronolos). I can no longer say it is a one line fix but it now correctly uses human dialogs for a MUCH better experience.
32 Comments
◁ ▹Sparrett◂CrøW ▶ 15 Aug @ 12:24am 
Glad people are still trying to make Starbound more of an escape from reality versus a fun space shooty survival game, appreciate your hard works
Corbent  [author] 15 Jul @ 8:27am 
@SealonBoard Glad to help. As for the description, I'm not sure. Haven't tested extensibly and world.entityDescription is a core function we can call but we don't have access to the source code for it. The only source of info on the API says:

"Returns the configured description for the specified inspectable entity (currently only objects and plants support this). Will return a species-specific description if species is specified and a generic description otherwise. "

What I have seen is that if they examine a machine, like in the last screenshot here with the hydro trays, they read their status.
SealonBoard 15 Jul @ 7:23am 
@Corbent Thanks. It works perfectly. And if the desired race doesn't have description, it uses human description normally too! Thanks for helping me. I can now enjoy various races and match similar description dialogues for them! You're a life saver!

Also, the crew starts reading the nodes's description too. Breaking the fourth wall. So.. if the object or node doesn't have human description, it reads the short description instead. Am I guessing right?
Corbent  [author] 14 Jul @ 9:39pm 
@SealonBoard Yeah I see what the issue is. I was in a rush in the morning but now I tested it. The substitutions need to go before the block that sets the race as human, not after. Obviously if it's already set to human, it won't be harpy or kitsune, or halfsea for the conditions. My mistake.
SealonBoard 14 Jul @ 9:01pm 
@Corbent Thanks for the generous advice. And I tested the code. It seems the original code has taken over the modified ones. Harpy races keep saying human descriptions, including the other races.


-----examples------

if world.entityDescription(args.entity, species) == world.entityDescription(args.entity) then
species = "human"
end

if species == "harpy" then
species = "avian"
end

if species == "kitsune" then
species = "hylotl"
end

if species == "halfsea" then
species = "hylotl"
end

if species == "mechineki" then
species = "neki"
end

if species == "starshroom" then
species = "floran"
end

if species == "saturnmothman" then
species = "saturn"
end

if species == "droden" then
species = "glitch"
end
-------------------

Could the reason would be the order, or priority of the code?
Corbent  [author] 14 Jul @ 11:21am 
@SealonBoard Hello. Sure. I am super busy at the moment so can't test and do it pretty. But A quick fix that might work is as follows:

There is a condition on line 12 that reads:

if world.entityDescription(args.entity, species) == world.entityDescription(args.entity) then
species = "human"
end

After that little block you can add:
if species == " <YourCustomSpeciesName> " then
species = " <DesiredSpeciesName> "
end

Repeat the block for each species you want to set.
SealonBoard 13 Jul @ 8:34am 
I'm curious about modifying the cs_dialog.lua file to give specific race to share the specific vanila race's dialog.

Such as, giving harpies (they are cutebound avian) to share avian dialog. And share Hylotl's dialogue with Kitsune and Halfsea. Can you give me advice to modifying the code to specifying the races?
Banjo 5 May, 2022 @ 11:38am 
@Corbent hilarious stuff, mhm mhm
Corbent  [author] 5 May, 2022 @ 11:25am 
@Pocket Egg Don't you love it when Steam leaves your post in limbo forever? Happened to me once and I had no idea way.
Banjo 2 May, 2022 @ 8:28am 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).