Better Crew

If you liked this item, please rate it up on Steam Workshop page.

Author: Vix

Last revision: 6 Dec, 2023 at 05:40 UTC (1)

File size: 183.3 KB

On Steam Workshop

Description:

This is the most recent more-better version of the mod!
While being more advanced, it also makes more modifications to lua files, and might introduce conflicts.
To find the last version of the mod before that milestone of functionality, go for the diet version!
(diet Better Crew won’t receive any more update)

DO NOT use both versions at once.

Summary

You recruit twelve NPCs to become your ship’s crew, and then what happens onboard? They all mob the teleporter and ignore the rest of your ship.

NPC behaviors in Starbound are quite simplistic, and this becomes most obvious in crew behavior onboard the player’s ship.

Better Crew upgrades your Crew from brainless beefcakes to the average chihuahua.

Originally posted by Vix:

I’m solely the uploader.Actually now we’re on my fork, since some stuff needed patching in the base mod.
rl_starbound
is the original author of rl_bettercrew[github.com] .
Since it wasn’t on the Steam workshop and the license allows it, I took on myself to summarize slightly the description (character limits) and I’m trying to provide basic support from my understanding and usage experience of the mod.
Very important patches:

How work:
The ADHD issue

The idea behind this mod is based on the mod "Smart Crew" by metamorphexx. In that mod, each crew type has a hard-coded list of objects that attracts that crew type, and on each behavior tick, each crew member searches the player’s ship for each object on their type’s list and moves to one such object, if found.

Issue with that is that this search would happen on each behavior tick, for each crew member, for each object in the crew type’s list.

In Better Crew, as each object placed into the ship world that contains crew anchors registers itself and its location with the ship’s TechStation (S.A.I.L. panel). Be sure to have the patches mentioned above for modded races/ships/furniture!

The need to rest instead of loitering

Normally, no NPC will attempt to sleep in a bed further than 50 blocks or sit in a chair further than 80 blocks from their spawn location, which on the ship is the teleporter.

In Better Crew, the search radius for beds and chairs is 250 blocks for crew members onboard player ships, which should sufficiently cover all vanilla ship classes.

Shipboard Duty Stations and Patrols

While onboard the player’s ship, each of the twelve crew types will now be attracted to certain objects, if present. These objects will pull the crew away from their spawn location (i.e., the teleporter). If you have done a good job designing your ship’s spaces, this should result in the crew spreading out throughout the ship and moving around in a way that feels natural.
In general, crew are attracted to objects that are related to their occupations.

In Better Crew, it patches over 100 vanilla objects with crew anchor tags.

The bug of having too much determination

Starbound’s simplistic behavior logic also hides a significant bug, which is why on some other mods and vanilla, your crew seem to lack brain functions and just derp out for half an hour or more.
A few of the vanilla uses of moveToPosition function are wrapped inside of a timeout behavior, but the vast majority were not. An NPC stuck waiting for a path to open to its targeted object will continue to wait indefinitely, or until a higher priority behavior is triggered (e.g., combat, or the player interacting with them).
Resulting in NPC Freezing.

In Better Crew, this has been fixed.

Doors.

Issue is that, you might like your racial ship doors. But moving around your ship, manually opening and closing doors is annoying, so you wire proximity sensors on either side of each door.
Which to the game’s path finding, counts as a closed and locked door, because something is wired to the input node, even with a proximity sensor. So NPCs would only go through doors if they happened to wander close enough to open then, then the game would see the door as an opened locked door, and consider pathfinding through it, and stop doing so as soon as the door closes again.

In Better Crew, the solution chosen was to make all racial ship doors to open automatically. You should be mindful of this issue for all non-automatically opening doors still though. Note that the game’s path-finding logic is in its C++ code, so modders cannot fix this directly, and have to work around it.

Admin Heathens

Starbound’s stealing mechanic penalizes players for breaking blocks or objects in villages, which is fair!
But then, when an Admin wants to maintain/tweak the area, it will trigger a literal riot… an utterly useless one, against an Admin. Even if you wanted to clean up the aftermath loose silt blocks of a sandstorm or something.

In Better Crew, NPCs don’t try to oppose their universe’s godly beings. Smart!

Compatibility Notes
  • Do not try to use this mod with Corbent’s interactive crew or Smart Crew installed. They are mutually exclusive as they serve similar purpose.
  • Meanwhile, it seems to trade nicely with some other crew customization, like Crew Customization +, since they don’t really touch on the same functions, and with Interaction Control too.
  • Reported incompatible with Borderlands 2 Random and Unique Shields.
Modified Lua

This mod makes significant structural changes to the following behavior files:

  • /behaviors/npc/crew/combat.behavior
  • /behaviors/npc/crew/notifications.behavior
  • /behaviors/npc/inspect.behavior
  • /behaviors/npc/npcblink.behavior
  • /behaviors/npc/patrol.behavior
  • /behaviors/npc/play.behavior
  • /behaviors/npc/reactions/comfort.behavior
  • /behaviors/npc/reactions/flirtwithplayer.behavior
  • /behaviors/npc/reactions/pianoparty.behavior
  • /behaviors/npc/reactions/playairhockey.behavior
  • /behaviors/npc/reactions/watchsleeping.behavior
  • /behaviors/npc/sit.behavior
  • /behaviors/npc/sleep.behavior
  • /behaviors/npc/wander.behavior
  • /behaviors/tenant/returnhome.behavior

If this mod is combined with any other mod that modifies any of those behavior files, broken NPC behaviors and/or instantly-dying NPCs are likely.

This mod replaces the following Lua functions with improved versions:

  • /npcs/bmain.lua: setNpcItemSlot
  • /scripts/actions/npc.lua: swapItemSlots
  • /scripts/actions/query.lua: findLoungable
  • /scripts/actions/reaction.lua: playBehaviorReaction

If it is combined with any other mod that modifies any of these functions, conflicts will happen.

Miscellaneous Bug Fixes and Tweaks

And cues for other mod authors if they want to patch stuff for compatibility

Running out of space, check Change Notes!

Uninstallation

This mod make no modifications to any game state. You should be able to add or remove it at any time.

Download
Required items:

Click the title to search on this site.


Stardust Core LiteSteam Workshop
Revisions:

Old revisions of this mod are available below. Click the link to download.