Modding
Discord Wishlist on Steam

Library›People

Nearest of a side

fn/game.NearestOfSide

The nearest living person of a side (bandits, soldiers, villagers...) within so many metres of a place, and whether there is one.

Nearest of a sideallatmetres20sideBanditwhofound
Does
An action: done when the run reaches it
Runs
On every machine
Listed under
Library › People
In a file
fn/game.NearestOfSide

Pins

  • inata position

    The place.

  • inmetresa number

    How far round it, in metres.

    Starts as 20

  • insidea choice

    Bandit, Soldier, Civilian, Player or Neutral.

    Starts as Bandit

  • outwhoa character

    The person.

  • outfoundyes or no

    Yes when there is one.

How it is made

Its body, as the bench opens it read-only. Copy into my mod on the bench makes a copy to change. The library's file is people.graph.json.

StartallatmetressidePeople nearatmetrespeopleFor eachlistLoop bodyDoneitemindexPosition ofofpositionDistanceabresultbestDistance<Branchconditiontruefalsebest =valuevaluebestDistance =valuevaluebestIs nothingvalueresultNOTReturnallwhofoundSideDamagablevalue=AND
Nearest of a side

Built from