Stealing

From Starbounder - Starbound Wiki
Jump to: navigation, search

Stealing is a game mechanic that can affect players when in most friendly villages and some friendly microdungeons. If an NPC catches a player breaking blocks or objects in their house, they will warn the player against stealing, up to two times. If the same NPC catches the player a third time, they will become hostile, and will call attention to the player as a thief. All other friendly NPCs near a newly-hostile NPC will likewise become hostile, which will spread like a virus across the entire village population if left unchecked.

Typical villager NPCs that become hostile are unarmed and thus cannot harm the player, but they will stop giving the player quests, in addition to spreading the news of the player's thievery. Guard NPCs that become hostile will attack the player on sight. Once an NPC has become hostile, there is no mechanic to switch them back to friendly status. The only "cure" is to kill all hostile NPCs, without being seen doing so by friendly NPCs.

Ironically, players can take any items from any storage object in a village, and villagers do not care.

Bugs

The stealing mechanic can affect the player in ways that most players would not consider stealing:

  • A player cleaning loose silt from a sand storm off of a desert village will be accused of stealing.
  • A player who places one of their own items, such as a wooden workbench, in a village will be accused of stealing it when they pick it back up.
  • Prior to version 1.3, blocks or objects destroyed by weapons, such as a vase being broken, or explosions, such as meteor strikes, could elicit accusations of thievery, but that appears to be fixed in the current version.

Care must be taken by players not to perform these activities in line of sight of friendly NPCs.

Implementation Details

All dungeons in Starbound consist of one (in the case of microdungeons) or more (in the case of major dungeons) dungeon pieces that are joined together by the game's random generation engine. For friendly villages, the dungeon pieces may contain a virtual object called an objecttracker stagehand. This virtual object is not visible when rendered in the game, but provides a way for events to be received and scripts to be run. The image below shows a piece of the Apex Rebel Camp as seen by the Tiled map editor, and the highlighted greyish box is the objecttracker stagehand.

Objecttracker-stagehand.png

When any block or object is broken by the player using a tool, such as a matter manipulator or a pickaxe, a script running in the player's context catches the event and searches for an objecttracker stagehand containing the position of the broken item. If found, the player's script notifies the objecttracker that the player broke the item. The objecttracker script then searches for any NPCs within a 30 block radius of the broken item and notifies them of the breakage. If any such notified NPC has a direct line of sight to either the position of the broken item, or to the player, they will first attempt to warn the player against stealing, up to two times. If the same NPC observes a third instance of stealing, the NPC switches to the enemy team and begins broadcasting a notification to other NPCs within a 40 block radius to do the same. If the NPC is armed, they will attack the player on sight.