Skriptsymbole
Der Index enthält Funktionen, Eigenschaften, Signale, Konstanten und benannte Aufzählungen der Simulations- und Modding-Klassen. Signaturen und Quellcodekommentare sind auf Englisch. Mod definiert die Einstiegspunkte für Skripte. Andere Klassen und Mitglieder mit führendem Unterstrich können sich zwischen Versionen ändern.
Ergebnisse
Keine passenden Symbole gefunden.
Mod
Mod.infovarMetadata for the loaded mod.Link zu diesem Eintragvar info := {}Common keys are
Deklariert inid,name,version,author,description, andpath. Use this to inspect which copy was loaded.scripts/core/mod.gd:21Mod._on_loadfuncRuns after Fourways reapplies enabled mods, including after a rescan.Link zu diesem Eintragfunc _on_load() -> voidRead mod files or initialize settings here. Use
_on_new_gameor_on_game_loadedfor work that needs a simulation.- Rückgabewert
void
scripts/core/mod.gd:25Mod._on_new_gamefuncA new game has been created (world generated, companies founded), before the first day.Link zu diesem Eintragfunc _on_new_game(_sim: Sim) -> void- Parameter
_sim: Sim
- Rückgabewert
void
scripts/core/mod.gd:30Mod._on_game_loadedfuncA saved game has been loaded.Link zu diesem Eintragfunc _on_game_loaded(_sim: Sim) -> void- Parameter
_sim: Sim
- Rückgabewert
void
scripts/core/mod.gd:35Mod._on_dayfuncRuns once for each simulated calendar day after daily town, competitor and vehicle updates, and before the daily goal checks and month-end bookkeeping.Link zu diesem Eintragfunc _on_day(_sim: Sim) -> voidRead
sim.day_intfor the day that has just started.- Parameter
_sim: Sim
- Rückgabewert
void
scripts/core/mod.gd:40Mod._on_monthfuncRuns at the month boundary after Fourways closes the previous month’s accounts.Link zu diesem Eintragfunc _on_month(_sim: Sim) -> voidMoney credited here is recorded in the new month.
- Parameter
_sim: Sim
- Rückgabewert
void
Beispiel
Deklariert infunc _on_month(sim: Sim) -> void: sim.company.earn(500) news(sim, L.t("Monthly transport grant"), "good")scripts/core/mod.gd:45Mod._on_yearfuncAt the start of every year;yearis the one that has just ended.Link zu diesem Eintragfunc _on_year(_sim: Sim, _year: int) -> void- Parameter
_sim: Sim_year: int
- Rückgabewert
void
scripts/core/mod.gd:50Mod._on_deliveryfuncRuns after a vehicle earns a fare by delivering cargo.Link zu diesem Eintragfunc _on_delivery(_sim: Sim, _vehicle: Vehicle, _station: Station, _amount: int) -> voidamountis the total payment for that unload, in game dollars. It is not the number of units delivered or a per-cargo breakdown.- Parameter
_sim: Sim_vehicle: Vehicle_station: Station_amount: int
- Rückgabewert
void
scripts/core/mod.gd:55Mod._on_vehicle_boughtfuncA vehicle has been bought.Link zu diesem Eintragfunc _on_vehicle_bought(_sim: Sim, _vehicle: Vehicle) -> void- Parameter
_sim: Sim_vehicle: Vehicle
- Rückgabewert
void
scripts/core/mod.gd:60Mod._on_station_builtfuncA station has been built (or extended).Link zu diesem Eintragfunc _on_station_built(_sim: Sim, _station: Station) -> void- Parameter
_sim: Sim_station: Station
- Rückgabewert
void
scripts/core/mod.gd:65Mod._on_newsfuncRuns before a news item is posted.Link zu diesem Eintragfunc _on_news(_sim: Sim, _item: Dictionary) -> boolReturn
falseto suppress it ortrueto let it proceed through the other active mods. The item includestext,kind,pos, andday. Posting news from this hook calls the hook again.- Parameter
_sim: Sim_item: Dictionary
- Rückgabewert
bool
scripts/core/mod.gd:70Mod._savefuncReturns the mod’s persistent state as a dictionary of plain values.Link zu diesem Eintragfunc _save(_sim: Sim) -> DictionaryAn empty dictionary is omitted, so
_loadwill not run for that save. Return the data rather than writing a separate file.- Parameter
_sim: Sim
- Rückgabewert
Dictionary
scripts/core/mod.gd:76Mod._loadfuncRestores this mod’s data before_on_game_loaded.Link zu diesem Eintragfunc _load(_sim: Sim, _data: Dictionary) -> voidCalled only if the save contains a dictionary for this mod’s ID. Use
data.get("key", default)so older saves can omit keys added by a later mod version.- Parameter
_sim: Sim_data: Dictionary
- Rückgabewert
void
scripts/core/mod.gd:80Mod.newsfuncPost a news item ("good", "info", "warn" or "bad").Link zu diesem Eintragfunc news(sim: Sim, text: String, kind: String = "info", at: Vector2 = Vector2(-1, -1)) -> voidatis a tile to jump to when it's clicked.- Parameter
sim: Simtext: Stringkind: String = "info"at: Vector2 = Vector2(-1, -1)
- Rückgabewert
void
scripts/core/mod.gd:87Mod.notefuncWrite a line to the game's log, tagged with the mod's id.Link zu diesem Eintragfunc note(text: String) -> void- Parameter
text: String
- Rückgabewert
void
scripts/core/mod.gd:92Mod.pathfuncA file inside the mod's folder, e.g.Link zu diesem Eintragfunc path(file: String) -> Stringpath("data/extra.json").
- Parameter
file: String
- Rückgabewert
String
scripts/core/mod.gd:97
Sim
Sim.news_postedsignal{"text", "kind": good|info|warn|bad, "pos": Vector2, "day"[, "veh"][, "urgent"][, "world"]}Link zu diesem Eintragsignal news_posted(item: Dictionary)- Parameter
item: Dictionary
- Rückgabewert
signal news_posted(item: Dictionary)
scripts/sim/sim.gd:6Sim.incomesignalLink zu diesem Eintragsignal income(vehicle: Vehicle, station: Station, amount: int)- Parameter
vehicle: Vehiclestation: Stationamount: int
- Rückgabewert
signal income(vehicle: Vehicle, station: Station, amount: int)
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:7Sim.vehicles_changedsignalLink zu diesem Eintragsignal vehicles_changed- Rückgabewert
signal vehicles_changed
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:8Sim.company_bankruptsignalLink zu diesem Eintragsignal company_bankrupt(c: Company)- Parameter
c: Company
- Rückgabewert
signal company_bankrupt(c: Company)
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:9Sim.SPEEDSconstLink zu diesem Eintragconst SPEEDS := [0, 1, 2, 4, 8]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:11Sim.mapvarThe live world map.Link zu diesem Eintragvar map: WorldMapUse it to read towns, industries, stations, and terrain. Use simulation construction methods when changing infrastructure.
Deklariert inscripts/sim/sim.gd:13Sim.companiesvarThe companies in the current simulation, including the player.Link zu diesem Eintragvar companies: Array[Company] = []Compare a vehicle or station’s owner with a company object to filter its assets.
Deklariert inscripts/sim/sim.gd:14Sim.companyvarThe player’s company.Link zu diesem Eintragvar company: CompanyUse its
Deklariert inidfor council ratings and itsearn()andspend()methods to record changes in the accounts.scripts/sim/sim.gd:15Sim.vehiclesvarThe vehicles active in the current simulation.Link zu diesem Eintragvar vehicles: Array[Vehicle] = []Use buying and selling methods to manage ownership and accounting.
Deklariert inscripts/sim/sim.gd:16Sim.next_vehicle_idvarLink zu diesem Eintragvar next_vehicle_id := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:17Sim.seed_valuevarLink zu diesem Eintragvar seed_value := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:18Sim.rngvarThe simulation’s seeded random-number generator.Link zu diesem Eintragvar rng := RandomNumberGenerator.new()Calls advance the same random stream the simulation uses.
Deklariert inscripts/sim/sim.gd:19Sim.dayvarLink zu diesem Eintragvar day := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:20Sim.day_intvarLink zu diesem Eintragvar day_int := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:21Sim.speedvarLink zu diesem Eintragvar speed := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:22Sim.newsvarLink zu diesem Eintragvar news: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:23Sim.aisvarAI controllers (see ai.gd)Sim.optionsvarGame rules chosen at setup: "cost" construction cost multiplier, "blocking" (trains wait for each other at signals, and crash into each other where there are none), "ai_level" 0..2, "max_loan".Link zu diesem Eintragvar options := {"cost": 1.0, "blocking": false, "ai_level": 1, "max_loan": Data.MAX_LOAN, "depots": false, "breakdowns": 0, "goal": "none"}"depots": road vehicles and trains are bought at (and serviced in) depots; "breakdowns" 0..2; "goal": the company goal (one of Goals.GOAL_IDS).
Deklariert inscripts/sim/sim.gd:29Sim.occupiedvarsignal block id -> Vehicle (realistic blocking only)Sim.CRASH_RconstTrain crashes (see _check_crashes).Link zu diesem Eintragconst CRASH_R := 0.25Not saved: after loading, trains that already overlap are let go until they part. how close a train's nose may come to another train before they touch
Deklariert inscripts/sim/sim.gd:33Sim.CRASH_STEPconstthe most a train moves between two crash checksSim.CRASH_CELLconstmap cells (in tiles) for finding trains near each otherSim._touchingvar"id:id" -> true: trains overlapping at the last check that didn't crashSim._checkedvarvehicle id -> true: trains taking part in the last checkSim.WRECK_DAYSconstCrashed trains lying on the line until it is cleared, WRECK_DAYS later: [{"pos": Vector2 (where they met), "day": float, "trains": [Vehicle, Vehicle] (as they were, for the view), "tiles": {Vector2i: true}}].Link zu diesem Eintragconst WRECK_DAYS := 20.0Trains stop short of a wreck's tiles (see wreck_tiles). Not saved.
Deklariert inscripts/sim/sim.gd:41Sim.wrecksvarLink zu diesem Eintragvar wrecks: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:42Sim.wreck_tilesvarVector2i -> true: track blocked by a wreckSim.road_atvarQueues (RAIL-26): who is where, worked out afresh at the start of every advance (_index_queues) and kept up to date as vehicles take a berth or a stand.Link zu diesem Eintragvar road_at := PackedInt32Array()Road vehicles by the tile their front is in, as lists threaded through
Deklariert inroad_next, so each one only looks at the few near it. tile index -> index in road_list of a road vehicle there (-1: none)scripts/sim/sim.gd:47Sim.road_listvarLink zu diesem Eintragvar road_list: Array[Vehicle] = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:48Sim.road_nextvarindex in road_list -> the next one in the same tile (-1: none)Sim._road_tilesvarthe tiles set in road_at, to clear againSim.ships_atvartile -> a ship whose front is in itSim.standsvarStation -> aircraft on the ground there or coming in to landSim.holding_overvarStation -> aircraft holding over itSim.missing_modsvarAfter loading: mods this game was saved with that aren't switched on now, and vehicles left out because their model came from one of them.Sim.dropped_vehiclesvarLink zu diesem Eintragvar dropped_vehicles := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:57Sim.undovarThe player's last construction actions, for Ctrl+Z (see undo.gd).Sim.goalsvarfirst steps, achievements and the company goal (RAIL-25)Sim.opportunitiesvarsubsidies and town requests (RAIL-24)Sim.linesvarThe player's lines: vehicles sharing one order list (see line.gd).Sim.next_line_idvarLink zu diesem Eintragvar next_line_id := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:64Sim.next_industry_idvarIndustries open and close during the game (RAIL-23, IndustryLife).Link zu diesem Eintragvar next_industry_id := 0Ids are never used twice, so nothing that remembers a closed industry's id mistakes a new one for it (see new_industry_id).
Deklariert inscripts/sim/sim.gd:67Sim.industry_targetvarHow many industries the map started with (counted at the first month end): openings and closures lean back toward it.Sim.industry_roomvarThe room the map has for industries (WorldGen.industry_room), worked out when first needed.Link zu diesem Eintragvar industry_room := Vector2i(-1, -1)Not saved: the coast hardly moves in a game.
Deklariert inscripts/sim/sim.gd:73Sim.introduce_waitvarA new era's kinds of industry that found no site (IndustryLife._introduce): type -> the game day before which they are not tried again.Sim.createstatic funcA brand-new game from setup parameters (see the new-game screen for the keys).Link zu diesem Eintragstatic func create(params: Dictionary) -> Sim- Parameter
params: Dictionary
- Rückgabewert
Sim
scripts/sim/sim.gd:80Sim._initfuncLink zu diesem Eintragfunc _init(p_seed: int, size: int = Const.MAP_SIZE, generate: bool = true, size_h: int = -1) -> void- Parameter
p_seed: intsize: int = Const.MAP_SIZEgenerate: bool = truesize_h: int = -1
- Rückgabewert
void
- Ruft auf
WorldGen.generate,L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:110Sim.date_textfuncFormats the current simulation day for display using the active language.Link zu diesem Eintragfunc date_text() -> StringFor date calculations use
day_intoryear().- Rückgabewert
String
- Ruft auf
Calendar.format
scripts/sim/sim.gd:121Sim.yearfuncReturns the calendar year ofday_int.Link zu diesem Eintragfunc year() -> intUse it for year-based rules instead of dividing the elapsed day count by 365.
- Rückgabewert
int
- Ruft auf
Calendar.from_day
scripts/sim/sim.gd:125Sim.tickfuncAdvance by real seconds at the current game speed.Link zu diesem Eintragfunc tick(real_dt: float) -> void- Parameter
real_dt: float
- Rückgabewert
void
scripts/sim/sim.gd:132Sim.advancefuncAdvance byddgame days.Link zu diesem Eintragfunc advance(dd: float) -> void- Parameter
dd: float
- Rückgabewert
void
scripts/sim/sim.gd:139Sim._update_occupancyfuncWhich track blocks trains are standing in (only matters with realistic blocking).Link zu diesem Eintragfunc _update_occupancy() -> voidSince RAIL-80 junctions are blocks too, so this runs without signals as well.
- Rückgabewert
void
scripts/sim/sim.gd:162Sim._index_queuesfuncWhere road vehicles, ships and aircraft are, for the queues (RAIL-26).Link zu diesem Eintragfunc _index_queues() -> voidOne pass over the vehicles, with nothing allocated for each road vehicle: those out of a depot go into road_at by the tile of their front.
- Rückgabewert
void
scripts/sim/sim.gd:206Sim.claim_standfuncWhether a plane may land at airportstnow (RAIL-26), and if so it is counted in: fewer than Vehicle.STANDS aircraft are on the ground there or coming in to land.Link zu diesem Eintragfunc claim_stand(st: Station, holding: bool) -> boolOne already holding goes before one only just arriving.
- Parameter
st: Stationholding: bool
- Rückgabewert
bool
scripts/sim/sim.gd:252Sim._rail_stepsfuncHow many steps to move the trains in this frame, so none goes further than CRASH_STEP in one.Link zu diesem Eintragfunc _rail_steps(dd: float) -> intOnly where two trains could meet within the frame: everywhere else one step does (most frames, since trains mostly run apart, and stepping every train many times a frame is what costs).
- Parameter
dd: float
- Rückgabewert
int
scripts/sim/sim.gd:263Sim._check_crashesfuncTrains on the same track crash (with realistic blocking): when a train's nose runs into another train, both are wrecked.Link zu diesem Eintragfunc _check_crashes() -> voidSignals are what keeps them apart. Trains in a depot shed or being serviced there are out of the way. Two trains that already overlapped at the last check, or where one has only just appeared (bought onto a busy platform, out of the depot together with another, a game just loaded), are let go until they part: only running into each other counts.
- Rückgabewert
void
scripts/sim/sim.gd:298Sim._contactfuncWhere the nose of trainatouches the body of trainbon the same level (not one on a bridge over the other), or null.Link zu diesem Eintragfunc _contact(a: Dictionary, b: Dictionary) -> Variantaandbare entries of _check_crashes' list.- Parameter
a: Dictionaryb: Dictionary
- Rückgabewert
Variant
scripts/sim/sim.gd:346Sim._crashfuncTwo trains have run into each other atat: both are wrecked, with all they carried.Link zu diesem Eintragfunc _crash(a: Vehicle, b: Vehicle, at: Vector2) -> void- Parameter
a: Vehicleb: Vehicleat: Vector2
- Rückgabewert
void
- Ruft auf
Station.nearest_town,L.t
scripts/sim/sim.gd:374Sim._dir_indexstatic funcLink zu diesem Eintragstatic func _dir_index(v: Vector2) -> int- Parameter
v: Vector2
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:403Sim._on_dayfuncLink zu diesem Eintragfunc _on_day() -> void- Rückgabewert
void
- Ruft auf
Economy.produce,IndustryLife.near_wind_farm,Calendar.from_day,Mods.hook,Economy.monthly,IndustryLife.monthly,Data.intros,Data.model,L.t,L.lower
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:409Sim._growth_contextfuncWhat a town's land values depend on: stations with recent passenger service and nearby industry.Link zu diesem Eintragfunc _growth_context(t: Town) -> Dictionary- Parameter
t: Town
- Rückgabewert
Dictionary
scripts/sim/sim.gd:471Sim._new_erafuncA new age: industry modernises (more output from the same mines, fields and plants, except those on their way out), and the chains change (RAIL-29: Sim.sync_era has moved the map to it already).Link zu diesem Eintragfunc _new_era(era: Dictionary) -> void- Parameter
era: Dictionary
- Rückgabewert
void
- Ruft auf
Data.retiring,L.t,Data.era_changes
scripts/sim/sim.gd:492Sim.sync_erafuncMove the industry chains to the era of the date (RAIL-29): at the start of a game, after loading and at every month end, so a game that crosses into a new era (or was saved before the chains changed) takes it on.Link zu diesem Eintragfunc sync_era() -> voidStations look again at what they accept and supply.
- Rückgabewert
void
- Ruft auf
Data.era_index
scripts/sim/sim.gd:504Sim._match_daysfuncStadiums hold a match once a month, each on its own day (see match_offset).Link zu diesem Eintragfunc _match_days() -> voidThe crowd of fans is one per stadium: the stations that reach it share it the way they share ordinary passengers (Economy.shares: the best two by rating), so a second station next to a stadium doesn't double it.
- Rückgabewert
void
- Ruft auf
Economy.shares,L.t
scripts/sim/sim.gd:516Sim.match_offsetstatic funcThe day in each 30 a stadium standing att(its north-west tile) holds its match: the match is on the days where (day + this) is a multiple of 30.Link zu diesem Eintragstatic func match_offset(t: Vector2i) -> intTownLife shows the fans walking to it then.
- Parameter
t: Vector2i
- Rückgabewert
int
scripts/sim/sim.gd:546Sim._update_town_servicefuncLink zu diesem Eintragfunc _update_town_service(t: Town) -> void- Parameter
t: Town
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:550Sim._yearlyfuncLink zu diesem Eintragfunc _yearly(old_year: int) -> void- Parameter
old_year: int
- Rückgabewert
void
- Ruft auf
IndustryLife.yearly,L.t,Fmt.money
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:559Sim._check_bankruptcyfuncMonth end: companies in the red are warned, draw on their credit (rivals), and after Data.BANKRUPT_MONTHS months go bankrupt.Link zu diesem Eintragfunc _check_bankruptcy() -> void- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/sim.gd:578Sim._go_bankruptfuncLink zu diesem Eintragfunc _go_bankrupt(c: Company) -> void- Parameter
c: Company
- Rückgabewert
void
- Ruft auf
L.t,WorldMap.crossing_tiles
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:606Sim.post_newsfuncveh: the id of the vehicle the news is about, if any (clicking the news opens it).Link zu diesem Eintragfunc post_news(text: String, kind: String, pos: Vector2, veh: int = 0, about: String = "", urgent: bool = false, world: bool = false) -> voidabout: the screen clicking it opens instead ("goals").urgent: news the player mustn't miss (a crash of their trains: the HUD shows it on a card in the middle of the screen, see Hud.show_crash).world: see post_world_news.- Parameter
text: Stringkind: Stringpos: Vector2veh: int = 0about: String = ""urgent: bool = falseworld: bool = false
- Rückgabewert
void
- Ruft auf
Mods.allow_news
scripts/sim/sim.gd:671Sim.post_world_newsfuncNews about the world rather than the player's company: rivals' new lines, other towns' requests coming and going, industries opening and closing.Link zu diesem Eintragfunc post_world_news(text: String, kind: String, pos: Vector2, about: String = "") -> voidIt goes in the News window (under All news), without a note popping up on screen, so the player's own news isn't lost among it.
- Parameter
text: Stringkind: Stringpos: Vector2about: String = ""
- Rückgabewert
void
scripts/sim/sim.gd:692Sim.new_industry_idfuncAn id for an industry opening now: never one an industry has had before, whether it is still on the map (one placed by hand, as test maps do, counts too) or has closed.Link zu diesem Eintragfunc new_industry_id() -> int- Rückgabewert
int
scripts/sim/sim.gd:698Sim.vehicle_by_idfuncThe vehicle with this id, or null.Link zu diesem Eintragfunc vehicle_by_id(id: int) -> Vehicle- Parameter
id: int
- Rückgabewert
Vehicle
scripts/sim/sim.gd:706Sim.on_incomefuncLink zu diesem Eintragfunc on_income(v: Vehicle, st: Station, amount: int) -> void- Parameter
v: Vehiclest: Stationamount: int
- Rückgabewert
void
- Ruft auf
Mods.hook
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:713Sim._with_moneyfuncMarks a plan as unaffordable if the company can't pay for it.Link zu diesem Eintragfunc _with_money(p: Dictionary, who: Company) -> Dictionary- Parameter
p: Dictionarywho: Company
- Rückgabewert
Dictionary
scripts/sim/sim.gd:721Sim._ownershipfuncTrack and stations belonging to other companies can't be touched.Link zu diesem Eintragfunc _ownership(p: Dictionary, who: Company, tiles: Array) -> Dictionary- Parameter
p: Dictionarywho: Companytiles: Array
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/sim.gd:734Sim.preview_linefuncChecks a path of adjacent road or rail tiles for construction, ownership, and affordability.Link zu diesem Eintragfunc preview_line(kind: String, pts: Array[Vector2i], who: Company = null) -> DictionaryReturns a plan with
ok,reasonandcostwithout laying track or spending money.- Parameter
kind: Stringpts: Array[Vector2i]who: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_line
scripts/sim/sim.gd:754Sim.build_linefuncLays road or track along consecutive adjacent tiles and debits construction costs on success.Link zu diesem Eintragfunc build_line(kind: String, pts: Array[Vector2i], who: Company = null) -> DictionaryPass at least two tiles as
Array[Vector2i]. The return value is a construction plan, so checkokbefore using it.- Parameter
kind: Stringpts: Array[Vector2i]who: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.apply_line
Beispiel
Deklariert invar tiles: Array[Vector2i] = [Vector2i(5, 6), Vector2i(6, 6)] var plan := sim.build_line("road", tiles) if not plan.ok: note(plan.reason)scripts/sim/sim.gd:762Sim.plan_routefuncA line alongpts(each tile next to the one before) with bridges and tunnels on it (crossings, as RouteBuilder.last_crossings gives them, RAIL-52): the stretches of land between them as build_line lays them and each crossing as build_crossing builds it.Link zu diesem Eintragfunc plan_route(kind: String, pts: Array[Vector2i], crossings: Array, who: Company = null) -> DictionaryWithout the money check (see preview_route). Keys as plan_line's - "add" every piece, "cost" the total - plus "tiles" (every bridge span and tunnel tile), "spans" (bridge spans only) and "parts" (each stretch's and crossing's own plan, in order).
- Parameter
kind: Stringpts: Array[Vector2i]crossings: Arraywho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:785Sim._join_planfuncAdd a stretch's or crossing's plan to a route's (plan_route).Link zu diesem Eintragfunc _join_plan(p: Dictionary, part: Dictionary) -> void- Parameter
p: Dictionarypart: Dictionary
- Rückgabewert
void
scripts/sim/sim.gd:835Sim.preview_routefuncReturns the cost and validity of a road or rail route that can include bridges or tunnels.Link zu diesem Eintragfunc preview_route(kind: String, pts: Array[Vector2i], crossings: Array, who: Company = null) -> DictionaryIt runs the route planner and checks funds without building the route.
- Parameter
kind: Stringpts: Array[Vector2i]crossings: Arraywho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:853Sim.build_routefuncBuild a route planned by preview_route: every stretch and crossing exactly as previewed, paid for at once, and taken back by one undo.Link zu diesem Eintragfunc build_route(kind: String, pts: Array[Vector2i], crossings: Array, who: Company = null) -> Dictionary- Parameter
kind: Stringpts: Array[Vector2i]crossings: Arraywho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:860Sim.preview_stationfuncChecks placement, ownership, council permission, and affordability for a new station or extension.Link zu diesem Eintragfunc preview_station(kind: String, pts: Array[Vector2i], axis: int, who: Company = null) -> DictionaryReturns a plan without building the station.
- Parameter
kind: Stringpts: Array[Vector2i]axis: intwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:886Sim.build_stationfuncBuilds or extends a station, charges the company, and firesMod._on_station_built.Link zu diesem Eintragfunc build_station(kind: String, pts: Array[Vector2i], axis: int, who: Company = null) -> DictionaryPass
rail,road,dock, orair, a typed tile array, and an orientation. On success the plan includes the resultingstation; on failure usereason.- Parameter
kind: Stringpts: Array[Vector2i]axis: intwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.apply_station,Mods.hook
scripts/sim/sim.gd:904Sim.preview_bulldozefuncChecks which objects in the tile rectangle can be cleared by the company, and estimates the cost.Link zu diesem Eintragfunc preview_bulldoze(rect: Rect2i, who: Company = null) -> DictionaryRead the plan before calling
build_bulldoze.- Parameter
rect: Rect2iwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:924Sim.build_bulldozefuncClears the allowed parts of a tile rectangle, updates track ownership counts, and charges the company.Link zu diesem Eintragfunc build_bulldoze(rect: Rect2i, who: Company = null) -> DictionaryRemoving scenery and buildings can affect town council ratings.
- Parameter
rect: Rect2iwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:957Sim.preview_crossingfuncBridges (bis the far ramp) and tunnels (from hillside tilea).Link zu diesem Eintragfunc preview_crossing(kind: String, type: String, a: Vector2i, b: Vector2i, who: Company = null, style: String = "") -> Dictionary- Parameter
kind: Stringtype: Stringa: Vector2ib: Vector2iwho: Company = nullstyle: String = ""
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_bridge,BuildOps.plan_tunnel,L.t
scripts/sim/sim.gd:981Sim.build_crossingfuncBuilds a bridge between the ramp tiles or a tunnel from the hillside tile.Link zu diesem Eintragfunc build_crossing(kind: String, type: String, a: Vector2i, b: Vector2i, who: Company = null, style: String = "") -> DictionaryPass
bridgeortunnelfortype. A successful plan contains the newcrossing.- Parameter
kind: Stringtype: Stringa: Vector2ib: Vector2iwho: Company = nullstyle: String = ""
- Rückgabewert
Dictionary
scripts/sim/sim.gd:992Sim.preview_signalfuncChecks placement, ownership, and cost for the signal action on a rail tile.Link zu diesem Eintragfunc preview_signal(t: Vector2i, who: Company = null) -> DictionaryReturns the plan without applying it.
- Parameter
t: Vector2iwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_signal
scripts/sim/sim.gd:1012Sim.build_signalfuncApplies the signal action to the rail tile after validating ownership and cost, and records the operation for undo.Link zu diesem Eintragfunc build_signal(t: Vector2i, who: Company = null) -> Dictionary- Parameter
t: Vector2iwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.apply_signal
scripts/sim/sim.gd:1019Sim.preview_terraformfuncChecks the cost and rules for raising or lowering a map corner.Link zu diesem Eintragfunc preview_terraform(corner: Vector2i, delta: int, who: Company = null) -> DictionaryIt also rejects a plan if a vehicle occupies any affected tile.
- Parameter
corner: Vector2idelta: intwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_terraform,L.t
scripts/sim/sim.gd:1030Sim.build_terraformfuncApplies an affordable height change to a map corner.Link zu diesem Eintragfunc build_terraform(corner: Vector2i, delta: int, who: Company = null) -> DictionaryA positive
deltaraises it and a negative one lowers it.- Parameter
corner: Vector2idelta: intwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1042Sim.preview_levelfuncLevel the tiles inrectto corner heightheightas far as the rules allow (see BuildOps.plan_level): tiles under vehicles or belonging to other companies are left alone too.Link zu diesem Eintragfunc preview_level(rect: Rect2i, height: int, who: Company = null) -> Dictionary- Parameter
rect: Rect2iheight: intwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
L.t,BuildOps.plan_level
scripts/sim/sim.gd:1057Sim.build_levelfuncLevels the eligible tiles in a rectangle to a target corner height, charges the construction cost, and records the change for undo.Link zu diesem Eintragfunc build_level(rect: Rect2i, height: int, who: Company = null) -> DictionaryCheck the returned plan for skipped tiles.
- Parameter
rect: Rect2iheight: intwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1073Sim._level_upsets_townsfuncLevelling clears the trees on the tiles it reshapes, which the nearby councils mind the way they mind bulldozing them (see _bulldoze_upsets_towns).Link zu diesem Eintragfunc _level_upsets_towns(tiles: Array, who: Company) -> void- Parameter
tiles: Arraywho: Company
- Rückgabewert
void
- Ruft auf
Station.nearest_town,L.t
scripts/sim/sim.gd:1090Sim._bulldoze_upsets_townsfuncKnocking down houses, tearing up town streets and clearing trees near a town hurts the company's standing with its council.Link zu diesem Eintragfunc _bulldoze_upsets_towns(r: Rect2i, who: Company) -> voidOnly what belongs to the town counts: houses, streets inside its built-up area, and trees in and just around it. Roads and woods out in the country are the company's own business.
- Parameter
r: Rect2iwho: Company
- Rückgabewert
void
- Ruft auf
BuildOps.bulldoze_target,Station.nearest_town,L.t
scripts/sim/sim.gd:1109Sim.council_newsfuncTell the player the moment a council turns against them (or comes round).Link zu diesem Eintragfunc council_news(t: Town, who: Company, was: float) -> void- Parameter
t: Townwho: Companywas: float
- Rückgabewert
void
- Ruft auf
L.t,Town.rating_name
scripts/sim/sim.gd:1141Sim.council_refusalfuncWhy a council refuseswhoneart, in words a player can act on.Link zu diesem Eintragfunc council_refusal(t: Town, who: Company) -> String- Parameter
t: Townwho: Company
- Rückgabewert
String
- Ruft auf
L.t,Town.rating_name,L.lower
scripts/sim/sim.gd:1153Sim.town_actionfuncTown actions from the town window: "advertise", "trees" or "fund".Link zu diesem Eintragfunc town_action(t: Town, action: String, who: Company = null) -> DictionaryReturns {ok, reason, cost}.
- Parameter
t: Townaction: Stringwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1168Sim.renew_vehiclefuncCharges the owner the renewal price and resets the vehicle’s age, reliability, and last-service date.Link zu diesem Eintragfunc renew_vehicle(v: Vehicle, who: Company = null) -> DictionaryCheck
okbefore reading the successful result’scost.- Parameter
v: Vehiclewho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
L.t,Fmt.money,Data.reliability
scripts/sim/sim.gd:1215Sim.renew_pricefuncWhat renew_vehicle would charge forvright now.Link zu diesem Eintragfunc renew_price(v: Vehicle) -> int- Parameter
v: Vehicle
- Rückgabewert
int
scripts/sim/sim.gd:1231Sim.same_routestatic funcWhether two vehicles run the same route: the same company and kind of transport, calling at the same stations in the same order, wherever in the round each of them starts.Link zu diesem Eintragstatic func same_route(a: Vehicle, b: Vehicle) -> bool- Parameter
a: Vehicleb: Vehicle
- Rückgabewert
bool
scripts/sim/sim.gd:1239Sim.vehicles_on_stopsfuncHow many ofwho's vehicles ofkindcall at exactlystops, in that order (wherever in the round each one starts), as same_route counts them.Link zu diesem Eintragfunc vehicles_on_stops(kind: String, stops: Array, who: Company) -> int- Parameter
kind: Stringstops: Arraywho: Company
- Rückgabewert
int
scripts/sim/sim.gd:1258Sim.route_vehiclesfuncEvery vehicle onv's route (see same_route),vincluded; for a vehicle on a line, every vehicle on that line.Link zu diesem Eintragfunc route_vehicles(v: Vehicle) -> Array- Parameter
v: Vehicle
- Rückgabewert
Array
scripts/sim/sim.gd:1280Sim.make_linefuncTurnv's route into a line:vand every other vehicle of its company on the same route (see same_route) that isn't on a line yet join it.Link zu diesem Eintragfunc make_line(v: Vehicle, line_name: String = "") -> LineReturns the line.
- Parameter
v: Vehicleline_name: String = ""
- Rückgabewert
Line
scripts/sim/sim.gd:1290Sim.line_problemfuncWhyvcan't runln's stops ("" when it can).Link zu diesem Eintragfunc line_problem(v: Vehicle, ln: Line) -> String- Parameter
v: Vehicleln: Line
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/sim.gd:1305Sim.join_linefuncPutvon lineln(it takes the line's stops).Link zu diesem Eintragfunc join_line(v: Vehicle, ln: Line) -> DictionaryReturns {"ok", "reason"}.
- Parameter
v: Vehicleln: Line
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1314Sim._put_on_linefuncThe vehicle shares the line's order list and keeps heading for the stop it was heading for, when the line calls there too.Link zu diesem Eintragfunc _put_on_line(v: Vehicle, ln: Line) -> void- Parameter
v: Vehicleln: Line
- Rückgabewert
void
scripts/sim/sim.gd:1327Sim.leave_linefuncTakevoff its line: it keeps the stops as its own.Link zu diesem Eintragfunc leave_line(v: Vehicle) -> void- Parameter
v: Vehicle
- Rückgabewert
void
scripts/sim/sim.gd:1340Sim.set_line_ordersfuncGive linelnnew stops (validated for every model running on it).Link zu diesem Eintragfunc set_line_orders(ln: Line, new_orders: Array) -> DictionaryThe vehicles keep heading for the stop they were heading for where it is still on the line. Returns {"ok", "reason"}.
- Parameter
ln: Linenew_orders: Array
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1350Sim.set_vehicle_ordersfuncGive a vehicle new stops: its own, or (on a line) the whole line's.Link zu diesem Eintragfunc set_vehicle_orders(v: Vehicle, new_orders: Array, idx: int = -1) -> DictionaryReturns {"ok", "reason"}.
- Parameter
v: Vehiclenew_orders: Arrayidx: int = -1
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1381Sim._stops_problemfuncA line with no vehicles can still be checked for its stops: what check_orders asks of every model, without the model.Link zu diesem Eintragfunc _stops_problem(kind: String, stops: Array, who: Company) -> String- Parameter
kind: Stringstops: Arraywho: Company
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/sim.gd:1402Sim.delete_linefuncDelete a line: its vehicles keep running its stops, each on its own.Link zu diesem Eintragfunc delete_line(ln: Line) -> void- Parameter
ln: Line
- Rückgabewert
void
scripts/sim/sim.gd:1419Sim.buy_for_linefuncBuy one more vehicle for lineln, liketemplate(the same model, cargo and wagons).Link zu diesem Eintragfunc buy_for_line(ln: Line, template: Vehicle) -> DictionaryReturns buy_vehicle's answer.
- Parameter
ln: Linetemplate: Vehicle
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1429Sim.stop_linefuncStop (or start again) every vehicle on a line.Link zu diesem Eintragfunc stop_line(ln: Line, stop: bool) -> void- Parameter
ln: Linestop: bool
- Rückgabewert
void
scripts/sim/sim.gd:1445Sim.renew_linefuncRenew every vehicle on a line that is past its working life.Link zu diesem Eintragfunc renew_line(ln: Line) -> DictionaryReturns {"n", "cost", "reason"}.
- Parameter
ln: Line
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1454Sim.line_by_idfuncLooks for a line with the given ID in the simulation and returnsnullif no line matches.Link zu diesem Eintragfunc line_by_id(line_id: int) -> Line- Parameter
line_id: int
- Rückgabewert
Line
scripts/sim/sim.gd:1470Sim._index_ofstatic funcLink zu diesem Eintragstatic func _index_of(list: Array, st: Station, fallback: int) -> int- Parameter
list: Arrayst: Stationfallback: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:1477Sim._mark_servedfuncLink zu diesem Eintragfunc _mark_served(v: Vehicle) -> void- Parameter
v: Vehicle
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:1487Sim.route_textstatic funcA vehicle's route in a few words: "Ashford → Millbury".Link zu diesem Eintragstatic func route_text(v: Vehicle) -> String- Parameter
v: Vehicle
- Rückgabewert
String
scripts/sim/sim.gd:1496Sim.replace_planfuncWhat swappingvfor a newmodel_idwould take: the model must be of the same kind, on sale, able to carry whatvcarries and able to run its orders (wires for an electric train, a depot where depots are needed).Link zu diesem Eintragfunc replace_plan(v: Vehicle, model_id: String, checked: Dictionary = {}) -> DictionaryA train keeps its wagons, as many as the new engine pulls. Returns {"ok", "reason"} and, when it can be done, "price" (the new one, with its wagons), "trade_in" (what the old one is worth, as when it is sold), "cost" (the difference: negative when the old one is worth more) and "wagons".
checkedremembers the route checks between calls for vehicles of one route.- Parameter
v: Vehiclemodel_id: Stringchecked: Dictionary = {}
- Rückgabewert
Dictionary
- Ruft auf
Data.has_model,Data.model,L.t,Data.available,Data.intro_year
scripts/sim/sim.gd:1513Sim.replace_vehiclefuncSwap a vehicle for a new one of another model, where it stands, as renew_vehicle does for the same model: it keeps its number, name, orders, cargo and history, and is new again.Link zu diesem Eintragfunc replace_vehicle(v: Vehicle, model_id: String, who: Company = null) -> DictionaryCharges the new price less what the old one is worth (see replace_plan, whose answer this returns).
- Parameter
v: Vehiclemodel_id: Stringwho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1540Sim.replace_route_planfuncWhat replace_route would do: {"ok", "reason", "cost" (for all of them together), "vehicles" (the ones that would change), "costs" (for each of those), "skipped" (how many on the route can't take the model, say for their cargo; ones that already are that model aren't counted)}.Link zu diesem Eintragfunc replace_route_plan(v: Vehicle, model_id: String, checked: Dictionary = {}) -> Dictionary- Parameter
v: Vehiclemodel_id: Stringchecked: Dictionary = {}
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1559Sim.replace_routefuncreplace_vehicle for every vehicle onv's route that can take the model (see same_route and replace_route_plan, whose answer this returns): all of them or, when the money isn't there, none.Link zu diesem Eintragfunc replace_route(v: Vehicle, model_id: String, who: Company = null) -> DictionaryThe player is told in one news item.
- Parameter
v: Vehiclemodel_id: Stringwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
L.t,Fmt.money,Data.model
scripts/sim/sim.gd:1577Sim._pay_vehiclesfuncPay for vehicles, or be paid whencostis negative (trading in for something cheaper).Link zu diesem Eintragfunc _pay_vehicles(who: Company, cost: int) -> void- Parameter
who: Companycost: int
- Rückgabewert
void
scripts/sim/sim.gd:1608Sim._becomefuncThe swap itself:vbecomes a brand-newmodel_id(what renew_vehicle resets, on a new model).Link zu diesem Eintragfunc _become(v: Vehicle, model_id: String) -> void- Parameter
v: Vehiclemodel_id: String
- Rückgabewert
void
- Ruft auf
Data.reliability
scripts/sim/sim.gd:1617Sim.AUTO_RENEW_MAXconstMonth end, for the player's company when it has asked for it: renew vehicles past their working life (the ones the news warns about), oldest first, exactly as the Renew button would, while the cash left afterwards stays at or above the company's threshold.Link zu diesem Eintragconst AUTO_RENEW_MAX := 3At most AUTO_RENEW_MAX a month, so a fleet bought together doesn't empty the bank at once. Returns how many were renewed.
Deklariert inscripts/sim/sim.gd:1629Sim._auto_renewfuncLink zu diesem Eintragfunc _auto_renew() -> int- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:1630Sim.refit_costfuncWhat changing a vehicle's cargo would cost.Link zu diesem Eintragfunc refit_cost(v: Vehicle, consist: Array) -> Dictionaryconsist: the cargo of each wagon for a train (front to back, so wagons can be added, dropped or mixed), one cargo for anything else. Returns {"ok", "reason", "cost"}:costis negative when dropping wagons pays more than the rest costs.- Parameter
v: Vehicleconsist: Array
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/sim.gd:1664Sim.refit_placefuncWhere a change of cargo ordered now would be done: "now" (it is standing in one of its depots), "depot" (it goes to one after its next stop), "station" (at its next stop: ships, aircraft, and companies playing without depots that have none on the route) or "" (it needs a depot first).Link zu diesem Eintragfunc refit_place(v: Vehicle) -> String- Parameter
v: Vehicle
- Rückgabewert
String
scripts/sim/sim.gd:1701Sim.refit_planfuncrefit_cost plus "at", where the change would be done (see refit_place); refused when the vehicle needs a depot and none is linked to its route.Link zu diesem Eintragfunc refit_plan(v: Vehicle, consist: Array) -> Dictionary- Parameter
v: Vehicleconsist: Array
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/sim.gd:1714Sim.refit_vehiclefuncOrder a change of what a vehicle carries (see refit_cost) and pay for it.Link zu diesem Eintragfunc refit_vehicle(v: Vehicle, consist: Array, who: Company = null) -> DictionaryThe vehicle delivers what it has at its next stop, takes nothing on and goes to a depot, where finish_refit does the work; its orders, age and history stay. An earlier order still waiting is replaced. Returns refit_plan's answer.
- Parameter
v: Vehicleconsist: Arraywho: Company = null
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1729Sim.cancel_refitfuncCall off a change of cargo that hasn't been done yet; returns the money given back.Link zu diesem Eintragfunc cancel_refit(v: Vehicle, who: Company = null) -> int- Parameter
v: Vehiclewho: Company = null
- Rückgabewert
int
scripts/sim/sim.gd:1752Sim.finish_refitfuncDo the change of cargo a vehicle is waiting for (it has reached the depot).Link zu diesem Eintragfunc finish_refit(v: Vehicle) -> void- Parameter
v: Vehicle
- Rückgabewert
void
scripts/sim/sim.gd:1765Sim._occupied_tilesfuncLink zu diesem Eintragfunc _occupied_tiles() -> Dictionary- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:1779Sim.check_ordersfuncCheck a vehicle order list: returns "" if fine, else why not.Link zu diesem Eintragfunc check_orders(model_id: String, cargo: String, stops: Array, who: Company) -> String- Parameter
model_id: Stringcargo: Stringstops: Arraywho: Company
- Rückgabewert
String
- Ruft auf
Data.model,L.t
scripts/sim/sim.gd:1796Sim.vehicle_pricefuncReturns the model purchase price plus the cost of the specified number of rail wagons.Link zu diesem Eintragfunc vehicle_price(model_id: String, wagons: int) -> intNon-rail models ignore the wagon count. It does not check funds, routes, or sale year.
- Parameter
model_id: Stringwagons: int
- Rückgabewert
int
- Ruft auf
Data.model
scripts/sim/sim.gd:1832Sim.buy_vehiclefuncBuys a model for a route of existing stations.Link zu diesem Eintragfunc buy_vehicle(model_id: String, cargo: String, wagons: int, stops: Array, full_load_first: bool, who: Company = null, consist: Array = [], transfer_at: Array = []) -> Dictionaryfull_load_firstsets the first order’s load flag.consistis one cargo ID per wagon, from front to back; a nonempty rail consist replacescargoandwagons.transfer_atis a list of zero-based stop indices. Checkokand readreasonon failure. A successful purchase returns the newvehicle.- Parameter
model_id: Stringcargo: Stringwagons: intstops: Arrayfull_load_first: boolwho: Company = nullconsist: Array = []transfer_at: Array = []
- Rückgabewert
Dictionary
- Ruft auf
Data.model,L.t,Data.available,Data.intro_year,Fmt.money,Data.reliability,Mods.hook,BuildOps.dir_between
scripts/sim/sim.gd:1840Sim.depots_requiredfuncLink zu diesem Eintragfunc depots_required(who: Company) -> bool- Parameter
who: Company
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:1932Sim.depot_tilesfuncwho's depots for vehicles ofkind(road or rail), as a set of tiles.Link zu diesem Eintragfunc depot_tiles(kind: String, who: Company) -> Dictionary- Parameter
kind: Stringwho: Company
- Rückgabewert
Dictionary
scripts/sim/sim.gd:1937Sim.find_depotfuncThe nearest ofwho's depots that's linked to stationst, or (-1, -1): the one a vehicle leavingstwould drive to.Link zu diesem Eintragfunc find_depot(kind: String, st: Station, who: Company, wired: bool = false) -> Vector2iFor the one a new vehicle drives out of, see depot_out.
- Parameter
kind: Stringst: Stationwho: Companywired: bool = false
- Rückgabewert
Vector2i
scripts/sim/sim.gd:1948Sim.depot_outfuncThe nearest ofwho's depots that a new vehicle can drive out of to stationst, or (-1, -1).Link zu diesem Eintragfunc depot_out(kind: String, st: Station, who: Company, wired: bool = false, obey_signals: bool = true) -> Vector2iSearched from the depot's door to the station, not the other way: one-way signals can let trains from a depot into a station and not back.
- Parameter
kind: Stringst: Stationwho: Companywired: bool = falseobey_signals: bool = true
- Rückgabewert
Vector2i
- Ruft auf
Pathfinder.find
scripts/sim/sim.gd:1958Sim.route_fromfuncThe shortest route from stationstto any of thegoalstiles, as Pathfinder.find returns it ({} when there is none).Link zu diesem Eintragfunc route_from(kind: String, st: Station, goals: Dictionary, wired: bool = false, obey_signals: bool = true) -> DictionaryA station's platforms (or stops) needn't be joined to each other, so every separate one is tried: the route may leave from any of them.
- Parameter
kind: Stringst: Stationgoals: Dictionarywired: bool = falseobey_signals: bool = true
- Rückgabewert
Dictionary
- Ruft auf
Pathfinder.find
scripts/sim/sim.gd:1973Sim.preview_electrifyfuncLink zu diesem Eintragfunc preview_electrify(pts: Array[Vector2i], who: Company = null) -> Dictionary- Parameter
pts: Array[Vector2i]who: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_electrify
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:1996Sim.build_electrifyfuncLink zu diesem Eintragfunc build_electrify(pts: Array[Vector2i], who: Company = null) -> Dictionary- Parameter
pts: Array[Vector2i]who: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.apply_electrify
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:2003Sim.preview_depotfuncLink zu diesem Eintragfunc preview_depot(kind: String, t: Vector2i, facing: int, who: Company = null) -> Dictionary- Parameter
kind: Stringt: Vector2ifacing: intwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_depot,Station.nearest_town
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:2014Sim.build_depotfuncLink zu diesem Eintragfunc build_depot(kind: String, t: Vector2i, facing: int, who: Company = null) -> Dictionary- Parameter
kind: Stringt: Vector2ifacing: intwho: Company = null
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.apply_depot
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/sim.gd:2031Sim.sell_vehiclefuncSell a vehicle.Link zu diesem Eintragfunc sell_vehicle(v: Vehicle, who: Company = null) -> intwhomust own it (defaults to the player); returns the refund, or -1 if refused.- Parameter
v: Vehiclewho: Company = null
- Rückgabewert
int
scripts/sim/sim.gd:2048Sim.company_vehiclesfuncReturns the vehicles owned by the suppliedCompany.Link zu diesem Eintragfunc company_vehicles(who: Company) -> ArrayThe returned array can be filtered or reordered independently, but its vehicle objects are live.
- Parameter
who: Company
- Rückgabewert
Array
scripts/sim/sim.gd:2061Sim.company_valuefuncCalculates cash minus loans plus vehicle resale value, station tile value, and owned track value.Link zu diesem Eintragfunc company_value(who: Company) -> intThis is the value used for company comparisons.
- Parameter
who: Company
- Rückgabewert
int
scripts/sim/sim.gd:2065
Company
Company.COLORSconstLink zu diesem Eintragconst COLORSFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:5Company.CATEGORIESconstLink zu diesem Eintragconst CATEGORIES := ["construction", "vehicles", "running", "property", "infrastructure", "interest", "income"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:8Company.idvarLink zu diesem Eintragvar id := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:10Company.namevarLink zu diesem Eintragvar name := "Fourways Transport Co."Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:11Company.colorvarLink zu diesem Eintragvar color := Color(0.18, 0.45, 0.85)Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:12Company.is_aivarLink zu diesem Eintragvar is_ai := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:13Company.moneyvarThe company’s current cash balance in game dollars.Link zu diesem Eintragvar money: int = Data.START_LOANUse the accounting methods to change it when the transaction should appear in the ledger.
Deklariert inscripts/sim/company.gd:14Company.loanvarThe company’s outstanding debt in game dollars.Link zu diesem Eintragvar loan: int = Data.START_LOANUse
Deklariert inborrowandrepayto adjust cash and debt together.scripts/sim/company.gd:15Company.ledgervarLink zu diesem Eintragvar ledger := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:16Company.ledger_lastvarLink zu diesem Eintragvar ledger_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:17Company.founded_dayvarLink zu diesem Eintragvar founded_day := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:18Company.max_loanvarLink zu diesem Eintragvar max_loan: int = Data.MAX_LOANFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:19Company.rail_tilesvartiles of track owned (counted in company value)Company.historyvarmonthly company value, oldest first (last 120 months)Company.months_in_redvarconsecutive month-ends with a negative balanceCompany.bankruptvarLink zu diesem Eintragvar bankrupt := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:23Company.monthvarthis month so far: "income", "spend" (all), "invest" (building and buying), "cargo": {c: [units, $]}Company.monthsvarclosed months, oldest first (last 24): {"income", "spend", "value", "cargo"}Company.cargo_yearvarcargo -> [units, $] delivered this yearCompany.cargo_lastvarLink zu diesem Eintragvar cargo_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:28Company.kind_yearvarvehicle kind -> $ earned this yearCompany.kind_lastvarLink zu diesem Eintragvar kind_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:30Company.yearsvarclosed years, oldest first (last 60): see_year_rowCompany.auto_renewvarLink zu diesem Eintragvar auto_renew := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:33Company.auto_renew_keepvaronly renew while this much cash is left afterwardsCompany.auto_renew_remindedvarthe year of the last "can't afford to renew" reminderCompany.record_monthfuncLink zu diesem Eintragfunc record_month(value: int) -> void- Parameter
value: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:38Company.note_deliveryfuncA delivery:unitsof cargocpaidpay, carried by a vehicle ofkind.Link zu diesem Eintragfunc note_delivery(c: String, units: int, pay: int, kind: String) -> void- Parameter
c: Stringunits: intpay: intkind: String
- Rückgabewert
void
scripts/sim/company.gd:50Company._initfuncLink zu diesem Eintragfunc _init(p_id: int = 0, p_name: String = "Fourways Transport Co.") -> void- Parameter
p_id: int = 0p_name: String = "Fourways Transport Co."
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/company.gd:61Company.can_affordfuncChecks whether the company’s current cash coverscost.Link zu diesem Eintragfunc can_afford(cost: int) -> boolIt does not borrow money or change its balance.
- Parameter
cost: int
- Rückgabewert
bool
scripts/sim/company.gd:70Company.spendfuncDeducts the cost from cash and records it in the category and monthly accounts.Link zu diesem Eintragfunc spend(cost: int, category: String) -> boolReturns
falseand leaves the accounts untouched if cash is insufficient. Typical categories includeconstructionandvehicles.- Parameter
cost: intcategory: String
- Rückgabewert
bool
scripts/sim/company.gd:74Company.chargefuncCosts that are paid whether or not there is cash (running costs, interest).Link zu diesem Eintragfunc charge(cost: int, category: String) -> void- Parameter
cost: intcategory: String
- Rückgabewert
void
scripts/sim/company.gd:86Company.earnfuncAdds game dollars to cash and records the amount as income in the ledger and current month’s accounts.Link zu diesem Eintragfunc earn(amount: int) -> void- Parameter
amount: int
- Rückgabewert
void
scripts/sim/company.gd:92Company.borrowfuncAdds up toamountto cash and debt, limited by the company’s remaining loan allowance.Link zu diesem Eintragfunc borrow(amount: int) -> boolReturns whether any money was borrowed.
- Parameter
amount: int
- Rückgabewert
bool
scripts/sim/company.gd:98Company.repayfuncRepays up toamount, limited by cash and outstanding debt.Link zu diesem Eintragfunc repay(amount: int) -> boolReturns whether a payment was made.
- Parameter
amount: int
- Rückgabewert
bool
scripts/sim/company.gd:107Company.roll_yearfuncClose the books onyear;valueis the company value at its end.Link zu diesem Eintragfunc roll_year(year: int = 0, value: int = 0) -> void- Parameter
year: int = 0value: int = 0
- Rückgabewert
void
scripts/sim/company.gd:117Company.profitfuncCalculates net profit from a ledger dictionary by subtracting recorded expense categories from income.Link zu diesem Eintragfunc profit(l: Dictionary) -> int- Parameter
l: Dictionary
- Rückgabewert
int
scripts/sim/company.gd:130Company._year_rowfuncA ledger boiled down to one line of the yearly summary.Link zu diesem Eintragfunc _year_row(l: Dictionary, year: int, value: int) -> Dictionary- Parameter
l: Dictionaryyear: intvalue: int
- Rückgabewert
Dictionary
scripts/sim/company.gd:139Company.year_rowsfuncThe yearly summary, oldest first: every closed year, then the year in progress ("open": true).Link zu diesem Eintragfunc year_rows(year: int, month: int, value: int) -> Arrayyearandmonth(0 = January) are today's,valuethe company value now. Saves from before the yearly records were kept still get last year's line, from last year's ledger.- Parameter
year: intmonth: intvalue: int
- Rückgabewert
Array
- Ruft auf
Calendar.from_day
scripts/sim/company.gd:149
Town
Town.idvarLink zu diesem Eintragvar id := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:5Town.namevarLink zu diesem Eintragvar name := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:6Town.cxvarLink zu diesem Eintragvar cx := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:7Town.cyvarLink zu diesem Eintragvar cy := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:8Town.gridvarroad spacing; houses fill the blocks between grid linesTown.popvarLink zu diesem Eintragvar pop := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:10Town.house_countvarLink zu diesem Eintragvar house_count := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:11Town.grow_timervarLink zu diesem Eintragvar grow_timer := 30Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:12Town.paxvarpassengers generated this monthTown.pax_movedvar...and picked up by stationsTown.pax_lastvarLink zu diesem Eintragvar pax_last := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:15Town.pax_moved_lastvarLink zu diesem Eintragvar pax_moved_last := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:16Town.suppliedvargoods and food delivered this monthTown.supplied_lastvarLink zu diesem Eintragvar supplied_last := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:18Town.served_untilvargame day until which the town counts as servedTown.dirtyvartiles changed by growth since the view last redrew themTown.ratingsvarLocal authority: how the council sees each company (company id -> 0..100), and town actions.Town.advertvarcompany id -> game day the advertising campaign endsTown.fund_untilvargame day funded building endsTown.exclusivevarRewards for meeting the council's requests (RAIL-24, Opportunities): the company with exclusive transport rights here (-1: none) and the day they end, and company id -> the day its half-price stations and depots end.Town.exclusive_untilvarLink zu diesem Eintragvar exclusive_until := -1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:29Town.cheapvarLink zu diesem Eintragvar cheap := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:30Town.rating_logvarWhy each company's rating moved lately: company id -> [{"day", "delta", "why"}], newest last.Town.RATING_STARTconstLink zu diesem Eintragconst RATING_START := 60.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:35Town.RATING_REFUSEconstLink zu diesem Eintragconst RATING_REFUSE := 30.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:36Town.COUNCIL_RADIUSconstLink zu diesem Eintragconst COUNCIL_RADIUS := 18Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:37Town.RATING_CRASHconstLink zu diesem Eintragconst RATING_CRASH := -20.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:38Town.RATING_NEGLECT_FLOORconstNeglect alone never costs a company its building permission: it stops lowering the rating here.Town.RATING_HOUSEconstWhat demolition costs, per tile.Link zu diesem Eintragconst RATING_HOUSE := -8.0Tree clearing in one bulldoze action never costs more than RATING_TREES_MAX, so cutting a strip for a railway is a nuisance, not a ban.
Deklariert inscripts/sim/town.gd:43Town.RATING_STREETconstLink zu diesem Eintragconst RATING_STREET := -3.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:44Town.RATING_TREEconstLink zu diesem Eintragconst RATING_TREE := -0.5Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:45Town.RATING_TREES_MAXconstLink zu diesem Eintragconst RATING_TREES_MAX := -6.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:46Town.BUSY_NOISEconstHow far the noise of a busy industry lowers land values (Industry.BUSY, land_value).Town.LOG_SIZEconstLink zu diesem Eintragconst LOG_SIZE := 8Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:49Town.ratingfuncReturns the council’s current rating for a company ID on the 0–100 scale.Link zu diesem Eintragfunc rating(cid: int) -> floatCompanies without a recorded rating receive the starting value.
- Parameter
cid: int
- Rückgabewert
float
scripts/sim/town.gd:52Town.change_ratingfuncwhy(a short phrase such as "Demolished buildings") anddayrecord the change in the rating log, so the town window can explain where a rating came from.Link zu diesem Eintragfunc change_rating(cid: int, delta: float, why: String = "", day: int = -1) -> void- Parameter
cid: intdelta: floatwhy: String = ""day: int = -1
- Rückgabewert
void
scripts/sim/town.gd:58Town.is_streetfuncA town's own streets: roads inside the built-up area.Link zu diesem Eintragfunc is_street(x: int, y: int) -> boolRoads a company lays in open country aren't.
- Parameter
x: inty: int
- Rückgabewert
bool
scripts/sim/town.gd:77Town.rating_namestatic funcLink zu diesem Eintragstatic func rating_name(r: float) -> String- Parameter
r: float
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:81Town._markfuncLink zu diesem Eintragfunc _mark(x: int, y: int) -> void- Parameter
x: inty: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:91Town._initfuncLink zu diesem Eintragfunc _init(p_id: int, p_name: String, x: int, y: int, p_grid: int) -> void- Parameter
p_id: intp_name: Stringx: inty: intp_grid: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:96Town.roll_monthfuncLink zu diesem Eintragfunc roll_month() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:104Town.growth_intervalfuncDays between growth spurts: faster when served by stations and supplied with goods / food.Link zu diesem Eintragfunc growth_interval(day: int) -> int- Parameter
day: int
- Rückgabewert
int
- Ruft auf
Data.era_index,Calendar.from_day
scripts/sim/town.gd:117Town.boundsfuncTile rectangle the town's buildings occupy (used for redraws after growth).Link zu diesem Eintragfunc bounds() -> Rect2i- Rückgabewert
Rect2i
scripts/sim/town.gd:131Town.on_grid_xfuncLink zu diesem Eintragfunc on_grid_x(x: int) -> bool- Parameter
x: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:136Town.on_grid_yfuncLink zu diesem Eintragfunc on_grid_y(y: int) -> bool- Parameter
y: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:140Town.seed_roadsfuncThe initial crossroads at the town centre.Link zu diesem Eintragfunc seed_roads(m: WorldMap, rng: RandomNumberGenerator) -> void- Parameter
m: WorldMaprng: RandomNumberGenerator
- Rückgabewert
void
- Ruft auf
BuildOps.can_link_road,BuildOps.link_road
scripts/sim/town.gd:145Town.zone_popvarPeople by zone (kept up to date as buildings come and go), the street layout, and what this town needs most right now.Link zu diesem Eintragvar zone_pop := {"R": 0, "C": 0, "I": 0, "L": 0, "A": 0}Deklariert inscripts/sim/town.gd:159Town.layoutvargrid | organicTown.stylevarbuilding style: classic | tudor | mediterranean | nordic | brickTown.landmarksvarbuilding type -> true once builtTown.pop_historyvarpopulation at each month end (last 36)Town.demandfuncResidential / commercial / industrial demand, each -1..1 (SimCity's RCI meter).Link zu diesem Eintragfunc demand(day: int = -1) -> Vector3Homes follow jobs, shops follow residents and deliveries, workshops follow residents.
- Parameter
day: int = -1
- Rückgabewert
Vector3
scripts/sim/town.gd:168Town._pick_zonefuncLink zu diesem Eintragfunc _pick_zone(rng: RandomNumberGenerator, day: int) -> String- Parameter
rng: RandomNumberGeneratorday: int
- Rückgabewert
String
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:180Town.land_valuefuncLand value of a plot (roughly 0..100): the centre, busy stations, water, trees and landmarks raise it; industry and railway noise lower it.Link zu diesem Eintragfunc land_value(m: WorldMap, x: int, y: int, ctx: Dictionary) -> floatctxmay carry "stations" (served station positions), "industries" and "busy" (positions of well-staffed industries, heard up to BUSY_NOISE tiles away: RAIL-28) from the sim.- Parameter
m: WorldMapx: inty: intctx: Dictionary
- Rückgabewert
float
scripts/sim/town.gd:195Town._type_forfuncThe building a zone gets on a plot of this land value, in this year's style.Link zu diesem Eintragfunc _type_for(zone: String, lv: float, rng: RandomNumberGenerator, year: int = 1950) -> String- Parameter
zone: Stringlv: floatrng: RandomNumberGeneratoryear: int = 1950
- Rückgabewert
String
- Ruft auf
Data.can_build
scripts/sim/town.gd:240Town.growfuncOne growth step: maybe a landmark, else a building for the zone in demand, a new street, or a rebuild into something denser where land has become valuable.Link zu diesem Eintragfunc grow(m: WorldMap, rng: RandomNumberGenerator, ctx: Dictionary = {}) -> bool- Parameter
m: WorldMaprng: RandomNumberGeneratorctx: Dictionary = {}
- Rückgabewert
bool
scripts/sim/town.gd:267Town._try_housefuncLink zu diesem Eintragfunc _try_house(m: WorldMap, x: int, y: int, rng: RandomNumberGenerator, zone: String = "R", ctx: Dictionary = {}) -> bool- Parameter
m: WorldMapx: inty: intrng: RandomNumberGeneratorzone: String = "R"ctx: Dictionary = {}
- Rückgabewert
bool
- Ruft auf
BuildOps.can_build_house,Const.opp
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:290Town._try_roadfuncLink zu diesem Eintragfunc _try_road(m: WorldMap, x: int, y: int, rng: RandomNumberGenerator) -> bool- Parameter
m: WorldMapx: inty: intrng: RandomNumberGenerator
- Rückgabewert
bool
- Ruft auf
BuildOps.can_link_road,BuildOps.link_road
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:306Town._organic_okfuncOrganic streets wander, but never run right alongside another street (which would leave no room for buildings).Link zu diesem Eintragfunc _organic_ok(m: WorldMap, x: int, y: int, d: int) -> bool- Parameter
m: WorldMapx: inty: intd: int
- Rückgabewert
bool
scripts/sim/town.gd:345Town._try_upgradefuncLink zu diesem Eintragfunc _try_upgrade(m: WorldMap, rng: RandomNumberGenerator, ctx: Dictionary = {}) -> bool- Parameter
m: WorldMaprng: RandomNumberGeneratorctx: Dictionary = {}
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:358Town._try_landmarkfuncLandmarks arrive as the town grows: a church, then a park, then a town hall.Link zu diesem Eintragfunc _try_landmark(m: WorldMap, rng: RandomNumberGenerator) -> boolAttractions (cinema, museum, funfair, stadium, and a resort by the sea) follow as it gets bigger.
- Parameter
m: WorldMaprng: RandomNumberGenerator
- Rückgabewert
bool
scripts/sim/town.gd:392Town._place_landmarkfuncLink zu diesem Eintragfunc _place_landmark(m: WorldMap, rng: RandomNumberGenerator, want: String) -> bool- Parameter
m: WorldMaprng: RandomNumberGeneratorwant: String
- Rückgabewert
bool
- Ruft auf
BuildOps.can_build_house
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:418Town._redevelopfuncNo free plot: rebuild a modest building near the centre as the new landmark or attraction.Link zu diesem Eintragfunc _redevelop(m: WorldMap, rng: RandomNumberGenerator, want: String, r: int) -> bool- Parameter
m: WorldMaprng: RandomNumberGeneratorwant: Stringr: int
- Rückgabewert
bool
scripts/sim/town.gd:432Town.pick_stylestatic funcA town's building style, from where it stands: seaside towns lean Mediterranean, hill towns Nordic, the rest a mix.Link zu diesem Eintragstatic func pick_style(m: WorldMap, t: Town) -> StringDerived from the name so it doesn't disturb world generation.
- Parameter
m: WorldMapt: Town
- Rückgabewert
String
scripts/sim/town.gd:462Town._near_seafuncLink zu diesem Eintragfunc _near_sea(m: WorldMap) -> bool- Parameter
m: WorldMap
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:478Town._place_attractionfuncAttractions go on a free plot by a road: the stadium and funfair towards the edge of town, the resort by the water, the rest near the centre.Link zu diesem Eintragfunc _place_attraction(m: WorldMap, rng: RandomNumberGenerator, want: String) -> bool- Parameter
m: WorldMaprng: RandomNumberGeneratorwant: String
- Rückgabewert
bool
- Ruft auf
BuildOps.can_build_house
scripts/sim/town.gd:489Town._water_distancefuncLink zu diesem Eintragfunc _water_distance(m: WorldMap, x: int, y: int) -> float- Parameter
m: WorldMapx: inty: int
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:525Town._set_buildingfuncLink zu diesem Eintragfunc _set_building(o: Dictionary, type: String, rng: RandomNumberGenerator) -> void- Parameter
o: Dictionarytype: Stringrng: RandomNumberGenerator
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:534Town._countfuncLink zu diesem Eintragfunc _count(type: String, people: int) -> void- Parameter
type: Stringpeople: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:544Town.remove_buildingfuncRemove a building's people (it was demolished).Link zu diesem Eintragfunc remove_building(o: Dictionary) -> void- Parameter
o: Dictionary
- Rückgabewert
void
scripts/sim/town.gd:551Town.restore_buildingfuncPut back a building's people (its demolition was undone): the opposite of remove_building.Link zu diesem Eintragfunc restore_building(o: Dictionary) -> void- Parameter
o: Dictionary
- Rückgabewert
void
scripts/sim/town.gd:559Town.recountfuncRebuild the zone tallies from the map (after loading).Link zu diesem Eintragfunc recount(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/town.gd:567Town.recount_allstatic funcrecountfor every town of the map in one pass over its tiles.Link zu diesem Eintragstatic func recount_all(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/town.gd:578Town.place_housefuncPlace a house facing directionfacing(towards its road).Link zu diesem Eintragfunc place_house(m: WorldMap, x: int, y: int, facing: int, type: String, rng: RandomNumberGenerator) -> void- Parameter
m: WorldMapx: inty: intfacing: inttype: Stringrng: RandomNumberGenerator
- Rückgabewert
void
scripts/sim/town.gd:592Town.MODESTconstLink zu diesem Eintragconst MODEST := ["cottage", "house", "shop", "modern", "workshop"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:619Town.size_ofstatic funcHow many tiles along each side a building oftypetakes.Link zu diesem Eintragstatic func size_of(type: String) -> int- Parameter
type: String
- Rückgabewert
int
scripts/sim/town.gd:623Town.building_atstatic funcThe town building on tilet, whichever of its tiles that is; null where there is none.Link zu diesem Eintragstatic func building_at(m: WorldMap, t: Vector2i) -> Variant- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
Variant
scripts/sim/town.gd:628Town.anchor_ofstatic funcThe north-west tile of the building ont(titself for a one-tile building).Link zu diesem Eintragstatic func anchor_of(m: WorldMap, t: Vector2i) -> Vector2i- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
Vector2i
scripts/sim/town.gd:638Town.footprintstatic funcEvery tile of the building whose north-west tile isanchor.Link zu diesem Eintragstatic func footprint(m: WorldMap, anchor: Vector2i) -> Array[Vector2i]- Parameter
m: WorldMapanchor: Vector2i
- Rückgabewert
Array[Vector2i]
scripts/sim/town.gd:644Town.big_plotfuncThe 2 x 2 plot for a big building whose front tile (x, y) faces a road in directionfacing: it reaches one tile back from the road and one to either side, whichever is free.Link zu diesem Eintragfunc big_plot(m: WorldMap, x: int, y: int, facing: int, rebuild: bool = false) -> Rect2iWith
rebuild, a tile holding a modest building of this town counts as free (the building makes way). An empty rect where there is no room.- Parameter
m: WorldMapx: inty: intfacing: intrebuild: bool = false
- Rückgabewert
Rect2i
scripts/sim/town.gd:658Town._plot_freefuncLink zu diesem Eintragfunc _plot_free(m: WorldMap, t: Vector2i, rebuild: bool) -> bool- Parameter
m: WorldMapt: Vector2irebuild: bool
- Rückgabewert
bool
- Ruft auf
BuildOps.can_build_house
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/town.gd:673Town._place_bigfuncPut a big building onplot(see big_plot), facingfacing.Link zu diesem Eintragfunc _place_big(m: WorldMap, plot: Rect2i, facing: int, type: String, rng: RandomNumberGenerator) -> void- Parameter
m: WorldMapplot: Rect2ifacing: inttype: Stringrng: RandomNumberGenerator
- Rückgabewert
void
scripts/sim/town.gd:683Town.restore_annexesstatic funcMark the other tiles of every big building (after loading: only its own tile is saved).Link zu diesem Eintragstatic func restore_annexes(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/town.gd:705Town.enlarge_old_buildingsstatic funcA game saved before big buildings has its stadium on a single tile.Link zu diesem Eintragstatic func enlarge_old_buildings(m: WorldMap) -> voidGive each one its full plot where there is room behind it - modest buildings next door make way, as they do when a town builds a new one - and leave it small where roads or bigger buildings hem it in.
- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/town.gd:720
Station
Station.CATCH_RAILconstLink zu diesem Eintragconst CATCH_RAIL := 4Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:5Station.CATCH_ROADconstLink zu diesem Eintragconst CATCH_ROAD := 3Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:6Station.CATCH_DOCKconstLink zu diesem Eintragconst CATCH_DOCK := 4Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:7Station.CATCH_AIRconstLink zu diesem Eintragconst CATCH_AIR := 5Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:8Station.TRANSFER_DISTANCEconstLink zu diesem Eintragconst TRANSFER_DISTANCE := 3Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:9Station.SUFFIXESconstLink zu diesem Eintragconst SUFFIXESFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:10Station.idvarLink zu diesem Eintragvar id := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:13Station.namevarLink zu diesem Eintragvar name := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:14Station.tilesvarLink zu diesem Eintragvar tiles: Array[Vector2i] = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:15Station.has_railvarLink zu diesem Eintragvar has_rail := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:16Station.has_roadvarLink zu diesem Eintragvar has_road := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:17Station.has_dockvarLink zu diesem Eintragvar has_dock := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:18Station.has_airvarLink zu diesem Eintragvar has_air := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:19Station.catchmentvartile index -> trueStation.acceptsvarCargo IDs that can be delivered in this station’s catchment.Link zu diesem Eintragvar accepts: Array = []A vehicle can unload and earn a fare here for a supported cargo.
Deklariert inscripts/sim/station.gd:21Station.suppliesvarCargo IDs supplied by towns or industries in the station’s catchment.Link zu diesem Eintragvar supplies: Array = []Read
Deklariert inwaitingfor the amount currently available to load.scripts/sim/station.gd:22Station.deletedvarLink zu diesem Eintragvar deleted := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:23Station.ownervarThe company that owns the station.Link zu diesem Eintragvar owner: Company = nullCan be
Deklariert innull, for example at an oil rig dock. Useusable_by(company)to check access.scripts/sim/station.gd:24Station.rigvarThe industry out at sea this dock is built into (an oil rig), or null.Link zu diesem Eintragvar rig: Industry = nullSuch a dock belongs to nobody: every company's ships may call there, and it is never built or removed by hand.
Deklariert inscripts/sim/station.gd:27Station.townvarthe town whose council looks after this station's areaStation.attractionsvarattraction types inside the catchment (tourist fares)Station.workersvaran industry in reach employs passengers who come here (RAIL-28)Station.waitingvaramount waiting (float)Station.transfersvarCargo left here by vehicles with a transfer order, for another vehicle to carry on (RAIL-20): [{"amt", "c", "from", "pos", "day", "credit"}], oldest first.Link zu diesem Eintragvar transfers: Array = []It is part of
Deklariert inwaitingtoo; these packets remember where and when it was first loaded, so the last leg is paid for the whole trip.scripts/sim/station.gd:37Station.ratingvar0..1, share of nearby production this station receivesStation.servedvartrue once a vehicle with this cargo has orders hereStation.last_pickupvargame day of the last loading attemptStation.last_speedvarspeed of the last vehicle that loaded here (tiles/day)Station.last_agevarage in years of the last vehicle that loaded hereStation.first_arrivalvarLink zu diesem Eintragvar first_arrival := trueFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:43Station.match_toldvarthe player has had the news of this station's first match dayStation.last_visitvargame day a vehicle last called hereStation.pickedvarcargo -> units loaded this monthStation.picked_lastvarLink zu diesem Eintragvar picked_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:47Station.deliveredvarcargo -> units unloaded (and paid for) this monthStation.delivered_lastvarLink zu diesem Eintragvar delivered_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:49Station.earnedvarfares paid for deliveries here this monthStation.earned_lastvarLink zu diesem Eintragvar earned_last := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:51Station.inflowvarHow much of each cargo comes here in a month, as a running estimate (Economy._update_ratings): what waits beyond this slowly gives up (RAIL-56).Link zu diesem Eintragvar inflow := {}Production and transfers count; a match-day crowd doesn't, so the fans who can't get away go home over the following weeks.
Deklariert inscripts/sim/station.gd:55Station.arrivedvarcargo -> units come since the last production runStation.catch_rectvarLink zu diesem Eintragvar catch_rect := Rect2i()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:59Station.house_okvarLink zu diesem Eintragvar house_ok := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:60Station._housesvarLink zu diesem Eintragvar _houses := PackedInt32Array()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:61Station.roll_monthfuncLink zu diesem Eintragfunc roll_month() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:64Station._initfuncLink zu diesem Eintragfunc _init(p_id: int, p_name: String) -> void- Parameter
p_id: intp_name: String
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:73Station.tiles_offuncTiles vehicles ofkindstop on: platforms, road stops, the water in front of a dock, the airfield.Link zu diesem Eintragfunc tiles_of(m: WorldMap, kind: String) -> Dictionary- Parameter
m: WorldMapkind: String
- Rückgabewert
Dictionary
scripts/sim/station.gd:79Station.usable_byfuncWhetherwho's vehicles may have orders here: its own stations and the open docks of oil rigs.Link zu diesem Eintragfunc usable_by(who: Company) -> bool- Parameter
who: Company
- Rückgabewert
bool
scripts/sim/station.gd:100Station.has_kindfuncTests whether the station supportsrail,road,water, orair.Link zu diesem Eintragfunc has_kind(kind: String) -> boolFor ships use
water, even though the construction kind for a dock isdock.- Parameter
kind: String
- Rückgabewert
bool
scripts/sim/station.gd:104Station.transfer_neighborsfuncOther stations of the same company within TRANSFER_DISTANCE steps of any of our tiles.Link zu diesem Eintragfunc transfer_neighbors(m: WorldMap) -> Array[Station]- Parameter
m: WorldMap
- Rückgabewert
Array[Station]
scripts/sim/station.gd:114Station.transfer_amountfuncUnits ofcleft here by transfers and still waiting.Link zu diesem Eintragfunc transfer_amount(c: String) -> int- Parameter
c: String
- Rückgabewert
int
scripts/sim/station.gd:132Station.add_transferfuncLeave cargo from a vehicle here for another to pick up (see Economy.unload).Link zu diesem Eintragfunc add_transfer(p: Dictionary) -> void- Parameter
p: Dictionary
- Rückgabewert
void
scripts/sim/station.gd:141Station.add_waitingfuncCargoccomes here to wait: counted inwaitingand in what arrives (seeinflow).Link zu diesem Eintragfunc add_waiting(c: String, amt: float) -> void- Parameter
c: Stringamt: float
- Rückgabewert
void
scripts/sim/station.gd:147Station.take_transfersfuncTake up tonunits of transferredc(oldest first), as packets to put on board.Link zu diesem Eintragfunc take_transfers(c: String, n: int) -> ArrayWaiting cargo that went away (a poor rating, the cap) takes the transferred share with it first.
- Parameter
c: Stringn: int
- Rückgabewert
Array
scripts/sim/station.gd:154Station.platform_lenfuncLength in tiles of the platformtis part of: the straight row of this station's rail tiles along the track throught(0 iftisn't one of them).Link zu diesem Eintragfunc platform_len(m: WorldMap, t: Vector2i) -> int- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
int
scripts/sim/station.gd:185Station.longest_platformfuncThe longest of this station's platforms, in tiles (0 without any).Link zu diesem Eintragfunc longest_platform(m: WorldMap) -> int- Parameter
m: WorldMap
- Rückgabewert
int
scripts/sim/station.gd:205Station.air_posfuncWhere aircraft park: the middle of the runway.Link zu diesem Eintragfunc air_pos(m: WorldMap) -> Vector2- Parameter
m: WorldMap
- Rückgabewert
Vector2
scripts/sim/station.gd:215Station.is_runwaystatic funcAirfields are 3 x 2 tiles: the runway is the first row (axis 0) or first column (axis 1).Link zu diesem Eintragstatic func is_runway(o: Dictionary) -> bool- Parameter
o: Dictionary
- Rückgabewert
bool
scripts/sim/station.gd:227Station.total_waitingfuncSums the station’s waiting quantities across all cargo IDs and converts the result to a whole number.Link zu diesem Eintragfunc total_waiting() -> intFor a single cargo read that key in
waiting.- Rückgabewert
int
scripts/sim/station.gd:232Station.sign_posfuncReturns the average position of the station’s tile centers, in world tile coordinates.Link zu diesem Eintragfunc sign_pos() -> Vector2Useful for locating a news item on the map.
- Rückgabewert
Vector2
scripts/sim/station.gd:239Station.stop_posfuncFor a road vehicle, point to the roadside stop even when it shares a station with other modes.Link zu diesem Eintragfunc stop_pos(m: WorldMap, kind: String) -> Vector2- Parameter
m: WorldMapkind: String
- Rückgabewert
Vector2
scripts/sim/station.gd:247Station.refreshfuncRecompute station type flags, catchment and what it accepts / supplies.Link zu diesem Eintragfunc refresh(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/station.gd:257Station.refresh_coveragefuncRecheck what reaches this station after its surroundings change.Link zu diesem Eintragfunc refresh_coverage(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/station.gd:300Station.house_tilesfuncThe tiles of the catchment with a house on them, in catchment order.Link zu diesem Eintragfunc house_tiles(m: WorldMap) -> PackedInt32Array- Parameter
m: WorldMap
- Rückgabewert
PackedInt32Array
scripts/sim/station.gd:309Station.add_catchmentstatic funcLink zu diesem Eintragstatic func add_catchment(m: WorldMap, catch: Dictionary, t: Vector2i, r: int) -> void- Parameter
m: WorldMapcatch: Dictionaryt: Vector2ir: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:335Station.coveragestatic funcWhat a catchment area accepts and supplies.Link zu diesem Eintragstatic func coverage(m: WorldMap, catch: Dictionary) -> DictionaryTowns accept passengers from 12 residents and goods / food from 60; houses supply passengers and mail (waste too, from the Late century). Some buildings take more in later eras, and so does every house of a big enough town (Data.TOWN_TAKES: electronics, cars). An industry that employs people takes passengers as workers and sends some home again ("workers": true).
- Parameter
m: WorldMapcatch: Dictionary
- Rückgabewert
Dictionary
scripts/sim/station.gd:346Station.nearest_townstatic funcLink zu diesem Eintragstatic func nearest_town(m: WorldMap, p: Vector2, within: float) -> Town- Parameter
m: WorldMapp: Vector2within: float
- Rückgabewert
Town
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:409Station.make_namestatic funcLink zu diesem Eintragstatic func make_name(m: WorldMap, at: Vector2i) -> String- Parameter
m: WorldMapat: Vector2i
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/station.gd:420
Vehicle
Vehicle.LOCO_LENconstLink zu diesem Eintragconst LOCO_LEN := 0.56Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:8Vehicle.CAR_LENconstLink zu diesem Eintragconst CAR_LEN := 0.5Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:9Vehicle.RV_LENconstLink zu diesem Eintragconst RV_LEN := 0.46Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:10Vehicle.SHIP_LENconstLink zu diesem Eintragconst SHIP_LEN := 0.9Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:11Vehicle.PLANE_LENconstLink zu diesem Eintragconst PLANE_LEN := 0.7Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:12Vehicle.CRUISEconstflight altitude above the groundVehicle.LOAD_RATEconstunits moved per day while loadingVehicle.LANEconstroad vehicles keep right by this muchVehicle.ROAD_GAPconstQueues (RAIL-26).Link zu diesem Eintragconst ROAD_GAP := 0.12A road vehicle keeps ROAD_GAP behind the one ahead in its lane and, stuck for ROAD_GIVE_UP days, drives through, so a jam always clears (as trains do at signals). A ship waits for a free berth and a plane holds for a free stand at most QUEUE_GIVE_UP days, then goes in anyway.
Deklariert inscripts/sim/vehicle.gd:19Vehicle.ROAD_GIVE_UPconstLink zu diesem Eintragconst ROAD_GIVE_UP := 3.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:20Vehicle.QUEUE_GIVE_UPconstLink zu diesem Eintragconst QUEUE_GIVE_UP := 15.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:21Vehicle.STANDSconstaircraft an airport takes at a timeVehicle.HOLD_ATconsthow far out a plane asks for a stand: where it would start to descendVehicle.HOLD_Rconstradius of the circle a plane holds on, at cruising height...Vehicle.HOLD_STEPconst...or that much wider, or twice that (see _hold_r)Vehicle.HOLD_BANKconsthow far it leans into that circle (radians)Vehicle.ORDER_FLAGSconstWhat an order can say besides "full": leave unaccepted cargo for another vehicle (RAIL-20); unload everything and take nothing on; deliver but take nothing on; call at a depot before the next stop (RAIL-36).Link zu diesem Eintragconst ORDER_FLAGS := ["transfer", "unload", "no_load", "depot"]Saved in this order (see SaveGame).
Deklariert inscripts/sim/vehicle.gd:30Vehicle.idvarLink zu diesem Eintragvar id := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:32Vehicle.namevarLink zu diesem Eintragvar name := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:33Vehicle.model_idvarLink zu diesem Eintragvar model_id := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:34Vehicle.modelvarLink zu diesem Eintragvar model: DictionaryFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:35Vehicle.kindvarLink zu diesem Eintragvar kind := "road"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:36Vehicle.cargovarLink zu diesem Eintragvar cargo := "pax"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:37Vehicle.wagonsvarLink zu diesem Eintragvar wagons := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:38Vehicle.ownervarLink zu diesem Eintragvar owner: CompanyFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:39Vehicle.ordersvar[{"st": Station, "full": bool, and any of ORDER_FLAGS: bool (missing: false)}]Vehicle.order_idxvarLink zu diesem Eintragvar order_idx := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:41Vehicle.statevarloading | moving | lost | stopped | servicing | wrecked (see Sim.wrecks)Vehicle.statusvarLink zu diesem Eintragvar status := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:44Vehicle.timervarLink zu diesem Eintragvar timer := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:45Vehicle.segsvarpath history; the last one is the one the head is onVehicle.tvarprogress along the last segment (0..1)Vehicle.routevarLink zu diesem Eintragvar route: Array[Vector2i] = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:48Vehicle.rpvarindex inrouteof the tile the head is inVehicle.speedvarcurrent speed, tiles per dayVehicle.at_stationvarLink zu diesem Eintragvar at_station: Station = nullFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:51Vehicle.lost_ctxvarLink zu diesem Eintragvar lost_ctx := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:52Vehicle.lost_triesvarLink zu diesem Eintragvar lost_tries := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:53Vehicle.capvarLink zu diesem Eintragvar cap := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:55Vehicle.packetsvar[{"amt": int, "from": Station, "day": float}]Vehicle.profit_thisvarLink zu diesem Eintragvar profit_this := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:57Vehicle.profit_lastvarLink zu diesem Eintragvar profit_last := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:58Vehicle.income_totalvarLink zu diesem Eintragvar income_total := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:59Vehicle.age_daysvarLink zu diesem Eintragvar age_days := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:60Vehicle.costvarLink zu diesem Eintragvar cost := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:61Vehicle.tripsvarLink zu diesem Eintragvar trips := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:62Vehicle.stopped_by_playervarLink zu diesem Eintragvar stopped_by_player := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:63Vehicle.sig_waitvardays spent waiting at a red signal or in front of a junctionVehicle.held_atvarWhat the train waited at when it last moved: 0 nothing, 1 a signal, 2 a junction (RAIL-80).Vehicle.GIVE_UP_DAYSconsta train held this long at a signal or junction is deadlockedVehicle._backoff_tryvarwhen it last tried turning round out of a deadlockVehicle._backed_off_atvarwhen it last didVehicle._forced_atvarwhen it last went on anyway, unable to turn roundVehicle._turnedvar_held_up turned it round just now (see _advance)Vehicle._detour_dayvarwhen it last looked for a way round a busy stretch (see _detour)Vehicle.queue_waitvardays held up in a queue: in traffic, for a berth, or holding (RAIL-26)Vehicle.hold_avaraircraft holding over a full airport: its angle round the circle, -1 when notVehicle.old_warnedvarLink zu diesem Eintragvar old_warned := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:75Vehicle.electricvarneeds overhead wires (set from the model)Vehicle.wagon_cargosvartrains: the cargo of each wagon, front to back (mixed trains)Vehicle.reliabilityvar0..1; wears down day by day, restored by servicingVehicle.last_servicevargame day of the last serviceVehicle.breakdownsvarLink zu diesem Eintragvar breakdowns := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:80Vehicle.brokenvardays left standing broken downVehicle.service_tovarthe depot it's heading to for servicingVehicle.load_avgvarrunning average of how full it leaves stations (0..1), -1 until knownVehicle.last_tripvarlast paid delivery: {"pay", "units", "day", "st"}Vehicle.look_revvargoes up when a refit changes how it looks (the view redraws it)Vehicle.refit_tovara change of cargo ordered and paid for, done at the depot (see refit)Vehicle.refit_paidvarwhat ordering it cost (given back if it is cancelled)Vehicle.stuck_cargovara cargo on board that no stop in the orders accepts (see _check_stuck)Vehicle.stuck_stopsvarstops it has called at with that cargo on board, undeliveredVehicle.stuck_newsvargame day the player was last told about it (-1: never)Vehicle.linevarthe line it runs on (itsordersare then the line's), or nullVehicle.lap_startvargame day it last left its line's first stop (-1: not yet)Vehicle.heldvardays held at the first stop this round to keep the line evenly spacedVehicle.air_fromvarLink zu diesem Eintragvar air_from := Vector2.ZEROFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:95Vehicle.air_tovarLink zu diesem Eintragvar air_to := Vector2.ZEROFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:96Vehicle.air_dvarLink zu diesem Eintragvar air_d := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:97Vehicle.air_y0varLink zu diesem Eintragvar air_y0 := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:98Vehicle.air_y1varLink zu diesem Eintragvar air_y1 := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:99Vehicle._accelvaracceleration as a multiple of the top speed, by kindVehicle._lenvarlength of a road vehicle, ship or aircraft (of model_len_of)Vehicle._len_ofvarLink zu diesem Eintragvar _len_of := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:103Vehicle._back_uvarsecond result of _back_iVehicle._routesvarroutes found before, by order (see _find)Vehicle._fitvartrains: the share of the train alongside the platform it stands atVehicle._coursevarships: the straight courseroutefollows (see water_course), {} for noneVehicle._queuedvarheld up in a queue this step (counts towardsqueue_wait)Vehicle._blocked_byvarroad vehicles: id of the one it is keeping behind (0: none)Vehicle.route_cachestatic varSwitch for the tests: with it off every departure searches for its route again.Vehicle._seg_cachestatic varmake_seg results by tile, sides and shapeVehicle.SEG_CACHE_MAXconstLink zu diesem Eintragconst SEG_CACHE_MAX := 200000Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:113Vehicle._initfuncLink zu diesem Eintragfunc _init(p_id: int, p_model: String, p_cargo: String, p_wagons: int, p_owner: Company) -> void- Parameter
p_id: intp_model: Stringp_cargo: Stringp_wagons: intp_owner: Company
- Rückgabewert
void
- Ruft auf
Data.model,Data.wagon_cap
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:116Vehicle._default_namefuncThe name a vehicle gets when bought: what it is and its number.Link zu diesem Eintragfunc _default_name() -> String- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/vehicle.gd:135Vehicle.load_amountfuncLink zu diesem Eintragfunc load_amount() -> int- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:145Vehicle.set_consistfuncA train's wagons, one cargo each (front to back).Link zu diesem Eintragfunc set_consist(list: Array) -> voidcargobecomes the first wagon's.- Parameter
list: Array
- Rückgabewert
void
- Ruft auf
Data.wagon_cap
scripts/sim/vehicle.gd:153Vehicle.refitfuncChange what the vehicle carries: a train's wagons (one cargo each, front to back) or the one cargo of anything else.Link zu diesem Eintragfunc refit(list: Array, m: WorldMap = null) -> voidCargo on board that no longer has room is lost. Sim.refit_vehicle orders it and Sim.finish_refit calls this once the vehicle is at a depot.
- Parameter
list: Arraym: WorldMap = null
- Rückgabewert
void
scripts/sim/vehicle.gd:168Vehicle._trim_loadfuncDrop what no longer fits on board (was: the cargo of packets from before they were labelled).Link zu diesem Eintragfunc _trim_load(was: String) -> void- Parameter
was: String
- Rückgabewert
void
scripts/sim/vehicle.gd:187Vehicle.change_modelfuncBecome another model of the same kind, where it stands (see Sim.replace_vehicle, which checks that the model can carry its cargo and run its route).Link zu diesem Eintragfunc change_model(p_model: String) -> voidA train keeps its wagons, as many as the new engine pulls; anything else gets the new model's capacity. Cargo without room is lost.
- Parameter
p_model: String
- Rückgabewert
void
- Ruft auf
Data.model,Data.wagon_cap
scripts/sim/vehicle.gd:205Vehicle._grow_tailfuncLay more history behind the tail, following the track, so a train that just got longer has somewhere to stand (the same walkspawndoes).Link zu diesem Eintragfunc _grow_tail(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
- Ruft auf
Const.opp
scripts/sim/vehicle.gd:228Vehicle.cargosfuncThe cargos this vehicle carries (several for a mixed train).Link zu diesem Eintragfunc cargos() -> Array- Rückgabewert
Array
scripts/sim/vehicle.gd:263Vehicle.is_mixedfuncLink zu diesem Eintragfunc is_mixed() -> bool- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:273Vehicle.cap_offuncReturns the capacity for one cargo ID.Link zu diesem Eintragfunc cap_of(c: String) -> intFor mixed trains, it counts only wagons assigned to that cargo. A cargo the vehicle cannot currently carry has capacity zero.
- Parameter
c: String
- Rückgabewert
int
- Ruft auf
Data.wagon_cap
scripts/sim/vehicle.gd:277Vehicle.load_offuncAdds up the units in the vehicle’s cargo packets for one cargo ID.Link zu diesem Eintragfunc load_of(c: String) -> intThis is the current load, rather than available room.
- Parameter
c: String
- Rückgabewert
int
scripts/sim/vehicle.gd:287Vehicle.running_costfuncReturns the annual running cost of the model plus its wagons.Link zu diesem Eintragfunc running_cost() -> int- Rückgabewert
int
scripts/sim/vehicle.gd:295Vehicle.life_yearsfuncReturns the usual service life in years for the vehicle’s transport kind.Link zu diesem Eintragfunc life_years() -> int- Rückgabewert
int
scripts/sim/vehicle.gd:299Vehicle.is_oldfuncChecks whether the vehicle’s age in days exceeds its service life in years, using 365 days per year.Vehicle.valuefuncReturns the current resale value in dollars.Link zu diesem Eintragfunc value() -> intThe value falls with age and bottoms out at 15 percent of purchase cost.
- Rückgabewert
int
scripts/sim/vehicle.gd:307Vehicle.max_speedfuncReturns the model’s maximum speed in tiles per game day.Link zu diesem Eintragfunc max_speed() -> floatSteam trains lose three percent of model speed per wagon in this calculation.
- Rückgabewert
float
scripts/sim/vehicle.gd:311Vehicle.train_lengthfuncLink zu diesem Eintragfunc train_length() -> float- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:318Vehicle.tiles_longstatic funcHow many platform tiles a train withn_wagonswagons needs to stand alongside in full.Link zu diesem Eintragstatic func tiles_long(n_wagons: int) -> intA buffer's worth of overhang (
OVERHANG_OK) doesn't count: two wagons a tile, less one for the engine, so 3 tiles take 5 wagons.- Parameter
n_wagons: int
- Rückgabewert
int
scripts/sim/vehicle.gd:330Vehicle.OVERHANG_OKconstLink zu diesem Eintragconst OVERHANG_OK := 0.1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:334Vehicle.platform_fitstatic funcThe share of a train oflengthtiles that is alongside a platform ofplatformtiles.Link zu diesem Eintragstatic func platform_fit(length: float, platform: int) -> floatOnly those wagons load and unload at a time, so loading a train longer than the platform takes longer (the rest are drawn up in turns) while its back wagons stick out onto the line behind (RAIL-18).
- Parameter
length: floatplatform: int
- Rückgabewert
float
scripts/sim/vehicle.gd:340Vehicle.body_lenstatic funcLength of a road vehicle, ship or aircraft of this model (see Data.LENGTH).Link zu diesem Eintragstatic func body_len(id: String) -> float- Parameter
id: String
- Rückgabewert
float
- Ruft auf
Data.model,Data.look
scripts/sim/vehicle.gd:347Vehicle.destfuncLink zu diesem Eintragfunc dest() -> Station- Rückgabewert
Station
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:356Vehicle._edgestatic funcLink zu diesem Eintragstatic func _edge(t: Vector2i, d: int) -> Vector2- Parameter
t: Vector2id: int
- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:362Vehicle._centerstatic funcLink zu diesem Eintragstatic func _center(t: Vector2i) -> Vector2- Parameter
t: Vector2i
- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:366Vehicle.make_segstatic funcA segment crossing tilet, entering through sideaand leaving through sideb(-1 means starting or stopping at the tile centre).Link zu diesem Eintragstatic func make_seg(t: Vector2i, a: int, b: int, chord: int = 0) -> Dictionarychord: the piece's shape (see WorldMap.piece_shape) when it is part of a diagonal run or eases into one; the piece is then a cubic curve.- Parameter
t: Vector2ia: intb: intchord: int = 0
- Rückgabewert
Dictionary
- Ruft auf
Const.opp,WorldMap.piece_curve
scripts/sim/vehicle.gd:374Vehicle._seg_lenstatic funcLink zu diesem Eintragstatic func _seg_len(s: Dictionary) -> float- Parameter
s: Dictionary
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:404Vehicle.seg_posstatic funcLink zu diesem Eintragstatic func seg_pos(s: Dictionary, u: float) -> Vector2- Parameter
s: Dictionaryu: float
- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:414Vehicle.seg_dirstatic funcThe way along segmentsatu(not normalised; zero only half-way round a U-turn).Link zu diesem Eintragstatic func seg_dir(s: Dictionary, u: float) -> Vector2- Parameter
s: Dictionaryu: float
- Rückgabewert
Vector2
scripts/sim/vehicle.gd:426Vehicle.rev_segstatic funcLink zu diesem Eintragstatic func rev_seg(s: Dictionary) -> Dictionary- Parameter
s: Dictionary
- Rückgabewert
Dictionary
- Ruft auf
WorldMap.flip_shape
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:437Vehicle._segfuncA segment through tiletthat knows whether it's part of a diagonal run.Link zu diesem Eintragfunc _seg(m: WorldMap, t: Vector2i, a: int, b: int) -> Dictionary- Parameter
m: WorldMapt: Vector2ia: intb: int
- Rückgabewert
Dictionary
scripts/sim/vehicle.gd:442Vehicle.SEA_ROOMconstHow far a ship's straight leg keeps from land on either side (tiles).Vehicle.water_coursestatic funcShips aren't held to the grid: they sail straight legs across open water, which bend only where something is in the way.Link zu diesem Eintragstatic func water_course(m: WorldMap, tiles: Array) -> Dictionarytilesis a route of neighbouring sailable tiles (a Pathfinder answer); the course runs between its ends along the shortest way by water (Pathfinder.find_sea), pulled tight. Returns {"tiles": the tiles the legs pass through, neighbours again, "cross": where the course enters each of them (the first: its centre), "turn": 1 at each tile where two legs meet}.- Parameter
m: WorldMaptiles: Array
- Rückgabewert
Dictionary
- Ruft auf
Pathfinder.find_sea
scripts/sim/vehicle.gd:457Vehicle._sea_clearstatic funcWhether a ship can sail straight from the centre of tileato the centre of tileb, keeping SEA_ROOM clear of anything that isn't open water.Link zu diesem Eintragstatic func _sea_clear(m: WorldMap, a: Vector2i, b: Vector2i) -> bool- Parameter
m: WorldMapa: Vector2ib: Vector2i
- Rückgabewert
bool
scripts/sim/vehicle.gd:498Vehicle._walk_linestatic funcThe tiles a straight line fromptoqpasses through after the first, in order and each the neighbour of the one before (through a corner it goes across first), appended totiles, and where it enters each one appended tocross.Link zu diesem Eintragstatic func _walk_line(p: Vector2, q: Vector2, tiles: Array[Vector2i], cross: PackedVector2Array) -> void- Parameter
p: Vector2q: Vector2tiles: Array[Vector2i]cross: PackedVector2Array
- Rückgabewert
void
scripts/sim/vehicle.gd:515Vehicle.course_segstatic funcThe piece of a ship's course (see water_course) in itskth tile.Link zu diesem Eintragstatic func course_seg(c: Dictionary, k: int, a: int = -2, from: Variant = null) -> Dictionarya: the side it comes in by (-2: from the course, -1: from the tile centre);from: where it starts instead of the course's own entry point (a ship turning onto a new course mid-tile).- Parameter
c: Dictionaryk: inta: int = -2from: Variant = null
- Rückgabewert
Dictionary
- Ruft auf
Const.opp,BuildOps.dir_between
scripts/sim/vehicle.gd:552Vehicle.free_segstatic funcA segment through tilet(sidesatob) along any curve: fromp0top2, pulled towardsc.Link zu diesem Eintragstatic func free_seg(t: Vector2i, a: int, b: int, p0: Vector2, c: Vector2, p2: Vector2) -> Dictionary- Parameter
t: Vector2ia: intb: intp0: Vector2c: Vector2p2: Vector2
- Rückgabewert
Dictionary
scripts/sim/vehicle.gd:569Vehicle.course_segsstatic funcEvery piece of a ship's course, first to last.Link zu diesem Eintragstatic func course_segs(c: Dictionary) -> Array- Parameter
c: Dictionary
- Rückgabewert
Array
scripts/sim/vehicle.gd:576Vehicle._set_routefuncSet off alongtiles(from the head's tile): a ship's course is pulled straight first.Link zu diesem Eintragfunc _set_route(m: WorldMap, tiles: Array[Vector2i]) -> void- Parameter
m: WorldMaptiles: Array[Vector2i]
- Rückgabewert
void
scripts/sim/vehicle.gd:584Vehicle._first_segfuncThe first piece of a new route, from where the head is now.Link zu diesem Eintragfunc _first_seg(m: WorldMap, a: int) -> Dictionary- Parameter
m: WorldMapa: int
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.dir_between
scripts/sim/vehicle.gd:594Vehicle._pos_backfuncWalkdback from the head along the history: {"i": segment index, "u": position in it}.Link zu diesem Eintragfunc _pos_back(d: float) -> Dictionary- Parameter
d: float
- Rückgabewert
Dictionary
scripts/sim/vehicle.gd:605Vehicle._back_ifuncThe same walk as _pos_back without building a Dictionary: returns the segment index and leaves the position in it in_back_u.Link zu diesem Eintragfunc _back_i(d: float) -> int- Parameter
d: float
- Rückgabewert
int
scripts/sim/vehicle.gd:623Vehicle.pos_atfuncPositiondbehind the nose, or Vector2.INF for a hidden segment when it is excluded.Link zu diesem Eintragfunc pos_at(d: float, include_hidden: bool = true) -> Vector2- Parameter
d: floatinclude_hidden: bool = true
- Rückgabewert
Vector2
scripts/sim/vehicle.gd:642Vehicle.body_pointsfuncPoints everystepalong the train from the nose to the tail (both included), leaving out the part still inside a depot shed.Link zu diesem Eintragfunc body_points(step: float) -> PackedVector2ArrayFor crash checks (see Sim._check_crashes).
- Parameter
step: float
- Rückgabewert
PackedVector2Array
scripts/sim/vehicle.gd:651Vehicle.headingfuncDirection of travel in the current tile (0..3).Link zu diesem Eintragfunc heading() -> int- Rückgabewert
int
- Ruft auf
Const.opp
scripts/sim/vehicle.gd:663Vehicle.head_tilefuncLink zu diesem Eintragfunc head_tile() -> Vector2i- Rückgabewert
Vector2i
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:674Vehicle.spawnfuncPlace the vehicle stopped at the centre of station tiletile, facing directionfacing.Link zu diesem Eintragfunc spawn(tile: Vector2i, facing: int, m: WorldMap = null, hide_behind: bool = false) -> voidA train's wagons are laid back along the actual track where there is some.
- Parameter
tile: Vector2ifacing: intm: WorldMap = nullhide_behind: bool = false
- Rückgabewert
void
- Ruft auf
Const.opp
scripts/sim/vehicle.gd:684Vehicle.updatefuncLink zu diesem Eintragfunc update(sim: Sim, dt: float) -> void- Parameter
sim: Simdt: float
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:724Vehicle._remainingfuncLink zu diesem Eintragfunc _remaining() -> float- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:763Vehicle._on_coursefuncWhether the ship is following a course worked out for its route (not one from an older save).Link zu diesem Eintragfunc _on_course() -> bool- Rückgabewert
bool
scripts/sim/vehicle.gd:780Vehicle._movefuncLink zu diesem Eintragfunc _move(sim: Sim, dt: float) -> void- Parameter
sim: Simdt: float
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:784Vehicle._trimfuncDrop the history further back than the tail needs (the walk of _pos_back, stopping as soon as it is clear nothing can go).Vehicle._advancefuncStep the head into the next tile of the route.Link zu diesem Eintragfunc _advance(sim: Sim) -> boolReturns false if movement must stop.
- Parameter
sim: Sim
- Rückgabewert
bool
- Ruft auf
BuildOps.dir_between,L.t,Const.opp
scripts/sim/vehicle.gd:852Vehicle._gatefuncRealistic blocking: whether the train must stop before it enters route[k], coming from route[k - 1]: 1 where a signal there faces it, 2 where route[k] is the first tile of a junction (RAIL-80: a junction is guarded as if signals stood round it), else 0.Link zu diesem Eintragfunc _gate(m: WorldMap, k: int) -> int- Parameter
m: WorldMapk: int
- Rückgabewert
int
- Ruft auf
BuildOps.dir_between
scripts/sim/vehicle.gd:908Vehicle.way_aheadfuncThe blocks the train must have to itself before it may pass the gate in front of route[k] (see _gate): past a signal, the track beyond it; at a junction, the junction itself and the stretch it leaves it by.Link zu diesem Eintragfunc way_ahead(m: WorldMap, blocks: Dictionary, k: int, gate: int) -> ArrayA train never stops on a junction: where the stretch past a junction is too short to hold the whole train before the next signal or junction, the way goes on past that one too, to the first place the train can wait clear of every junction. So a train is never let onto a junction it would then have to block while it waits for the track beyond.
- Parameter
m: WorldMapblocks: Dictionaryk: intgate: int
- Rückgabewert
Array
- Ruft auf
BuildOps.dir_between
scripts/sim/vehicle.gd:927Vehicle._dir_infuncThe way the head entered the tile it is in, or -1.Link zu diesem Eintragfunc _dir_in() -> int- Rückgabewert
int
- Ruft auf
Const.opp
scripts/sim/vehicle.gd:973Vehicle.claims_aheadfuncThe blocks ahead the train has been let into but not reached yet, for Sim._update_occupancy: standing on a signal, the way past it; inside a junction, the stretch it leaves it by.Link zu diesem Eintragfunc claims_ahead(m: WorldMap, blocks: Dictionary) -> Array- Parameter
m: WorldMapblocks: Dictionary
- Rückgabewert
Array
- Ruft auf
BuildOps.dir_between
scripts/sim/vehicle.gd:981Vehicle._held_upfuncWhether another train holds any of the way past the gate in front of route[k] (see _gate).Link zu diesem Eintragfunc _held_up(sim: Sim, k: int, gate: int) -> boolWhen it doesn't, the way is claimed at once, so a second train at the same junction waits. Held at a junction, the train looks for another way round once a day: the other side of a passing loop. After waiting GIVE_UP_DAYS (a deadlock) it turns round if it can (see _deadlocked).
- Parameter
sim: Simk: intgate: int
- Rückgabewert
bool
scripts/sim/vehicle.gd:998Vehicle._deadlockedfuncA train that has waited GIVE_UP_DAYS for the way ahead.Link zu diesem Eintragfunc _deadlocked(sim: Sim, need: Array) -> boolIt turns round and finds another way if there is one; only when there is none does it go on anyway. Of the trains that hold each other up, one acts at a time: they never all drive off at once into each other. Returns whether it still waits (or has just turned round: see _turned).
- Parameter
sim: Simneed: Array
- Rückgabewert
bool
scripts/sim/vehicle.gd:1022Vehicle._busyfuncLink zu diesem Eintragfunc _busy(sim: Sim, need: Array) -> bool- Parameter
sim: Simneed: Array
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1051Vehicle._detourfuncAnother way to where the route goes that keeps off the blocks other trains hold, from the tile the head is in through the same next tile (the junction ahead): the free side of a passing loop.Link zu diesem Eintragfunc _detour(sim: Sim, blocks: Dictionary, need: Array) -> boolTaken only when it isn't much longer. Returns whether the route changed.
- Parameter
sim: Simblocks: Dictionaryneed: Array
- Rückgabewert
bool
- Ruft auf
Pathfinder.find
scripts/sim/vehicle.gd:1062Vehicle._red_signal_distfuncDistance to a red signal or a busy junction (or a wreck on the line) ahead within the next couple of tiles, or -1.Link zu diesem Eintragfunc _red_signal_dist(sim: Sim) -> float- Parameter
sim: Sim
- Rückgabewert
float
scripts/sim/vehicle.gd:1087Vehicle._traffic_gapfuncRoad traffic (RAIL-26): how far the front may go before it comes ROAD_GAP short of the back of the vehicle ahead in its lane, or -1 when nothing is in the way.Link zu diesem Eintragfunc _traffic_gap(sim: Sim) -> floatOnly the vehicles whose front is in its own tile or the next three on its route are looked at (Sim.road_at); one is in its lane when it heads the way this one will cross that tile, so traffic the other way and across a junction passes. Held up for ROAD_GIVE_UP days on end, it drives through until the way is clear, so a jam always clears.
- Parameter
sim: Sim
- Rückgabewert
float
- Ruft auf
L.t
scripts/sim/vehicle.gd:1109Vehicle._berth_distfuncShips (RAIL-26): each water tile in front of a dock is a berth for one ship.Link zu diesem Eintragfunc _berth_dist(sim: Sim) -> floatWhile another ship lies at the berth this one is heading for, it stops short of it: returns how far it may still go, or -1 when it may go in. After QUEUE_GIVE_UP days waiting it goes in anyway.
- Parameter
sim: Sim
- Rückgabewert
float
- Ruft auf
L.t
scripts/sim/vehicle.gd:1180Vehicle._end_queuefuncOut of a queue: the wait is over, and the status says where it is going again.Link zu diesem Eintragfunc _end_queue() -> void- Rückgabewert
void
scripts/sim/vehicle.gd:1198Vehicle._heading_statusfuncLink zu diesem Eintragfunc _heading_status() -> String- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1204Vehicle._free_stopsfuncThe stop tiles no other vehicle of its kind stands at or is on its way to (all of them when every one is): buses and trucks spread over a stop's tiles and ships over a dock's berths, as trains pick a free platform (RAIL-26).Link zu diesem Eintragfunc _free_stops(sim: Sim, tiles: Dictionary) -> Dictionary- Parameter
sim: Simtiles: Dictionary
- Rückgabewert
Dictionary
scripts/sim/vehicle.gd:1215Vehicle._usablefuncA stop the vehicle can actually use: still exists and has tiles of this vehicle's kind.Link zu diesem Eintragfunc _usable(sim: Sim, st: Station) -> bool- Parameter
sim: Simst: Station
- Rückgabewert
bool
scripts/sim/vehicle.gd:1226Vehicle._skip_to_usablefuncMoveorder_idxforward (starting at the current order) to the first usable stop.Link zu diesem Eintragfunc _skip_to_usable(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/vehicle.gd:1231Vehicle._go_lostfuncNo route right now: wait and retry, backing off, and after a few failures try the next stop.Link zu diesem Eintragfunc _go_lost(target: Station, ctx: Dictionary) -> void- Parameter
target: Stationctx: Dictionary
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/vehicle.gd:1240Vehicle._reroutefuncThe way ahead disappeared: find a new route from tiletile, where the head sits on edgeside.Link zu diesem Eintragfunc _reroute(sim: Sim, tile: Vector2i, side: int) -> bool- Parameter
sim: Simtile: Vector2iside: int
- Rückgabewert
bool
- Ruft auf
Pathfinder.find,Const.opp,L.t
scripts/sim/vehicle.gd:1252Vehicle._extend_platformfuncLink zu diesem Eintragfunc _extend_platform(sim: Sim, tiles: Array[Vector2i]) -> Array[Vector2i]- Parameter
sim: Simtiles: Array[Vector2i]
- Rückgabewert
Array[Vector2i]
- Ruft auf
BuildOps.dir_between
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1273Vehicle._arrivefuncLink zu diesem Eintragfunc _arrive(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
L.t,Economy.unload
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1296Vehicle._loadfuncLink zu diesem Eintragfunc _load(sim: Sim, st: Station) -> int- Parameter
sim: Simst: Station
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1337Vehicle._load_transfersfuncLink zu diesem Eintragfunc _load_transfers(source: Station, pickup: Station, c: String, room: int) -> int- Parameter
source: Stationpickup: Stationc: Stringroom: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1371Vehicle._note_pickupfuncLink zu diesem Eintragfunc _note_pickup(st: Station, c: String, day: float) -> void- Parameter
st: Stationc: Stringday: float
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1384Vehicle._nearby_transfer_sourcesfuncA feeder can't take transfers from its own drop-off orders, even from a nearby pickup stop.Link zu diesem Eintragfunc _nearby_transfer_sources(sim: Sim, st: Station) -> Array[Station]- Parameter
sim: Simst: Station
- Rückgabewert
Array[Station]
scripts/sim/vehicle.gd:1392Vehicle.order_flagfuncWhether the order this vehicle is carrying out atsthas flagkey(see ORDER_FLAGS).Link zu diesem Eintragfunc order_flag(st: Station, key: String) -> bool- Parameter
st: Stationkey: String
- Rückgabewert
bool
scripts/sim/vehicle.gd:1403Vehicle.transfers_atfuncWhether this vehicle's orders say to leave cargostdoesn't accept there, for another vehicle (see Economy.unload): a transfer stop (RAIL-20) or an unload-only one (RAIL-36).Link zu diesem Eintragfunc transfers_at(st: Station) -> bool- Parameter
st: Station
- Rückgabewert
bool
scripts/sim/vehicle.gd:1412Vehicle.loads_atfuncWhether this vehicle may take cargo on atst: not at an unload-only or don't-load stop.Link zu diesem Eintragfunc loads_at(st: Station) -> bool- Parameter
st: Station
- Rückgabewert
bool
scripts/sim/vehicle.gd:1417Vehicle.dropsstatic funcWhether orderoleaves the cargo its stop doesn't accept there: transfer and unload-only stops.Link zu diesem Eintragstatic func drops(o: Dictionary) -> bool- Parameter
o: Dictionary
- Rückgabewert
bool
scripts/sim/vehicle.gd:1422Vehicle.transfer_stopsstatic funcThe stations inorderswhere cargo is left for another vehicle (see drops).Link zu diesem Eintragstatic func transfer_stops(p_orders: Array) -> Array- Parameter
p_orders: Array
- Rückgabewert
Array
scripts/sim/vehicle.gd:1427Vehicle.strandedstatic funcCargo that would be left on board for good: for each ofcargosthat a vehicle calling atstopscould never deliver, [cargo, Station it is picked up at (null when no stop accepts it at all)].Link zu diesem Eintragstatic func stranded(cargos: Array, stops: Array, transfers: Array = []) -> ArrayA stop never takes back what was loaded there (see Economy.unload), so cargo a stop supplies needs another stop that accepts it. A stop in
transferstakes any cargo (to pass it on).- Parameter
cargos: Arraystops: Arraytransfers: Array = []
- Rückgabewert
Array
scripts/sim/vehicle.gd:1439Vehicle._check_stuckfuncCalled on arriving atst, after unloading: note cargo still on board that no stop in the orders accepts.Link zu diesem Eintragfunc _check_stuck(sim: Sim, st: Station) -> voidIt stays there unpaid, filling the vehicle, until the orders change; the player is told (the vehicle window, the "needs attention" lists and, at most once a year, the news).
- Parameter
sim: Simst: Station
- Rückgabewert
void
scripts/sim/vehicle.gd:1459Vehicle.clear_stuckfuncForget the undeliverable cargo (it was delivered, or the orders or the cargo changed).Link zu diesem Eintragfunc clear_stuck() -> void- Rückgabewert
void
scripts/sim/vehicle.gd:1494Vehicle.problemfuncWhat is wrong with the vehicle's route, for the player ("" when nothing is).Link zu diesem Eintragfunc problem() -> String- Rückgabewert
String
scripts/sim/vehicle.gd:1500Vehicle._wants_morefuncWhether a full-load order should keep waiting: some wagon still has room for a cargo this station supplies, or that another of the company's vehicles brings here to transfer (a feeder's drop-off point that produces nothing itself); a mixed train doesn't wait for cargo that never comes here.Link zu diesem Eintragfunc _wants_more(sim: Sim, st: Station) -> boolNever at a stop where it takes nothing on.
- Parameter
sim: Simst: Station
- Rückgabewert
bool
scripts/sim/vehicle.gd:1511Vehicle._fed_herefuncWhether another vehicle of the same company can leave cargochere or at a nearby station.Link zu diesem Eintragfunc _fed_here(sim: Sim, st: Station, nearby: Array[Station], c: String) -> bool- Parameter
sim: Simst: Stationnearby: Array[Station]c: String
- Rückgabewert
bool
scripts/sim/vehicle.gd:1531Vehicle._pickup_fillfuncHow full (0..1) the vehicle leavesst, counting only the cargos it can pick up here: ones the station supplies, or ones it actually took on (a transfer).Link zu diesem Eintragfunc _pickup_fill(st: Station) -> float-1 at a pure drop-off, so leaving the far end of a one-way freight run empty doesn't halve the average load.
- Parameter
st: Station
- Rückgabewert
float
scripts/sim/vehicle.gd:1546Vehicle._update_loadingfuncLink zu diesem Eintragfunc _update_loading(sim: Sim, dt: float) -> void- Parameter
sim: Simdt: float
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1562Vehicle._spacing_waitfuncDays still to wait at the line's first stop to keep an even gap behind the vehicle that left before (0: go now).Link zu diesem Eintragfunc _spacing_wait(sim: Sim) -> floatNever longer than one gap all told, so a slow round can't hold a line up.
- Parameter
sim: Sim
- Rückgabewert
float
scripts/sim/vehicle.gd:1611Vehicle.dailyfuncOnce a day: wear, and perhaps a breakdown.Link zu diesem Eintragfunc daily(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/vehicle.gd:1629Vehicle.service_duefuncLink zu diesem Eintragfunc service_due(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1638Vehicle._break_downfuncLink zu diesem Eintragfunc _break_down(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1642Vehicle._servicedfuncLink zu diesem Eintragfunc _serviced(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
Data.reliability
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1652Vehicle._try_servicefuncHead for the nearest depot if one is close (any_distance: however far).Link zu diesem Eintragfunc _try_service(sim: Sim, any_distance := false) -> boolShips, aircraft and rivals' fleets are looked after at their stations instead. Returns true if the vehicle is now on its way to a depot.
- Parameter
sim: Simany_distance := false
- Rückgabewert
bool
- Ruft auf
Pathfinder.find
scripts/sim/vehicle.gd:1660Vehicle._try_refitfuncA change of cargo is waiting (see Sim.refit_vehicle): head for the nearest depot, however far, where it is done.Link zu diesem Eintragfunc _try_refit(sim: Sim) -> boolShips, aircraft and rivals have it done where they stand, and so does a company playing without depots when none can be reached. Returns true if now on its way to a depot.
- Parameter
sim: Sim
- Rückgabewert
bool
- Ruft auf
Pathfinder.find
scripts/sim/vehicle.gd:1679Vehicle._depot_statusfuncLink zu diesem Eintragfunc _depot_status() -> String- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1694Vehicle._go_to_depotfuncLeave for the depot at the end ofres(a Pathfinder route from the head's tile).Link zu diesem Eintragfunc _go_to_depot(sim: Sim, res: Dictionary, goals: Dictionary) -> void- Parameter
sim: Simres: Dictionarygoals: Dictionary
- Rückgabewert
void
- Ruft auf
BuildOps.dir_between,Const.opp
scripts/sim/vehicle.gd:1699Vehicle._stop_no_ordersfuncHalt because no stop can be used.Link zu diesem Eintragfunc _stop_no_orders(ctx: Dictionary = {}) -> voidctxremembers where the head is if it stopped mid-route, so starting again resumes from there instead of jumping to the tile centre.- Parameter
ctx: Dictionary = {}
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/vehicle.gd:1720Vehicle.resumefuncRestart a stopped vehicle (from the vehicle window).Link zu diesem Eintragfunc resume() -> void- Rückgabewert
void
scripts/sim/vehicle.gd:1728Vehicle._route_to_orderfuncLeave the current tile for the current order's station.Link zu diesem Eintragfunc _route_to_order(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
L.t,BuildOps.dir_between,Const.opp
scripts/sim/vehicle.gd:1736Vehicle._findfuncPathfinder.find for this vehicle, remembering the answer underslot(-1: don't).Link zu diesem Eintragfunc _find(sim: Sim, slot: int, start: Vector2i, h: int, goals: Dictionary, reverse_start: bool, uturn: bool) -> DictionaryThe search depends only on the network, where it starts, the heading and the goal tiles, so the route found last time is still the one it would find as long as those are the same and the network hasn't changed anywhere the search looked (WorldMap.net_changed_in). Every departure asks again, and a remembered route is walked once more before it is used: never a route over track that has gone.
- Parameter
sim: Simslot: intstart: Vector2ih: intgoals: Dictionaryreverse_start: booluturn: bool
- Rückgabewert
Dictionary
- Ruft auf
Pathfinder.find
scripts/sim/vehicle.gd:1781Vehicle._route_standsfuncWhether every step oftilescan still be driven (the checks _advance makes on the way).Link zu diesem Eintragfunc _route_stands(m: WorldMap, tiles: Array[Vector2i]) -> bool- Parameter
m: WorldMaptiles: Array[Vector2i]
- Rückgabewert
bool
scripts/sim/vehicle.gd:1801Vehicle._free_platformsfuncThe platforms of a station no other train is standing at (all of them if every one is taken).Link zu diesem Eintragfunc _free_platforms(sim: Sim, tiles: Dictionary) -> DictionaryA platform is a straight row of station tiles.
- Parameter
sim: Simtiles: Dictionary
- Rückgabewert
Dictionary
scripts/sim/vehicle.gd:1831Vehicle._platform_rowstatic funcLink zu diesem Eintragstatic func _platform_row(m: WorldMap, t: Vector2i) -> Vector2i- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
Vector2i
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:1859Vehicle._turnfuncTurn the train round where it stands (RAIL-80) and route it on, keeping off the blocks inavoid.Link zu diesem Eintragfunc _turn(sim: Sim, avoid: Dictionary = {}, skip_depot: bool = false) -> boolIt heads for the depot it is on its way to, or else its next stop, or else another of its stops (taking that order up from there), or else any of the company's depots. With
skip_depot(the player's Turn around) a trip to a depot for a service is dropped first. Returns whether it turned.- Parameter
sim: Simavoid: Dictionary = {}skip_depot: bool = false
- Rückgabewert
bool
- Ruft auf
L.t
scripts/sim/vehicle.gd:1870Vehicle.turn_aroundfuncThe player's Turn around (vehicle window): reverse a train out on the line and send it on to its next stop, the way it came if need be.Link zu diesem Eintragfunc turn_around(sim: Sim) -> StringA trip to a depot for a service is dropped. Returns "" or why it can't.
- Parameter
sim: Sim
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/vehicle.gd:1910Vehicle._flipfuncReverse a train in place: the last wagon becomes the front, then route onward from there, keeping off the blocks inavoid(see _turn).Link zu diesem Eintragfunc _flip(sim: Sim, goals: Dictionary, slot: int = -1, avoid: Dictionary = {}) -> bool- Parameter
sim: Simgoals: Dictionaryslot: int = -1avoid: Dictionary = {}
- Rückgabewert
bool
- Ruft auf
Pathfinder.find
scripts/sim/vehicle.gd:1924Vehicle.car_posesfuncWorld transforms of each car: [{"pos": Vector3, "dir": Vector3}] front to back.Link zu diesem Eintragfunc car_poses(m: WorldMap) -> Array- Parameter
m: WorldMap
- Rückgabewert
Array
scripts/sim/vehicle.gd:1959Vehicle.place_at_airportfuncPark at an airport (start of service).Link zu diesem Eintragfunc place_at_airport(st: Station, m: WorldMap) -> void- Parameter
st: Stationm: WorldMap
- Rückgabewert
void
scripts/sim/vehicle.gd:1999Vehicle.head_tile_airfuncLink zu diesem Eintragfunc head_tile_air() -> Vector2i- Rückgabewert
Vector2i
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:2007Vehicle._air_lenfuncLink zu diesem Eintragfunc _air_len() -> float- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:2012Vehicle._air_xyfuncLink zu diesem Eintragfunc _air_xy() -> Vector2- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:2016Vehicle._hold_entryfuncWhere the plane broke off its approach: HOLD_AT short of the airport.Link zu diesem Eintragfunc _hold_entry() -> Vector2- Rückgabewert
Vector2
scripts/sim/vehicle.gd:2029Vehicle._hold_centrefuncLink zu diesem Eintragfunc _hold_centre() -> Vector2- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:2033Vehicle._hold_rfuncThe circle's radius: one of three sizes (by the plane's number), so planes that arrive together hold apart.Link zu diesem Eintragfunc _hold_r() -> float- Rückgabewert
float
scripts/sim/vehicle.gd:2040Vehicle._hold_startfuncThe angle round the circle of the point where the plane broke off.Link zu diesem Eintragfunc _hold_start() -> float- Rückgabewert
float
scripts/sim/vehicle.gd:2045Vehicle._take_offfuncStart a flight totarget's airport.Link zu diesem Eintragfunc _take_off(sim: Sim, target: Station) -> void- Parameter
sim: Simtarget: Station
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/vehicle.gd:2051Vehicle._move_airfuncLink zu diesem Eintragfunc _move_air(sim: Sim, dt: float) -> void- Parameter
sim: Simdt: float
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:2082Vehicle._holdfuncOnce round the holding circle, the plane is back where it broke off its approach: it carries on with it if a stand has come free (or it has held for QUEUE_GIVE_UP days), else it goes round again.Link zu diesem Eintragfunc _hold(sim: Sim, st: Station, vmax: float, dt: float) -> void- Parameter
sim: Simst: Stationvmax: floatdt: float
- Rückgabewert
void
scripts/sim/vehicle.gd:2120Vehicle._air_altfuncAltitude profile: taxi, climb out, cruise, descend and land.Link zu diesem Eintragfunc _air_alt() -> float- Rückgabewert
float
scripts/sim/vehicle.gd:2134Vehicle._air_posefuncLink zu diesem Eintragfunc _air_pose(m: WorldMap) -> Dictionary- Parameter
m: WorldMap
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/vehicle.gd:2143
WorldMap
WorldMap.TerrainenumLink zu diesem Eintragenum Terrain { GRASS, SAND, ROCK, SNOW, WATER }Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:6WorldMap.changedsignalEmitted after construction changes a rectangle of tiles.Link zu diesem Eintragsignal changed(rect: Rect2i, what: int)whatis a mask of CH_* flags.- Parameter
rect: Rect2iwhat: int
- Rückgabewert
signal changed(rect: Rect2i, what: int)
scripts/sim/world_map.gd:9WorldMap.CH_TERRAINconstLink zu diesem Eintragconst CH_TERRAIN := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:10WorldMap.CH_NETWORKconstLink zu diesem Eintragconst CH_NETWORK := 2Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:11WorldMap.CH_OBJECTSconstLink zu diesem Eintragconst CH_OBJECTS := 4Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:12WorldMap.CH_TREESconstLink zu diesem Eintragconst CH_TREES := 8Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:13WorldMap.CH_ALLconstLink zu diesem Eintragconst CH_ALL := 15Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:14WorldMap.wvarLink zu diesem Eintragvar w: intFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:16WorldMap.hvarLink zu diesem Eintragvar h: intFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:17WorldMap.heightsvar(w+1)*(h+1) corner heights, 0..MAX_HEIGHT; 0 = sea floorWorldMap.corner_yvarrendered corner heights in world units (seabed depth applied)WorldMap.terrainvarLink zu diesem Eintragvar terrain := PackedByteArray()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:20WorldMap.treesvarLink zu diesem Eintragvar trees := PackedByteArray()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:21WorldMap.variantvarLink zu diesem Eintragvar variant := PackedByteArray()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:22WorldMap.roadvarconnection bitmask N=1 E=2 S=4 W=8WorldMap.railvarLink zu diesem Eintragvar rail := PackedByteArray()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:24WorldMap.rail_ownervarcompany id + 1 for track; 0 = noneWorldMap.objsvarnull or a Dictionary with "kind": "house" | "industry" | "station"WorldMap.townsvarTown objects generated for this world.Link zu diesem Eintragvar towns: Array[Town] = []A town object gives access to its population, position, and council ratings.
Deklariert inscripts/sim/world_map.gd:27WorldMap.industriesvarIndustries currently on the map.Link zu diesem Eintragvar industries: Array[Industry] = []This collection can change as industries open, close, or progress through the eras.
Deklariert inscripts/sim/world_map.gd:28WorldMap.industry_revvarBumped whenever an industry opens or closes during the game (RAIL-23, IndustryLife): what is made from the list of industries (their models, smoke, lights and labels, and the caches below and in Economy) is made again.WorldMap.eravarThe era (an index into Data.ERAS) whose industry chains apply (RAIL-29): what industries take and make, and what towns make and take.Link zu diesem Eintragvar era := 0Follows the date (Sim.sync_era); not saved.
Deklariert inscripts/sim/world_map.gd:35WorldMap._near_indvar1 on tiles within BuildOps.INDUSTRY_GAP of an industry, rebuilt whenever an industry has come or gone since it was made (or the list has grown: the world is made, or loaded, by appending to it).WorldMap._near_ind_nvarLink zu diesem Eintragvar _near_ind_n := -1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:39WorldMap._near_ind_revvarLink zu diesem Eintragvar _near_ind_rev := -1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:40WorldMap.stationsvarStation objects in the current world.Link zu diesem Eintragvar stations: Array[Station] = []A station can serve more than one transport mode, so use
Deklariert inhas_kindto select the desired type.scripts/sim/world_map.gd:41WorldMap.next_station_idvarLink zu diesem Eintragvar next_station_id := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:42WorldMap.crossingsvarBridges and tunnels: {"id", "kind" rail|road, "type" bridge|tunnel, "s0", "s1" (first and last span tile), "dir" (s0 -> s1), "level" (height level of the deck / tunnel floor), "owner" (company id + 1)}.Link zu diesem Eintragvar crossings: Array = []For bridges the spans are the tiles strictly between the two ramps; for tunnels they include both portals.
Deklariert inscripts/sim/world_map.gd:46WorldMap.spansvarVector2i -> crossingWorldMap.depotsvarVector2i -> depot object (also in objs)WorldMap.elecvar1 where the track has overhead wiresWorldMap.next_crossing_idvarLink zu diesem Eintragvar next_crossing_id := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:50WorldMap.signalsvarRail signals on straight track: Vector2i -> 0 (two-way) or 1 + d (one-way, trains may only pass heading d).WorldMap.diag2varTiles carrying two parallel diagonal pieces instead of a junction, per network: Vector2i -> 0 (pieces N-E and S-W) or 1 (pieces E-S and W-N).Link zu diesem Eintragvar diag2 := {"rail": {}, "road": {}}Deklariert inscripts/sim/world_map.gd:55WorldMap.DIAG2_PAIRSconstLink zu diesem Eintragconst DIAG2_PAIRS := [[[0, 1], [2, 3]], [[1, 2], [3, 0]]]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:56WorldMap.EASEconsthow far off the edge midpoint an eased join crosses (see piece_shape)WorldMap.net_versionvarbumped whenever the network or the objects change (the view redraws on it)WorldMap.block_cachevarLink zu diesem Eintragvar block_cache := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:59WorldMap.block_versionvarthe rail revisionblock_cachewas built for (see net_rev)WorldMap.NET_LOG_MAXconstRevisions of the road and the rail network: they go up only when the network itself really changed (track, wires, signals, bridges, tunnels), not when a town merely adds a house.Link zu diesem Eintragconst NET_LOG_MAX := 512Each keeps the rectangles that changed lately, so a cached route can tell whether a change touched the part of the map it was searched over (see net_changed_in). None of this is saved.
Deklariert inscripts/sim/world_map.gd:65WorldMap.road_revvarLink zu diesem Eintragvar road_rev := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:66WorldMap.rail_revvarLink zu diesem Eintragvar rail_rev := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:67WorldMap._road_logvarLink zu diesem Eintragvar _road_log: Array[Rect2i] = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:68WorldMap._rail_logvarLink zu diesem Eintragvar _rail_log: Array[Rect2i] = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:69WorldMap._net_syncedvarLink zu diesem Eintragvar _net_synced := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:70WorldMap._sh_roadvarthe network as it was at the last notify, to spot real changesWorldMap._sh_railvarLink zu diesem Eintragvar _sh_rail := PackedByteArray()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:72WorldMap._sh_elecvarLink zu diesem Eintragvar _sh_elec := PackedByteArray()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:73WorldMap._sh_statevarLink zu diesem Eintragvar _sh_state := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:74WorldMap.station_revvarBumped when the stations' catchments change; with the two counts it keyseco_cache(Economy's industry <-> station links).WorldMap.eco_cachevarLink zu diesem Eintragvar eco_cache := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:78WorldMap._town_cargo_levelsvarLink zu diesem Eintragvar _town_cargo_levels: Array[int] = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:79WorldMap._shape_memovarpiece_shape results by tile (see shape_of): tile index -> {sides and network -> shape}.Link zu diesem Eintragvar _shape_memo := {}Emptied around every change that is announced with
Deklariert innotify. Not saved.scripts/sim/world_map.gd:82WorldMap.sea_memovarRoutes over water found by Pathfinder, by question (see Pathfinder._sea_memo).Link zu diesem Eintragvar sea_memo := {}Emptied whenever the ground changes. Not saved.
Deklariert inscripts/sim/world_map.gd:85WorldMap._initfuncLink zu diesem Eintragfunc _init(width: int = Const.MAP_SIZE, height: int = Const.MAP_SIZE) -> void- Parameter
width: int = Const.MAP_SIZEheight: int = Const.MAP_SIZE
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:88WorldMap.set_erafuncMove the chains to erae: every industry takes and makes what its kind does then.Link zu diesem Eintragfunc set_era(e: int) -> voidStations take it on when they are next refreshed.
- Parameter
e: int
- Rückgabewert
void
scripts/sim/world_map.gd:106WorldMap.is_electrifiedfuncOverhead wires over this tile's track (bridge decks and tunnels count as wired).Link zu diesem Eintragfunc is_electrified(t: Vector2i) -> bool- Parameter
t: Vector2i
- Rückgabewert
bool
scripts/sim/world_map.gd:114WorldMap.notifyfuncLink zu diesem Eintragfunc notify(rect: Rect2i, what: int) -> void- Parameter
rect: Rect2iwhat: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:121WorldMap._town_cargo_levels_changedfuncA population threshold changes acceptance at any stop serving that town, even far from the build.Link zu diesem Eintragfunc _town_cargo_levels_changed() -> bool- Rückgabewert
bool
- Ruft auf
Data.town_takes_by_size
scripts/sim/world_map.gd:150WorldMap.net_revfuncThe revision of the road or rail network (-1 for anything else, which has none).Link zu diesem Eintragfunc net_rev(kind: String) -> intWhatever caches something derived from the network keeps this number with it.
- Parameter
kind: String
- Rückgabewert
int
scripts/sim/world_map.gd:169WorldMap.net_changed_infuncWhether thekindnetwork changed insideboxsince revisionsince(true when it can't tell).Link zu diesem Eintragfunc net_changed_in(kind: String, since: int, box: Rect2i) -> bool- Parameter
kind: Stringsince: intbox: Rect2i
- Rückgabewert
bool
scripts/sim/world_map.gd:178WorldMap.net_touchfuncRecord that thekindnetwork changed insiderect.Link zu diesem Eintragfunc net_touch(kind: String, rect: Rect2i) -> voidnotifydoes this by itself for anything it can see (track, wires, signals, bridges and tunnels), so this is only for changes it can't.- Parameter
kind: Stringrect: Rect2i
- Rückgabewert
void
scripts/sim/world_map.gd:194WorldMap.net_resetfuncForget everything cached about the network and the stations (after loading, or after editing the map's arrays directly withoutnotify).Link zu diesem Eintragfunc net_reset() -> void- Rückgabewert
void
scripts/sim/world_map.gd:209WorldMap._net_statefuncLink zu diesem Eintragfunc _net_state() -> int- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:223WorldMap._net_syncfuncLink zu diesem Eintragfunc _net_sync() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:227WorldMap._net_scanfuncAfter a change insiderect: compare the network there with how it was, and record what changed.Link zu diesem Eintragfunc _net_scan(rect: Rect2i) -> void- Parameter
rect: Rect2i
- Rückgabewert
void
scripts/sim/world_map.gd:236WorldMap.sig_allowsfuncWhether a train headinghmay pass the signal on tilet(one-way signals only allow one way).Link zu diesem Eintragfunc sig_allows(t: Vector2i, h: int) -> bool- Parameter
t: Vector2ih: int
- Rückgabewert
bool
scripts/sim/world_map.gd:272WorldMap.sig_facesfuncWhether the signal ontcontrols trains headingh(it faces them).Link zu diesem Eintragfunc sig_faces(t: Vector2i, h: int) -> bool- Parameter
t: Vector2ih: int
- Rückgabewert
bool
scripts/sim/world_map.gd:278WorldMap.block_keyfuncKey for the track a train travelling in directiondoccupies on tilet: the tile itself on the ground, or a separate key on a bridge or in a tunnel (so the line overhead and the line underneath are different blocks).Link zu diesem Eintragfunc block_key(t: Vector2i, d: int) -> Variant- Parameter
t: Vector2id: int
- Rückgabewert
Variant
- Ruft auf
Const.opp
scripts/sim/world_map.gd:288WorldMap.rail_junctionfuncWhether tiletis a junction on the ground, where three or four lines of track meet (RAIL-80).Link zu diesem Eintragfunc rail_junction(t: Vector2i, d: int = -1) -> boolA junction is a block of its own even without signals (see blocks), and trains wait in front of it until it and the track beyond it are clear (Vehicle._way_ahead). With
d, a train travelling that way on a bridge or in a tunnel over the tile isn't on the junction.- Parameter
t: Vector2id: int = -1
- Rückgabewert
bool
scripts/sim/world_map.gd:302WorldMap.block_key_atfuncBlock key from a position (on a tile with two parallel diagonals, the half you're in decides).Link zu diesem Eintragfunc block_key_at(p: Vector2, d: int) -> Variant- Parameter
p: Vector2d: int
- Rückgabewert
Variant
scripts/sim/world_map.gd:312WorldMap.blocksfuncTrack blocks: rail tiles grouped into connected stretches, split at signal tiles and where track meets a junction: a junction, or a few junctions side by side, is a block of its own (RAIL-80).Link zu diesem Eintragfunc blocks() -> DictionaryKeyed by block_key().
- Rückgabewert
Dictionary
- Ruft auf
WorldMap.axis_of
scripts/sim/world_map.gd:325WorldMap.cifuncLink zu diesem Eintragfunc ci(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:384WorldMap.tifuncLink zu diesem Eintragfunc ti(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:388WorldMap.in_boundsfuncLink zu diesem Eintragfunc in_bounds(x: int, y: int) -> bool- Parameter
x: inty: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:392WorldMap.near_industryfuncWhether (x, y) lies within BuildOps.INDUSTRY_GAP tiles of an industry's footprint, diagonals included.Link zu diesem Eintragfunc near_industry(x: int, y: int) -> bool- Parameter
x: inty: int
- Rückgabewert
bool
scripts/sim/world_map.gd:397WorldMap.net_bitsfuncLink zu diesem Eintragfunc net_bits(kind: String, i: int) -> int- Parameter
kind: Stringi: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:411WorldMap.sailablefuncOpen water ships can sail through (not under an oil rig or other industry).Link zu diesem Eintragfunc sailable(i: int) -> boolThe dock out at a rig stands in open water and ships sail onto it to berth.
- Parameter
i: int
- Rückgabewert
bool
scripts/sim/world_map.gd:421WorldMap.linkedfuncTrue when tiletconnects to its neighbour in directiondon the given network (both tiles carry the matching bit), including along bridges and through tunnels.Link zu diesem Eintragfunc linked(kind: String, t: Vector2i, d: int) -> bool- Parameter
kind: Stringt: Vector2id: int
- Rückgabewert
bool
- Ruft auf
Const.opp
scripts/sim/world_map.gd:428WorldMap.piecesfuncThe pieces of track or road on a tile, as [edge, edge] pairs ([edge, -1] for a dead end).Link zu diesem Eintragfunc pieces(kind: String, t: Vector2i) -> Array- Parameter
kind: Stringt: Vector2i
- Rückgabewert
Array
scripts/sim/world_map.gd:445WorldMap._lone_cornerfuncWhether tilethas exactly the corner piece {a, b} on its own (or as one of two parallel diagonals).Link zu diesem Eintragfunc _lone_corner(kind: String, t: Vector2i, a: int, b: int) -> bool- Parameter
kind: Stringt: Vector2ia: intb: int
- Rückgabewert
bool
scripts/sim/world_map.gd:464WorldMap.chord_endsfuncDiagonal runs: a corner piece (edgesa,b) that continues across an edge into the mirrored corner on the next tile.Link zu diesem Eintragfunc chord_ends(kind: String, t: Vector2i, a: int, b: int) -> intReturns a mask of which ends continue diagonally (1 = end a, 2 = end b), or 0 for an ordinary curve. Diagonal stretches are drawn and driven as straight 45-degree lines; an end that meets straight track eases in with a curve that leaves the edge square.
- Parameter
kind: Stringt: Vector2ia: intb: int
- Rückgabewert
int
- Ruft auf
Const.opp
scripts/sim/world_map.gd:480WorldMap.is_chordfuncLink zu diesem Eintragfunc is_chord(kind: String, t: Vector2i, a: int, b: int) -> bool- Parameter
kind: Stringt: Vector2ia: intb: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:493WorldMap._plain_straightfuncWhether tiletcarries nothing but one straight piece running through sided: plain ground track or road, with no station, level crossing, bridge or tunnel on it.Link zu diesem Eintragfunc _plain_straight(kind: String, t: Vector2i, d: int) -> bool- Parameter
kind: Stringt: Vector2id: int
- Rückgabewert
bool
- Ruft auf
Const.opp
scripts/sim/world_map.gd:499WorldMap.piece_shapefuncThe full shape of the piece from edgeato edgeb, as a mask (0 = an ordinary piece): 1, 2 end a / end b continues diagonally (see chord_ends) 4, 8 end a / end b is eased: where a diagonal run meets plain straight track, the bend is one wide curve from the middle of the straight tile to the far end of the first diagonal tile, so it crosses their shared edge EASE to one side of the midpoint 16, 32 (straight pieces) which side end a / end b is eased towards: clear = the next direction clockwise from that end, set = the one before itLink zu diesem Eintragfunc piece_shape(kind: String, t: Vector2i, a: int, b: int) -> int- Parameter
kind: Stringt: Vector2ia: intb: int
- Rückgabewert
int
- Ruft auf
Const.opp
scripts/sim/world_map.gd:515WorldMap.shape_offuncpiece_shape for road and rail, remembered: vehicles ask for the same pieces over and over as they drive.Link zu diesem Eintragfunc shape_of(kind: String, t: Vector2i, a: int, b: int) -> intThe answer only depends on the map near the tile, and
notifyforgets what it knew around every change.- Parameter
kind: Stringt: Vector2ia: intb: int
- Rückgabewert
int
scripts/sim/world_map.gd:545WorldMap.flip_shapestatic funcshapefor the same piece travelled the other way (ends a and b swapped).Link zu diesem Eintragstatic func flip_shape(shape: int) -> int- Parameter
shape: int
- Rückgabewert
int
scripts/sim/world_map.gd:565WorldMap.piece_curvestatic funcControl points (tile-local, 0..1) of a piece from edgeato edgebwith a non-zeroshape(see piece_shape): a cubic curve.Link zu diesem Eintragstatic func piece_curve(a: int, b: int, shape: int) -> ArrayDiagonal pieces are straight where both ends continue diagonally; an end that meets plain straight track is eased, sharing one wide bend with that tile; an end that meets anything else leaves the edge square, with a tighter S-bend.
- Parameter
a: intb: intshape: int
- Rückgabewert
Array
- Ruft auf
Const.opp
scripts/sim/world_map.gd:573WorldMap.chord_curvestatic funcLink zu diesem Eintragstatic func chord_curve(a: int, b: int, ends: int) -> Array- Parameter
a: intb: intends: int
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:619WorldMap.cubic_tangentstatic funcLink zu diesem Eintragstatic func cubic_tangent(c: Array, u: float) -> Vector2- Parameter
c: Arrayu: float
- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:623WorldMap.cubicstatic funcLink zu diesem Eintragstatic func cubic(c: Array, u: float) -> Vector2- Parameter
c: Arrayu: float
- Rückgabewert
Vector2
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:629WorldMap.axis_ofstatic funcLink zu diesem Eintragstatic func axis_of(d: int) -> int- Parameter
d: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:634WorldMap.span_alongfuncThe bridge or tunnel ofkindthat tiletis part of, if travel in directiondruns along it.Link zu diesem Eintragfunc span_along(kind: String, t: Vector2i, d: int) -> Variant- Parameter
kind: Stringt: Vector2id: int
- Rückgabewert
Variant
scripts/sim/world_map.gd:639WorldMap.exit_bitsfuncDirections a vehicle headinghinside tiletmay leave by: straight on along a bridge or tunnel, otherwise the ground connections.Link zu diesem Eintragfunc exit_bits(kind: String, t: Vector2i, h: int) -> int- Parameter
kind: Stringt: Vector2ih: int
- Rückgabewert
int
- Ruft auf
Const.opp
scripts/sim/world_map.gd:648WorldMap.travel_yfuncHeight vehicles travel at: the bridge deck or tunnel floor when running along one, else the ground.Link zu diesem Eintragfunc travel_y(kind: String, fx: float, fz: float, dir: Vector2) -> float- Parameter
kind: Stringfx: floatfz: floatdir: Vector2
- Rückgabewert
float
scripts/sim/world_map.gd:662WorldMap.portal_levelfuncLevel of the tunnel mouth on tile (x, y), or -1.Link zu diesem Eintragfunc portal_level(x: int, y: int) -> intMouth tiles are dug out flat to the tunnel floor.
- Parameter
x: inty: int
- Rückgabewert
int
scripts/sim/world_map.gd:675WorldMap.add_crossingfuncLink zu diesem Eintragfunc add_crossing(c: Dictionary) -> void- Parameter
c: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:682WorldMap.remove_crossingfuncLink zu diesem Eintragfunc remove_crossing(c: Dictionary) -> void- Parameter
c: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:688WorldMap.crossing_tilesstatic funcLink zu diesem Eintragstatic func crossing_tiles(c: Dictionary) -> Array[Vector2i]- Parameter
c: Dictionary
- Rückgabewert
Array[Vector2i]
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:695WorldMap.cornerfuncLink zu diesem Eintragfunc corner(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:706WorldMap.cornersfuncCorner heights in order NW (x,y), NE (x+1,y), SE (x+1,y+1), SW (x,y+1).Link zu diesem Eintragfunc corners(x: int, y: int) -> Vector4i- Parameter
x: inty: int
- Rückgabewert
Vector4i
scripts/sim/world_map.gd:711WorldMap.tile_minfuncLink zu diesem Eintragfunc tile_min(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:715WorldMap.tile_maxfuncLink zu diesem Eintragfunc tile_max(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:720WorldMap.is_waterfuncLink zu diesem Eintragfunc is_water(x: int, y: int) -> bool- Parameter
x: inty: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:725WorldMap.slopefuncBits of corners raised above the tile minimum (1=NW, 2=NE, 4=SE, 8=SW), plus 16 when steep.Link zu diesem Eintragfunc slope(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
scripts/sim/world_map.gd:730WorldMap.is_flatfuncLink zu diesem Eintragfunc is_flat(x: int, y: int) -> bool- Parameter
x: inty: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_map.gd:743WorldMap.incline_axisfuncAxis a tile is a simple incline along: 0 = along x, 1 = along y, -1 = not a simple incline.Link zu diesem Eintragfunc incline_axis(x: int, y: int) -> int- Parameter
x: inty: int
- Rückgabewert
int
scripts/sim/world_map.gd:748WorldMap.split_nw_sefuncThe mesh folds along NW-SE when those corners match, else along NE-SW.Link zu diesem Eintragfunc split_nw_se(x: int, y: int) -> bool- Parameter
x: inty: int
- Rückgabewert
bool
scripts/sim/world_map.gd:758WorldMap.terrain_yfuncExact height of the rendered terrain surface (matches the mesh triangles).Link zu diesem Eintragfunc terrain_y(fx: float, fz: float) -> float- Parameter
fx: floatfz: float
- Rückgabewert
float
scripts/sim/world_map.gd:763WorldMap.surface_yfuncVisible surface: terrain or water, whichever is higher.Link zu diesem Eintragfunc surface_y(fx: float, fz: float) -> floatOutside the map returns -INF.
- Parameter
fx: floatfz: float
- Rückgabewert
float
scripts/sim/world_map.gd:786WorldMap.compute_corner_yfuncRecompute rendered corner heights.Link zu diesem Eintragfunc compute_corner_y() -> voidSea-floor corners sink deeper the farther they are from land.
- Rückgabewert
void
scripts/sim/world_map.gd:793
Industry
Industry.SIZEconstLink zu diesem Eintragconst SIZE := 3Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:7Industry.LOCAL_REACHconstStaff (RAIL-28): people walk in from towns up to LOCAL_REACH tiles from the footprint, fewer the farther the edge of the town is; right next to it, a town lends LOCAL_PER_POP workers per resident.Link zu diesem Eintragconst LOCAL_REACH := 8.0Walkers-in fill at most LOCAL_MAX of the jobs: the rest takes commuters, however big the town.
Deklariert inscripts/sim/industry.gd:11Industry.LOCAL_PER_POPconstLink zu diesem Eintragconst LOCAL_PER_POP := 0.16Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:12Industry.LOCAL_MAXconstLink zu diesem Eintragconst LOCAL_MAX := 0.55Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:13Industry.PRIMARY_MINconstOutput with nobody at work and with a full staff (see output_factor).Industry.PRIMARY_MAXconstLink zu diesem Eintragconst PRIMARY_MAX := 1.5Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:16Industry.PLANT_MINconstLink zu diesem Eintragconst PLANT_MIN := 0.8Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:17Industry.PLANT_MAXconstLink zu diesem Eintragconst PLANT_MAX := 1.3Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:18Industry.SHIFT_BACKconstOf the commuters who come to work, the share that goes home again by the same stations.Industry.BUSYconstStaffing from which an industry counts as busy: its noise carries farther (Town.land_value).Industry.idvarLink zu diesem Eintragvar id := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:24Industry.typevarLink zu diesem Eintragvar type := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:25Industry.xvarLink zu diesem Eintragvar x := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:26Industry.yvarLink zu diesem Eintragvar y := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:27Industry.namevarLink zu diesem Eintragvar name := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:28Industry.prod_ratevarmonthly output of a primary industryIndustry.stockvarsecondary output waiting to be shippedIndustry.producedvarthis month, by cargoIndustry.transportedvarLink zu diesem Eintragvar transported := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:32Industry.receivedvarLink zu diesem Eintragvar received := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:33Industry.produced_lastvarLink zu diesem Eintragvar produced_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:34Industry.transported_lastvarLink zu diesem Eintragvar transported_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:35Industry.received_lastvarLink zu diesem Eintragvar received_last := {}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:36Industry.historyvar[produced, transported] at each month end (last 24)Industry.workersvarcommuters delivered to stations in reach this month (RAIL-28)Industry.workers_lastvarLink zu diesem Eintragvar workers_last := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:39Industry.shift_paxvarcommuters going home, handed to stations at the next production runIndustry.local_staffvarwalkers-in from nearby towns, counted once a month (-1: not yet)Industry.closing_dayvarIndustries come and go during the game (RAIL-23, IndustryLife): the game day a struggling one closes, warned a year ahead (-1: not at risk), and whether it has closed and left the map (what still holds on to it, a window or a label, lets go).Industry.closedvarLink zu diesem Eintragvar closed := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:46Industry.acceptsvarWhat it takes and makes in the map's era (Data.accepts / produces, RAIL-29): WorldMap.set_era keeps them up to date.Link zu diesem Eintragvar accepts: Array = []Shared and read-only.
Deklariert inscripts/sim/industry.gd:49Industry.producesvarLink zu diesem Eintragvar produces: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:50Industry.heldvarCargo delivered and not used yet: what a plant that needs every input holds until the rest comes, and what a wind farm site has had towards its total (Data.INDUSTRY "needs_all" and "builds").Industry.buildersvara wind farm site: company id -> units it deliveredIndustry.last_deliveryvargame day cargo was last delivered to it (-1: never)Industry._initfuncLink zu diesem Eintragfunc _init(p_id: int, p_type: String, px: int, py: int) -> void- Parameter
p_id: intp_type: Stringpx: intpy: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:58Industry.infofuncLink zu diesem Eintragfunc info() -> Dictionary- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:67Industry.set_erafuncTake on what its kind takes and makes in eraera.Link zu diesem Eintragfunc set_era(era: int) -> void- Parameter
era: int
- Rückgabewert
void
- Ruft auf
Data.accepts,Data.produces
scripts/sim/industry.gd:72Industry.centerfuncReturns the center of the industry footprint in map coordinates.Link zu diesem Eintragfunc center() -> Vector2It can be used as the destination for a news message.
- Rückgabewert
Vector2
scripts/sim/industry.gd:86Industry.tile_indicesfuncLink zu diesem Eintragfunc tile_indices(m: WorldMap) -> Array[int]- Parameter
m: WorldMap
- Rückgabewert
Array[int]
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:90Industry.roll_monthfuncLink zu diesem Eintragfunc roll_month() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:98Industry.wantedfuncStaff it wants each month (0: it runs without, and stations by it take no commuters).Industry.localfuncPeople who walk in from the towns around (see LOCAL_REACH), counted once a month.Link zu diesem Eintragfunc local(m: WorldMap, index: StaffingIndex = null) -> float- Parameter
m: WorldMapindex: StaffingIndex = null
- Rückgabewert
float
scripts/sim/industry.gd:168Industry.local_from_townsfuncLink zu diesem Eintragfunc local_from_towns(m: WorldMap, index: StaffingIndex = null) -> float- Parameter
m: WorldMapindex: StaffingIndex = null
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry.gd:174Industry.rect_gapstatic funcDistance between the nearest edges of two rectangles (0 when they touch or overlap).Link zu diesem Eintragstatic func rect_gap(a: Rect2, b: Rect2) -> float- Parameter
a: Rect2b: Rect2
- Rückgabewert
float
scripts/sim/industry.gd:186Industry.commutersfuncCommuters counting toward the staff: this month's, or last month's while this one is young.Link zu diesem Eintragfunc commuters() -> float- Rückgabewert
float
scripts/sim/industry.gd:193Industry.staffingfuncShare of the staff it wants that turns up (0..1); 1 for an industry that wants none.Link zu diesem Eintragfunc staffing(m: WorldMap, index: StaffingIndex = null) -> float- Parameter
m: WorldMapindex: StaffingIndex = null
- Rückgabewert
float
scripts/sim/industry.gd:198Industry.output_factorfuncHow the staff changes output: a primary industry makes PRIMARY_MIN..PRIMARY_MAX times its prod_rate, a processing plant turns PLANT_MIN..PLANT_MAX of each input unit into output.Link zu diesem Eintragfunc output_factor(m: WorldMap, index: StaffingIndex = null) -> floatAn industry that wants no staff runs at 1.
- Parameter
m: WorldMapindex: StaffingIndex = null
- Rückgabewert
float
scripts/sim/industry.gd:208Industry.hirefuncCommuters delivered to a station in reach: takes on up to what it still needs this month and returns how many it took.Link zu diesem Eintragfunc hire(m: WorldMap, n: float) -> floatA third of them go home again (SHIFT_BACK, see Economy.produce).
- Parameter
m: WorldMapn: float
- Rückgabewert
float
scripts/sim/industry.gd:219Industry.nearest_townfuncThe town with the nearest centre: where the industry window suggests bringing workers from.Link zu diesem Eintragfunc nearest_town(m: WorldMap) -> Town- Parameter
m: WorldMap
- Rückgabewert
Town
scripts/sim/industry.gd:227
Data
Data.CARGOconstwagon: what one wagon holds (30 when not given).Data.INDUSTRYconstworkers: the staff it wants each month (RAIL-28, Industry.staffing), processing plants more than mines and farms.Link zu diesem Eintragconst INDUSTRYA power station makes nothing for staff to raise, so it wants none. The eras rewrite the chains (RAIL-29).
Deklariert intakesandmakesare what a kind takes and makes when it first appears; never read them (orlater) directly, askaccepts/produces(or Industry's own lists, kept up to date with the map's era): -era: the era (index into ERAS) from which it is found on new maps and opens during the game. -later: what it takes and makes as well from a later era on: {era: {"takes": [...], "makes": [...]}}. -retires: the era from which it is on its way out: a mine's output drifts down every year, a customer nobody supplies may close, and no new ones open (IndustryLife). -needs_all: a plant that only works with every input (two or more): it holds what comes until the rest does, and turns each full set into as many units of output (Economy.deliver_to_industries). It is sited near makers of each input (WorldGen.find_site). -builds: a construction site: it takes these totals, then becomes the kind inbecomes.count0: never found on a new map or opened, only made from another (a finished wind farm).site: where it stands: on "land" (when not given), at "sea", on the "coast", or by a "town" (one of the biggest: a printing works, see WorldGen.find_site). Adding a chain: a new kind with itsera, or alaterentry on an existing one; town cargos go in TOWN_MAKES / TOWN_TAKES. Everything else (stations, AI, the map's chains, the timeline) follows.scripts/core/data.gd:48Data.TOWN_MAKESconstCargo houses make the way they make mail (by the people in them), from the era given on: from the Late century towns stop being only customers.Link zu diesem Eintragconst TOWN_MAKES := {"mail": 0, "waste": 2}Deklariert inscripts/core/data.gd:86Data.TOWN_TAKESconstCargo towns take, from the era given on: at stations that reach one of the buildings inat, or (pop) any house of a town of at least that many people.Data.HOUSESconstzone: R residential, C commercial, I light industry, L landmark.Link zu diesem Eintragconst HOUSES
Deklariert inpopcounts the people a building brings (residents or workers) - they all travel, so they all make passengers.scripts/core/data.gd:95Data.ZONE_NAMESconstLink zu diesem Eintragconst ZONE_NAMES := {"R": "Residential", "C": "Commercial", "I": "Industrial", "L": "Landmark", "A": "Attraction"}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:115Data.ATTRACTIONSconstAttractions towns build as they grow: population needed, and whether it has to be by the sea.Data.TOURIST_FAREconstpassengers to a station serving an attraction pay this much moreData.ERASconstAges of progress.Link zu diesem Eintragconst ERASEach brings new kinds of buildings, more productive industry and faster-growing towns.
Deklariert inscripts/core/data.gd:127Data.BUILD_INTROconstYear each building type starts appearing in towns.Link zu diesem Eintragconst BUILD_INTRO := {"apartment": 1955, "tower": 1962, "highrise": 1968, "modern": 1975, "mall": 1983, "techpark": 1992}Deklariert inscripts/core/data.gd:135Data.era_indexstatic funcLink zu diesem Eintragstatic func era_index(year: int) -> int- Parameter
year: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:138Data.can_buildstatic funcLink zu diesem Eintragstatic func can_build(type: String, year: int) -> bool- Parameter
type: Stringyear: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:146Data._chainsstatic vartype -> [{"accepts", "produces"} for each era], read-onlyData._town_makesstatic varera -> cargos houses makeData._town_takesstatic varera -> {house type: [cargos it takes]}Data._town_sizesstatic varera -> {cargo: the people a town needs to take it}Data._cargosstatic varera -> the cargos there are (see cargos)Data.acceptsstatic funcWhat an industry oftypetakes in eraera(an index into ERAS): what it took when it first appeared and everything later eras added.Link zu diesem Eintragstatic func accepts(type: String, era: int) -> ArrayShared and read-only.
- Parameter
type: Stringera: int
- Rückgabewert
Array
scripts/core/data.gd:161Data.producesstatic funcWhat an industry oftypemakes in eraera.Link zu diesem Eintragstatic func produces(type: String, era: int) -> ArrayShared and read-only.
- Parameter
type: Stringera: int
- Rückgabewert
Array
scripts/core/data.gd:166Data._chainstatic funcLink zu diesem Eintragstatic func _chain(type: String, era: int) -> Dictionary- Parameter
type: Stringera: int
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:170Data.existsstatic funcWhether industries oftypeare around by eraera.Link zu diesem Eintragstatic func exists(type: String, era: int) -> bool- Parameter
type: Stringera: int
- Rückgabewert
bool
scripts/core/data.gd:192Data.opensstatic funcWhether industries oftypeare found on new maps and open during the game by eraera(a kind withcount0 is only ever made from another).Link zu diesem Eintragstatic func opens(type: String, era: int) -> bool- Parameter
type: Stringera: int
- Rückgabewert
bool
scripts/core/data.gd:198Data.retiringstatic funcWhethertypeis on its way out by eraera(see INDUSTRY'sretires).Link zu diesem Eintragstatic func retiring(type: String, era: int) -> bool- Parameter
type: Stringera: int
- Rückgabewert
bool
scripts/core/data.gd:203Data.town_makesstatic funcThe cargos houses make in eraera, passengers aside (see TOWN_MAKES).Link zu diesem Eintragstatic func town_makes(era: int) -> Array- Parameter
era: int
- Rückgabewert
Array
scripts/core/data.gd:208Data.town_takesstatic funcThe cargos each kind of house takes in eraera, beyond what any town does (see TOWN_TAKES).Link zu diesem Eintragstatic func town_takes(era: int) -> Dictionary- Parameter
era: int
- Rückgabewert
Dictionary
scripts/core/data.gd:214Data.town_takes_by_sizestatic funcThe cargos any house of a big enough town takes in eraera: {cargo: the people the town needs} (see TOWN_TAKES'pop).Link zu diesem Eintragstatic func town_takes_by_size(era: int) -> Dictionary- Parameter
era: int
- Rückgabewert
Dictionary
scripts/core/data.gd:221Data.town_popstatic funcThe people a town needs before it takesc(0: any town, or only some of its buildings).Link zu diesem Eintragstatic func town_pop(c: String) -> int- Parameter
c: String
- Rückgabewert
int
scripts/core/data.gd:227Data._town_tablesstatic funcLink zu diesem Eintragstatic func _town_tables() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:231Data.cargosstatic funcThe cargos there are in eraera, in ALL_CARGO order: passengers, what towns make and take, and what the kinds of industry around by then take and make.Link zu diesem Eintragstatic func cargos(era: int) -> ArrayShared and read-only.
- Parameter
era: int
- Rückgabewert
Array
scripts/core/data.gd:260Data.era_changesstatic funcWhat eraichanges in the industry chains, a sentence each (for the news and the Timeline).Link zu diesem Eintragstatic func era_changes(i: int) -> Array- Parameter
i: int
- Rückgabewert
Array
- Ruft auf
L.t,L.lower,Fmt.cargo_list,Fmt.int_commas
scripts/core/data.gd:278Data.TOWN_PREFIXconstLink zu diesem Eintragconst TOWN_PREFIXFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:308Data.TOWN_SUFFIXconstLink zu diesem Eintragconst TOWN_SUFFIXFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:312Data.FREIGHTconstCars (RAIL-32) are in ALL_CARGO only: trains carry them on car wagons, roads on the car transporter.Link zu diesem Eintragconst FREIGHT := ["coal", "wood", "grain", "oil", "goods", "food", "iron_ore", "steel", "fish", "mail", "paper", "news", "plastics", "waste", "electronics"]Deklariert inscripts/core/data.gd:316Data.ALL_CARGOconstLink zu diesem Eintragconst ALL_CARGOFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:317Data.BULKconstWhat ships carry: newspapers aren't among them, as they would go stale long before a ship got anywhere.Link zu diesem Eintragconst BULK := ["coal", "wood", "grain", "oil", "goods", "food", "iron_ore", "steel", "fish", "paper", "plastics", "waste", "electronics"]Deklariert inscripts/core/data.gd:320Data.MODELSconstLink zu diesem Eintragconst MODELSFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:323Data.WAGONconstLink zu diesem Eintragconst WAGON := {"cost": 6500, "run": 450}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:335Data.REFITconstChanging cargo costs this share of the price: of a wagon for each wagon converted, of the whole vehicle for anything that isn't a train.Data.LENGTHconstBody length in tiles for road vehicles, ships and aircraft that aren't the standard size (road 0.46, ships 0.9, aircraft 0.7).Data.INTROconstLink zu diesem Eintragconst INTROFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:351Data.LATER_MODELSconstLink zu diesem Eintragconst LATER_MODELSFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:359Data.MOD_MODELSstatic varvehicle id -> the same fields as MODELS, plus "look" or "model", "mod"Data.MOD_CARGOstatic varcargo id -> {"rate", "days"} overridesData.MOD_COMPANY_NAMESstatic varLink zu diesem Eintragstatic var MOD_COMPANY_NAMES: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:404Data._town_prefixesstatic varLink zu diesem Eintragstatic var _town_prefixes: Array = TOWN_PREFIXFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:405Data._town_suffixesstatic varLink zu diesem Eintragstatic var _town_suffixes: Array = TOWN_SUFFIXFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:406Data.clear_modsstatic funcLink zu diesem Eintragstatic func clear_mods() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:409Data.add_modelstatic funcLink zu diesem Eintragstatic func add_model(id: String, m: Dictionary) -> void- Parameter
id: Stringm: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:417Data.add_town_namesstatic funcExtra name pieces for towns;replacedrops the game's own.Link zu diesem Eintragstatic func add_town_names(prefixes: Array, suffixes: Array, replace: bool = false) -> void- Parameter
prefixes: Arraysuffixes: Arrayreplace: bool = false
- Rückgabewert
void
scripts/core/data.gd:422Data.town_prefixesstatic funcLink zu diesem Eintragstatic func town_prefixes() -> Array- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:429Data.town_suffixesstatic funcLink zu diesem Eintragstatic func town_suffixes() -> Array- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:433Data.has_modelstatic funcChecks for an ID in the stock and enabled mod vehicle catalogs.Link zu diesem Eintragstatic func has_model(id: String) -> boolUse this before looking up an ID from a mod or save.
- Parameter
id: String
- Rückgabewert
bool
scripts/core/data.gd:437Data.modelstatic funcReturns the definition dictionary for an existing vehicle model ID, including enabled mods.Link zu diesem Eintragstatic func model(id: String) -> DictionaryUse
has_model(id)first when the ID might be missing.- Parameter
id: String
- Rückgabewert
Dictionary
Beispiel
Deklariert inif Data.has_model("diesel"): var diesel := Data.model("diesel") note(str(diesel.cost))scripts/core/data.gd:441Data.all_modelsstatic funcReturns the model IDs from the stock and enabled mod catalogs.Link zu diesem Eintragstatic func all_models() -> ArrayUse
available(id, year)to filter by sale date.- Rückgabewert
Array
scripts/core/data.gd:447Data.intro_yearstatic funcThe year a model goes on sale (0: from the start).Link zu diesem Eintragstatic func intro_year(id: String) -> int- Parameter
id: String
- Rückgabewert
int
scripts/core/data.gd:452Data.introsstatic funcEvery model with an introduction year: id -> year.Link zu diesem Eintragstatic func intros() -> Dictionary- Rückgabewert
Dictionary
scripts/core/data.gd:459Data.availablestatic funcChecks whether the current year is at or after a model’s introduction year.Link zu diesem Eintragstatic func available(id: String, year: int) -> boolUse
has_model(id)separately to verify the ID.- Parameter
id: Stringyear: int
- Rückgabewert
bool
scripts/core/data.gd:467Data.lookstatic funcThe game model whose 3D model (and size) a vehicle uses: itself, or a mod vehicle's "look".Link zu diesem Eintragstatic func look(id: String) -> String- Parameter
id: String
- Rückgabewert
String
scripts/core/data.gd:472Data.cargo_ratestatic funcReturns the payment rate per unit of the named cargo over 25 tiles before age penalties.Link zu diesem Eintragstatic func cargo_rate(c: String) -> floatUses the active mod override when one is set.
- Parameter
c: String
- Rückgabewert
float
scripts/core/data.gd:477Data.cargo_daysstatic funcReturns how many days the named cargo qualifies for the full rate.Link zu diesem Eintragstatic func cargo_days(c: String) -> floatUses the active mod override when one is set.
- Parameter
c: String
- Rückgabewert
float
scripts/core/data.gd:481Data.COSTconstLink zu diesem Eintragconst COSTFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:484Data.START_LOANconstwhat rivals start with (cash, all borrowed)Data.PLAYER_START_LOANSconstthe player's start-up loan choicesLink zu diesem Eintragconst PLAYER_START_LOANS := [100000, 250000, 500000]Deklariert inscripts/core/data.gd:496Data.PLAYER_START_LOANconst...and the defaultData.BANKRUPT_MONTHSconstmonths in the red before a company goes bankruptData.MAX_LOANconstLink zu diesem Eintragconst MAX_LOAN := 500000Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:499Data.LOAN_INTERESTconstLink zu diesem Eintragconst LOAN_INTEREST := 0.04Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:500Data.wagon_capstatic funcLink zu diesem Eintragstatic func wagon_cap(cargo: String) -> int- Parameter
cargo: String
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:503Data.BRIDGESconstBridge styles: cost multiplier, longest span (tiles between the ramps), year available.Data.BRIDGE_ORDERconstLink zu diesem Eintragconst BRIDGE_ORDER := ["beam", "truss", "viaduct", "arch", "suspension"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:515Data.LIFEconstYears a vehicle of this kind runs well; older ones put customers off.Link zu diesem Eintragconst LIFE := {"road": 15, "rail": 25, "water": 30, "air": 20}Deklariert inscripts/core/data.gd:519Data.BREAKDOWN_NAMESconstBreakdowns (a new-game option): none, reduced, normal.Link zu diesem Eintragconst BREAKDOWN_NAMES := ["None", "Reduced", "Normal"]Deklariert inscripts/core/data.gd:522Data.BREAKDOWN_RATEconstLink zu diesem Eintragconst BREAKDOWN_RATE := [0.0, 0.4, 1.0]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:523Data.SERVICE_DAYSconsta vehicle wants servicing this oftenData.reliabilitystatic funcHow reliable a model is when new or just serviced (0..1): later designs are better made.Link zu diesem Eintragstatic func reliability(model_id: String) -> float- Parameter
model_id: String
- Rückgabewert
float
scripts/core/data.gd:528Data.kind_namestatic funcLink zu diesem Eintragstatic func kind_name(kind: String) -> String- Parameter
kind: String
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/data.gd:536
AiPlayer
AiPlayer.NAMESconstLink zu diesem Eintragconst NAMESFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:10AiPlayer.ROUTES_PER_YEARconstLink zu diesem Eintragconst ROUTES_PER_YEAR := [1.0, 1.5, 3.0]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:13AiPlayer.CEILINGSconstshare of the maximum loan the AI will use for expansionAiPlayer.THINKconstLink zu diesem Eintragconst THINK := [[30, 60], [18, 40], [10, 24]]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:15AiPlayer.FOUNDINGconstLink zu diesem Eintragconst FOUNDING := [150, 120, 50]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:18AiPlayer.FOUNDING_GAPconstLink zu diesem Eintragconst FOUNDING_GAP := [70, 60, 30]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:19AiPlayer.COMPETE_SHAREconstLink zu diesem Eintragconst COMPETE_SHARE := [0.35, 0.55, 0.8]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:21AiPlayer.EXTRA_VEHICLESconstLink zu diesem Eintragconst EXTRA_VEHICLES := [1, 3, 5]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:23AiPlayer.RESERVEconstcash kept in hand before repaying the loanAiPlayer.MIN_EARNINGconsta year's profit each vehicle must make before its route gets moreAiPlayer.PAIRS_COMPAREDconstindustry pairs weighed up before choosing a freight routeAiPlayer.CLOSE_STEPconsttiles of a closed route torn up in one goAiPlayer.NO_PATH_FORconstnowhere to lay the line: the ground rarely changes, so wait four yearsAiPlayer.CLOSED_FORconsta route closed for losing money isn't tried again for ten yearsAiPlayer.BUILD_RATEconstLink zu diesem Eintragconst BUILD_RATE := {"rail": [2, 3, 4], "road": [3, 5, 7]}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:32AiPlayer.REROUTESconstways round something built across a line still being laidAiPlayer.SHIPS_ROOMconstmoney a rival can raise before it opens a ship routeAiPlayer.AIR_CASHconstmoney in hand before it opens an air service...AiPlayer.AIR_ROUTESconst...and how many it runs at most, by skill: airports aren't cheapAiPlayer.AIR_MINconsttiles between two towns worth flyingAiPlayer.SHIP_MAXconsttiles apart at most: ships are slow, whatever the map's sizeLink zu diesem Eintragconst SHIP_MAX := {"freight": 80.0, "ferry": 60.0}Deklariert inscripts/sim/ai_player.gd:39AiPlayer.AIRPORT_REACHconstan airport goes this close to the town centreAiPlayer.FERRIESconstferry services a rival runs at most, by skillAiPlayer.FERRY_TOWNconstpeople in each town a ferry linksAiPlayer.PORT_POPconstpeople a town's dock or airport must have within reachLink zu diesem Eintragconst PORT_POP := {"water": 150, "air": 200}Deklariert inscripts/sim/ai_player.gd:43AiPlayer.SITES_FORconstdays a search for dock and airport sites is rememberedAiPlayer.WASTE_TOWNconstpeople in a town a recycling line starts from (RAIL-29)AiPlayer.levelvarLink zu diesem Eintragvar level := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:47AiPlayer.loan_ceilingvarLink zu diesem Eintragvar loan_ceiling: floatFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:48AiPlayer.companyvarLink zu diesem Eintragvar company: CompanyFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:51AiPlayer.rngvarLink zu diesem Eintragvar rng := RandomNumberGenerator.new()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:52AiPlayer.next_thinkvarLink zu diesem Eintragvar next_think := 20Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:53AiPlayer.routesvar[{"kind", "cargo", "a": Station, "b": Station, "model", "wagons", "max"}], and optionally "consist" (a mixed train's wagons), "key" (its entry infailed) and "closing" (being torn up).AiPlayer.failedvar"kind:x,y" -> day it failed; tried again a year laterAiPlayer.projectvarThe route being built, or {}.Link zu diesem Eintragvar project := {}"kind" (rail/road), "line" (the points to lay, in order), "at" (index of the last point laid so far), "head"/"tail" (points at either end that are station platforms, kept when the rest is re-routed), "reserved" (tiles a re-route must avoid), "route" (its entry for
Deklariert inroutesonce it opens; its stations may still be missing), "buy" (vehicles to buy on opening), "finish" ("", or "bus"/"delivery"/"pickup": stops still to place in towns "town_a"/"town_b"), "news", "news_at" and "reroutes".scripts/sim/ai_player.gd:64AiPlayer._searchedvarthis think already ran a construction search (one a day is enough)AiPlayer._sitesvarDock and airport sites found lately: key -> [day searched, sites].Link zu diesem Eintragvar _sites := {}Not saved: it is only a cache.
Deklariert inscripts/sim/ai_player.gd:67AiPlayer.debugstatic varprint why route attempts fail (playtest tooling)AiPlayer.slowest_managestatic varthe longest think so far, in microseconds: looking after routes...AiPlayer.slowest_expandstatic var...and planning a new one (benchmark tooling)AiPlayer.create_competitorsstatic funcLink zu diesem Eintragstatic func create_competitors(sim: Sim, count: int) -> void- Parameter
sim: Simcount: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:73AiPlayer.dailyfuncLink zu diesem Eintragfunc daily(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:94AiPlayer._expandfuncLink zu diesem Eintragfunc _expand(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:111AiPlayer._operatingstatic funcIncome less the cost of running the network (vehicles, stations, track, interest) in ledgerl.Link zu diesem Eintragstatic func _operating(l: Dictionary) -> int- Parameter
l: Dictionary
- Rückgabewert
int
scripts/sim/ai_player.gd:124AiPlayer._troubledfuncIn the red, or about to be: no time for new ventures.Link zu diesem Eintragfunc _troubled() -> bool- Rückgabewert
bool
scripts/sim/ai_player.gd:130AiPlayer._open_routesfuncLink zu diesem Eintragfunc _open_routes() -> int- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:134AiPlayer._count_routesfuncRoutes still open, of one kind ("" for all), and of one cargo ifcargois given.Link zu diesem Eintragfunc _count_routes(kind: String, cargo := "") -> int- Parameter
kind: Stringcargo := ""
- Rückgabewert
int
scripts/sim/ai_player.gd:139AiPlayer._scaledstatic funcConstruction prices follow the game's building-cost setting, for rivals as for the player.Link zu diesem Eintragstatic func _scaled(sim: Sim, cost: int) -> int- Parameter
sim: Simcost: int
- Rückgabewert
int
scripts/sim/ai_player.gd:148AiPlayer._managefuncLink zu diesem Eintragfunc _manage(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
Data.wagon_cap,Data.model
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:154AiPlayer._fleetsfuncOur vehicles sorted by the route they were bought for: one list for each entry ofroutes.Link zu diesem Eintragfunc _fleets(sim: Sim) -> Array- Parameter
sim: Sim
- Rückgabewert
Array
scripts/sim/ai_player.gd:245AiPlayer._buyfuncOne more vehicle ofmodelfor router.Link zu diesem Eintragfunc _buy(sim: Sim, r: Dictionary, model: String) -> bool- Parameter
sim: Simr: Dictionarymodel: String
- Rückgabewert
bool
- Ruft auf
Vehicle.stranded
scripts/sim/ai_player.gd:263AiPlayer._close_routefuncTear up a route nothing runs on any more: its stations (unless another route still calls there, or they aren't ours, like an oil rig's dock) and, for a railway, its track.Link zu diesem Eintragfunc _close_route(sim: Sim, r: Dictionary) -> boolA stretch at a time, so a long line doesn't hold the game up. Returns true once nothing is left; vehicles in the way or an empty bank account mean another try next time.
- Parameter
sim: Simr: Dictionary
- Rückgabewert
bool
scripts/sim/ai_player.gd:282AiPlayer.industry_closedfuncAn industry has closed (RAIL-23): a route left with nothing to load, or without one of its stops (an oil rig's dock goes with the rig), is given up at once - its vehicles sold, then its stations and track torn up like those of any route that stops paying - and so is a line still being built.Link zu diesem Eintragfunc industry_closed(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/ai_player.gd:320AiPlayer._orphanedstatic funcA freight route whose loading end no longer has its cargo (the industry there closed), or whose other end no longer takes it (a wind farm site finished, a power station closed), or any route one of whose stations is gone.Link zu diesem Eintragstatic func _orphaned(r: Dictionary) -> boolStops a route doesn't have yet (a bus line still being built) are null.
- Parameter
r: Dictionary
- Rückgabewert
bool
scripts/sim/ai_player.gd:337AiPlayer._station_in_usefuncLink zu diesem Eintragfunc _station_in_use(sim: Sim, st: Station, r: Dictionary) -> bool- Parameter
sim: Simst: Stationr: Dictionary
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:346AiPlayer._own_track_fromfuncOur own plain track joined to stationst(the AI never shares track between its lines).Link zu diesem Eintragfunc _own_track_from(sim: Sim, st: Station) -> Array[Vector2i]- Parameter
sim: Simst: Station
- Rückgabewert
Array[Vector2i]
scripts/sim/ai_player.gd:359AiPlayer._best_modelfuncThe newest model of a family the AI knows that's on sale and carries the cargo.Link zu diesem Eintragfunc _best_model(sim: Sim, kind: String, cargo: String, current: String) -> StringAircraft stop at the narrowbody: the big jets want more passengers than the towns a rival flies between have.
- Parameter
sim: Simkind: Stringcargo: Stringcurrent: String
- Rückgabewert
String
- Ruft auf
Data.available,Data.model
scripts/sim/ai_player.gd:386AiPlayer._plan_linefuncA construction plan without the money check (_affordborrows when the AI commits to it).Link zu diesem Eintragfunc _plan_line(sim: Sim, kind: String, pts: Array[Vector2i]) -> Dictionary- Parameter
sim: Simkind: Stringpts: Array[Vector2i]
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.plan_line
scripts/sim/ai_player.gd:400AiPlayer._plan_routefuncThe same for a line with bridges and tunnels on it (RouteBuilder.last_crossings, RAIL-52).Link zu diesem Eintragfunc _plan_route(sim: Sim, kind: String, pts: Array[Vector2i], crossings: Array) -> Dictionary- Parameter
sim: Simkind: Stringpts: Array[Vector2i]crossings: Array
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:408AiPlayer._affordfuncMake surecostcan be paid, borrowing if needed.Link zu diesem Eintragfunc _afford(sim: Sim, cost: int) -> boolReturns false if it can't.
- Parameter
sim: Simcost: int
- Rückgabewert
bool
scripts/sim/ai_player.gd:413AiPlayer._try_new_routefuncLink zu diesem Eintragfunc _try_new_route(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:426AiPlayer._nothing_to_buildstatic funcA line plan that is refused only because everything on it exists already (a road that's there).Link zu diesem Eintragstatic func _nothing_to_build(plan: Dictionary) -> bool- Parameter
plan: Dictionary
- Rückgabewert
bool
scripts/sim/ai_player.gd:469AiPlayer._whyfuncLink zu diesem Eintragfunc _why(msg: String) -> void- Parameter
msg: String
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:473AiPlayer._try_busesfuncLink zu diesem Eintragfunc _try_buses(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
- Ruft auf
RouteBuilder.find,RouteBuilder.jumps_for,L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:478AiPlayer._links_townsfuncWhether one of our passenger lines ofkind(road or rail) already runs between these two towns.Link zu diesem Eintragfunc _links_towns(a: Town, b: Town, kind: String = "road") -> bool- Parameter
a: Townb: Townkind: String = "road"
- Rückgabewert
bool
scripts/sim/ai_player.gd:541AiPlayer._try_mailfuncA mail van for one of our bus lines that has none yet: the stops are there already.Link zu diesem Eintragfunc _try_mail(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:552AiPlayer._town_stop_tilestatic funcA straight town road tile near the centre that can take a stop.Link zu diesem Eintragstatic func _town_stop_tile(m: WorldMap, t: Town) -> Dictionary- Parameter
m: WorldMapt: Town
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:578AiPlayer._map_scalestatic funcLink zu diesem Eintragstatic func _map_scale(sim: Sim) -> float- Parameter
sim: Sim
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:594AiPlayer._industry_pairfuncPick a producing industry and the nearest industry that accepts its cargo within a distance band.Link zu diesem Eintragfunc _industry_pair(sim: Sim, min_d: float, max_d: float, kind: String) -> ArrayA relaxed rival takes the first pair it comes across; better ones compare a few and take the one that should earn most (output not yet carried away x fare for the distance).
- Parameter
sim: Simmin_d: floatmax_d: floatkind: String
- Rückgabewert
Array
- Ruft auf
Data.town_pop,Data.cargo_rate
scripts/sim/ai_player.gd:601AiPlayer._customer_rankstatic funcHow good a customer forcindustryqis (RAIL-29), the best first, then the nearest: 2 a plant that needs every input and has the others, waiting forc(this completes a chain); 1 an ordinary customer; 0 one that won't keep making something of it: a wind farm site (finished one day, when it takes no more) or a plant still missing another input.Link zu diesem Eintragstatic func _customer_rank(q: Industry, c: String) -> intThose pay for what is delivered all the same, so they do when there is nothing better.
- Parameter
q: Industryc: String
- Rückgabewert
int
scripts/sim/ai_player.gd:661AiPlayer._outputstatic funcHow muchcpmakes in a month: a primary's rate, or what a processing plant made last month.Link zu diesem Eintragstatic func _output(p: Industry, c: String) -> float- Parameter
p: Industryc: String
- Rückgabewert
float
scripts/sim/ai_player.gd:674AiPlayer._customer_townstatic funcThe nearest town big enough to want goods and food (and of at leastpoppeople), within a distance band ofp.Link zu diesem Eintragstatic func _customer_town(sim: Sim, p: Industry, min_d: float, max_d: float, pop: int = 0) -> Town- Parameter
sim: Simp: Industrymin_d: floatmax_d: floatpop: int = 0
- Rückgabewert
Town
scripts/sim/ai_player.gd:680AiPlayer._good_sourcestatic funcA producing industry on land (see_producing).Link zu diesem Eintragstatic func _good_source(ind: Industry) -> bool- Parameter
ind: Industry
- Rückgabewert
bool
scripts/sim/ai_player.gd:694AiPlayer._producingstatic funcA primary industry, or a processing plant that's being supplied.Link zu diesem Eintragstatic func _producing(ind: Industry) -> bool- Parameter
ind: Industry
- Rückgabewert
bool
scripts/sim/ai_player.gd:699AiPlayer._served_bystatic funcLink zu diesem Eintragstatic func _served_by(sim: Sim, ind: Industry, c: String, who: Company) -> bool- Parameter
sim: Simind: Industryc: Stringwho: Company
- Rückgabewert
bool
- Ruft auf
Economy.industry_stations
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:710AiPlayer._served_by_anyonestatic funcLink zu diesem Eintragstatic func _served_by_anyone(sim: Sim, ind: Industry, c: String) -> bool- Parameter
sim: Simind: Industryc: String
- Rückgabewert
bool
- Ruft auf
Economy.industry_stations
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:717AiPlayer._terminalfuncFind platform tiles nearindfor a terminal oflengthtiles, ending on the side facingtoward.Link zu diesem Eintragfunc _terminal(sim: Sim, kind: String, ind: Industry, length: int, toward: Vector2, partner: Dictionary = {}) -> DictionaryReturns {"tiles", "axis", "end", "exit", "exit_dir"} or {}.
partner: the terminal at the other end of the line, when that is chosen already.- Parameter
sim: Simkind: Stringind: Industrylength: inttoward: Vector2partner: Dictionary = {}
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:727AiPlayer._terminal_infuncThe same for any area: the best site whose first tile lies inarea.Link zu diesem Eintragfunc _terminal_in(sim: Sim, kind: String, area: Rect2i, length: int, toward: Vector2, min_pop: int, partner: Dictionary = {}) -> DictionaryWith
min_pop, only sites whose catchment houses at least that many people count, and busier ones are preferred.- Parameter
sim: Simkind: Stringarea: Rect2ilength: inttoward: Vector2min_pop: intpartner: Dictionary = {}
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:735AiPlayer._try_wastefuncA recycling line (RAIL-29): trucks carry the waste from a town's centre to a recycling plant within reach.Link zu diesem Eintragfunc _try_waste(sim: Sim) -> boolTowns big enough to fill a truck now and then, and not served by us already.
- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:791AiPlayer._count_routes_fromfuncOur open routes loadingcargoat a stop in townt.Link zu diesem Eintragfunc _count_routes_from(t: Town, cargo: String) -> int- Parameter
t: Towncargo: String
- Rückgabewert
int
scripts/sim/ai_player.gd:816AiPlayer._try_trucksfuncLink zu diesem Eintragfunc _try_trucks(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:824AiPlayer._try_railfuncLink zu diesem Eintragfunc _try_rail(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:833AiPlayer._try_pax_railfuncA passenger (and mail) railway between two sizeable towns a good way apart.Link zu diesem Eintragfunc _try_pax_rail(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:841AiPlayer._build_pax_railfuncLink zu diesem Eintragfunc _build_pax_rail(sim: Sim, a: Town, b: Town, key: String) -> bool- Parameter
sim: Sima: Townb: Townkey: String
- Rückgabewert
bool
- Ruft auf
RouteBuilder.find,Const.opp,RouteBuilder.jumps_for,L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:864AiPlayer._build_freightfuncLink zu diesem Eintragfunc _build_freight(sim: Sim, kind: String, p: Industry, q: Industry, cargo: String) -> bool- Parameter
sim: Simkind: Stringp: Industryq: Industrycargo: String
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:913AiPlayer._build_town_deliveryfuncA truck line from a processing plant to a stop in the middle of a town that takes its cargo, or withpickupthe other way round: from a town stop that supplies it (waste) top, which takes it.Link zu diesem Eintragfunc _build_town_delivery(sim: Sim, p: Industry, town: Town, cargo: String, pickup := false) -> bool- Parameter
sim: Simp: Industrytown: Towncargo: Stringpickup := false
- Rückgabewert
bool
scripts/sim/ai_player.gd:979AiPlayer._try_shipsfuncA ship route: freight, or when there's none to try (no search was run), a ferry.Link zu diesem Eintragfunc _try_ships(sim: Sim) -> boolA ferry earns far less than a freighter, so a rival runs only a few (FERRIES).
- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:1044AiPlayer._try_ship_freightfuncFreight by sea: a producing industry ships can call at (an oil rig, or one near the shore) and the nearest industry by the sea that takes its cargo, weighed up as in_industry_pair.Link zu diesem Eintragfunc _try_ship_freight(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
- Ruft auf
Data.cargo_rate
scripts/sim/ai_player.gd:1052AiPlayer._build_ship_freightfuncLink zu diesem Eintragfunc _build_ship_freight(sim: Sim, p: Industry, q: Industry, cargo: String) -> bool- Parameter
sim: Simp: Industryq: Industrycargo: String
- Rückgabewert
bool
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1098AiPlayer._try_ferryfuncA ferry between two towns of FERRY_TOWN+ people on the same water, 14 to SHIP_MAX tiles apart.Link zu diesem Eintragfunc _try_ferry(sim: Sim) -> bool- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:1115AiPlayer._try_airfuncAn air service between two big towns a good way apart: from a town, to the biggest one far enough away.Link zu diesem Eintragfunc _try_air(sim: Sim) -> boolA town's airport is used again for its next service rather than building another.
- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:1145AiPlayer._pair_keystatic funcLink zu diesem Eintragstatic func _pair_key(what: String, a: Town, b: Town) -> String- Parameter
what: Stringa: Townb: Town
- Rückgabewert
String
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1171AiPlayer._build_town_linkfuncA passenger service ofkind("water" or "air") between two towns, calling atpaandpb(see_town_port).Link zu diesem Eintragfunc _build_town_link(sim: Sim, kind: String, a: Town, b: Town, pa: Dictionary, pb: Dictionary) -> bool- Parameter
sim: Simkind: Stringa: Townb: Townpa: Dictionarypb: Dictionary
- Rückgabewert
bool
- Ruft auf
L.t
scripts/sim/ai_player.gd:1177AiPlayer._open_port_routefuncBuild what a ship or air route still needs at either end (r.a,r.b: {"station"} for one that's there already, or a site {"tiles", "axis"}), buy its firstcountvehicles and open it.Link zu diesem Eintragfunc _open_port_route(sim: Sim, r: Dictionary, count: int, news: String, news_at: Vector2) -> boolNothing is built unless both ends can be, and each must supply or take the cargo as its end of the route should.
- Parameter
sim: Simr: Dictionarycount: intnews: Stringnews_at: Vector2
- Rückgabewert
bool
scripts/sim/ai_player.gd:1194AiPlayer._town_portfuncWhere a passenger service ofkind("water" or "air") calls intown: a dock or airport of ours there already, or else the best site for a new one ({} when there's none).Link zu diesem Eintragfunc _town_port(sim: Sim, kind: String, town: Town) -> Dictionary- Parameter
sim: Simkind: Stringtown: Town
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:1243AiPlayer._port_towardfuncWhere a ship route forindcalls: our own dock that serves it already, an oil rig's open dock, or the shore site nearesttoward.Link zu diesem Eintragfunc _port_toward(sim: Sim, ind: Industry, toward: Vector2) -> Dictionary{} if ships can't reach it.
- Parameter
sim: Simind: Industrytoward: Vector2
- Rückgabewert
Dictionary
- Ruft auf
Economy.industry_stations
scripts/sim/ai_player.gd:1254AiPlayer._ports_offuncWhere ships can call forind: an oil rig's own open dock, or the shore tiles near enough for a dock's catchment to reach it ([] inland).Link zu diesem Eintragfunc _ports_of(sim: Sim, ind: Industry) -> ArrayRemembered for a while.
- Parameter
sim: Simind: Industry
- Rückgabewert
Array
scripts/sim/ai_player.gd:1272AiPlayer._industry_docksstatic funcLink zu diesem Eintragstatic func _industry_docks(m: WorldMap, ind: Industry) -> Array- Parameter
m: WorldMapind: Industry
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1276AiPlayer._rememberedfuncA search for sites, done again only once it's SITES_FOR days old: the coast and the towns barely change from one think to the next, and a site that has gone is caught when it's built on.Link zu diesem Eintragfunc _remembered(sim: Sim, key: String, search: Callable)- Parameter
sim: Simkey: Stringsearch: Callable
- Rückgabewert
func _remembered(sim: Sim, key: String, search: Callable)
scripts/sim/ai_player.gd:1293AiPlayer._port_sitestatic funcThe best site near the centre oftownfor a dock (a shore tile) or an airport (a level 3x2 or 2x3 patch): most people within its reach, at least PORT_POP, less a little for each tile from the centre.Link zu diesem Eintragstatic func _port_site(m: WorldMap, kind: String, town: Town) -> Dictionary{"tiles", "axis"}, or {} when there's none.
- Parameter
m: WorldMapkind: Stringtown: Town
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:1304AiPlayer._port_fitsstatic funcWhether a dock (kind"water", one tile) or an airport ("air") can go on the tiles ofr.Link zu diesem Eintragstatic func _port_fits(m: WorldMap, kind: String, r: Rect2i) -> bool- Parameter
m: WorldMapkind: Stringr: Rect2i
- Rückgabewert
bool
- Ruft auf
BuildOps.station_tile_problem
scripts/sim/ai_player.gd:1335AiPlayer._pop_tablestatic funcRunning totals of the people in the houses ofarea, so that those in any rectangle of it take four lookups (_pop_in) instead of a count tile by tile.Link zu diesem Eintragstatic func _pop_table(m: WorldMap, area: Rect2i) -> PackedInt32Array- Parameter
m: WorldMaparea: Rect2i
- Rückgabewert
PackedInt32Array
scripts/sim/ai_player.gd:1356AiPlayer._pop_instatic funcLink zu diesem Eintragstatic func _pop_in(sums: PackedInt32Array, area: Rect2i, r: Rect2i) -> int- Parameter
sums: PackedInt32Arrayarea: Rect2ir: Rect2i
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1374AiPlayer._berthstatic funcThe water tile ships berth at for a dock end of a route ({"station"} or a shore site).Link zu diesem Eintragstatic func _berth(m: WorldMap, port: Dictionary) -> Vector2i- Parameter
m: WorldMapport: Dictionary
- Rückgabewert
Vector2i
- Ruft auf
BuildOps.dock_facing
scripts/sim/ai_player.gd:1387AiPlayer._second_berthfuncShips take turns at a berth (RAIL-26).Link zu diesem Eintragfunc _second_berth(sim: Sim, fleet: Array) -> voidA ship seen waiting (thinks are weeks apart, so it waits often) off one of our one-berth docks, where the ship in the berth is waiting for a full load, gets a second dock tile built beside the first, with a berth of its own - but only when the waiting ship has other work there: cargo to unload, or a different cargo to load. Two ships waiting for the same cargo gain nothing from a berth each: they would share it out between them, fill up no sooner, and then sail in convoy with nobody loading in between. Two berths at most, and an oil rig's dock is nobody's to extend.
- Parameter
sim: Simfleet: Array
- Rückgabewert
void
scripts/sim/ai_player.gd:1403AiPlayer._berth_besidestatic funcA shore tile beside dock tilet, whose ships berth on the waterfacingit, where a second dock tile would have a berth of its own: on the same shore, facing the same way, so the two berths lie side by side, and on water no other dock berths at.Link zu diesem Eintragstatic func _berth_beside(m: WorldMap, t: Vector2i, facing: int) -> Vector2i(-1, -1) if there's none.
- Parameter
m: WorldMapt: Vector2ifacing: int
- Rückgabewert
Vector2i
- Ruft auf
BuildOps.dock_facing
scripts/sim/ai_player.gd:1429AiPlayer._berth_takenstatic funcWhether a dock already berths at water tilew: one on the shore facing it, or an oil rig's dock standing on it.Link zu diesem Eintragstatic func _berth_taken(m: WorldMap, w: Vector2i) -> bool- Parameter
m: WorldMapw: Vector2i
- Rückgabewert
bool
scripts/sim/ai_player.gd:1442AiPlayer._sea_linkstatic funcWhether ships can sail between the water tilesaandbby a way not much longer than the straight line (a long way round the coast pays no more than the short one).Link zu diesem Eintragstatic func _sea_link(m: WorldMap, a: Vector2i, b: Vector2i) -> boolThe search keeps to the water near that line, so even on a big sea it's quick.
- Parameter
m: WorldMapa: Vector2ib: Vector2i
- Rückgabewert
bool
- Ruft auf
Pathfinder.find_sea
scripts/sim/ai_player.gd:1457AiPlayer._carries_fromfuncWhether one of our routes already loadscat a station servingind(an oil rig's dock is nobody's, so_served_bydoesn't see our tankers there).Link zu diesem Eintragfunc _carries_from(sim: Sim, ind: Industry, c: String) -> bool- Parameter
sim: Simind: Industryc: String
- Rückgabewert
bool
- Ruft auf
Economy.industry_stations
scripts/sim/ai_player.gd:1463AiPlayer._startfuncBegin layingline, a stretch a day (seeproject).Link zu diesem Eintragfunc _start(line: Array[Vector2i], head: int, tail: int, reserved: Dictionary, to_lay: bool, route: Dictionary, buy: int, news: String, news_at: Vector2, extra: Dictionary = {}) -> voidhead/tail: points at the start/end of the line that are platforms.to_lay: false when every piece of it exists already (an existing road).- Parameter
line: Array[Vector2i]head: inttail: intreserved: Dictionaryto_lay: boolroute: Dictionarybuy: intnews: Stringnews_at: Vector2extra: Dictionary = {}
- Rückgabewert
void
scripts/sim/ai_player.gd:1475AiPlayer._constructfuncA day's work on the line under construction, and opening it once it's finished.Link zu diesem Eintragfunc _construct(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/ai_player.gd:1484AiPlayer._next_crossingstatic funcThe next bridge or tunnel the line under construction comes to ({} when none is left).Link zu diesem Eintragstatic func _next_crossing(p: Dictionary) -> Dictionary- Parameter
p: Dictionary
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:1536AiPlayer._reroutefuncA new way from where the line has got to, to its far end.Link zu diesem Eintragfunc _reroute(sim: Sim) -> boolFalse if there's none (or the line has been re-routed too often already).
- Parameter
sim: Sim
- Rückgabewert
bool
scripts/sim/ai_player.gd:1550AiPlayer._openfuncThe line is finished: place the stops still missing, buy the first vehicles and open for business.Link zu diesem Eintragfunc _open(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/ai_player.gd:1606AiPlayer._abandonfuncGive up the line under construction: what was built of it is torn up again (roads stay, as they do when a route closes) and the place isn't tried again for a while.Link zu diesem Eintragfunc _abandon(sim: Sim, why: String) -> void- Parameter
sim: Simwhy: String
- Rückgabewert
void
scripts/sim/ai_player.gd:1642AiPlayer.to_dictfuncLink zu diesem Eintragfunc to_dict() -> Dictionary- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1661AiPlayer._route_to_dictstatic funcLink zu diesem Eintragstatic func _route_to_dict(r: Dictionary) -> Dictionary- Parameter
r: Dictionary
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1681AiPlayer._route_from_dictstatic funcA route saved by_route_to_dict, or {} if one of its stations is gone.Link zu diesem Eintragstatic func _route_from_dict(r: Dictionary, by_id: Dictionary, partial := false) -> DictionaryWith
partial, a station not placed yet (-1) is allowed.- Parameter
r: Dictionaryby_id: Dictionarypartial := false
- Rückgabewert
Dictionary
scripts/sim/ai_player.gd:1692AiPlayer._flatstatic funcLink zu diesem Eintragstatic func _flat(tiles: Array) -> Array- Parameter
tiles: Array
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1713AiPlayer._tilesstatic funcLink zu diesem Eintragstatic func _tiles(flat: Array) -> Array[Vector2i]- Parameter
flat: Array
- Rückgabewert
Array[Vector2i]
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1721AiPlayer.from_dictstatic funcLink zu diesem Eintragstatic func from_dict(sim: Sim, d: Dictionary) -> AiPlayer- Parameter
sim: Simd: Dictionary
- Rückgabewert
AiPlayer
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/ai_player.gd:1728
BuildOps
BuildOps._planstatic funcLink zu diesem Eintragstatic func _plan() -> Dictionary- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:8BuildOps._failstatic funcLink zu diesem Eintragstatic func _fail(p: Dictionary, t: Vector2i, why: String) -> void- Parameter
p: Dictionaryt: Vector2iwhy: String
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:12BuildOps.dir_betweenstatic funcLink zu diesem Eintragstatic func dir_between(a: Vector2i, b: Vector2i) -> int- Parameter
a: Vector2ib: Vector2i
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:18BuildOps.network_bits_okstatic funcWhether a tile can carry a road or rail piece with the given full connection bitmask.Link zu diesem Eintragstatic func network_bits_ok(m: WorldMap, x: int, y: int, bits: int, strict: bool = false) -> boolFlat tiles take any shape; simple inclines only take pieces running along the incline.
- Parameter
m: WorldMapx: inty: intbits: intstrict: bool = false
- Rückgabewert
bool
scripts/sim/build_ops.gd:26BuildOps._slope_reasonstatic funcLink zu diesem Eintragstatic func _slope_reason(m: WorldMap, x: int, y: int) -> String- Parameter
m: WorldMapx: inty: int
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:50BuildOps._obj_reasonstatic funcLink zu diesem Eintragstatic func _obj_reason(o: Dictionary) -> String- Parameter
o: Dictionary
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:58BuildOps._is_crossingstatic funcLink zu diesem Eintragstatic func _is_crossing(existing_other: int, bits: int) -> bool- Parameter
existing_other: intbits: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:67BuildOps.span_problemstatic funcGround construction under a bridge or over a tunnel: allowed only across its line.Link zu diesem Eintragstatic func span_problem(m: WorldMap, x: int, y: int, bits: int) -> String- Parameter
m: WorldMapx: inty: intbits: int
- Rückgabewert
String
- Ruft auf
L.t,WorldMap.axis_of
scripts/sim/build_ops.gd:72BuildOps.under_bridgestatic funcLink zu diesem Eintragstatic func under_bridge(m: WorldMap, x: int, y: int) -> bool- Parameter
m: WorldMapx: inty: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:86BuildOps.rail_tile_problemstatic funcWhy rail with full bitmaskbitscan't go on this tile, or "" if it can.Link zu diesem Eintragstatic func rail_tile_problem(m: WorldMap, x: int, y: int, bits: int) -> String- Parameter
m: WorldMapx: inty: intbits: int
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/build_ops.gd:92BuildOps.road_tile_problemstatic funcWhy road with full bitmaskbitscan't go on this tile, or "" if it can.Link zu diesem Eintragstatic func road_tile_problem(m: WorldMap, x: int, y: int, bits: int) -> String- Parameter
m: WorldMapx: inty: intbits: int
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/build_ops.gd:118BuildOps.INDUSTRY_GAPconstTiles of open ground towns leave around an industry's footprint: room for the player's station or loading bay, and no houses pressed against a cooling tower.BuildOps.can_link_roadstatic funcStricter rule used by town growth: no crossings, no stations, and no new street into the ground kept clear around an industry (joining a road already there is fine).Link zu diesem Eintragstatic func can_link_road(m: WorldMap, x: int, y: int, d: int, strict: bool = false) -> bool- Parameter
m: WorldMapx: inty: intd: intstrict: bool = false
- Rückgabewert
bool
- Ruft auf
Const.opp
scripts/sim/build_ops.gd:152BuildOps.link_roadstatic funcLink zu diesem Eintragstatic func link_road(m: WorldMap, x: int, y: int, d: int) -> void- Parameter
m: WorldMapx: inty: intd: int
- Rückgabewert
void
- Ruft auf
Const.opp
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:171BuildOps.can_build_housestatic funcHouses need a flat, dry, empty tile, clear of the ground kept around industries.Link zu diesem Eintragstatic func can_build_house(m: WorldMap, x: int, y: int) -> bool- Parameter
m: WorldMapx: inty: int
- Rückgabewert
bool
scripts/sim/build_ops.gd:181BuildOps.plan_linestatic funcPlan a road or rail line through consecutive, 4-adjacent tilespts.Link zu diesem Eintragstatic func plan_line(m: WorldMap, kind: String, pts: Array[Vector2i]) -> DictionaryExtra keys: kind, add (Vector2i -> bits to add).
- Parameter
m: WorldMapkind: Stringpts: Array[Vector2i]
- Rückgabewert
Dictionary
scripts/sim/build_ops.gd:194BuildOps._parallel_diagonalstatic funcIfexistingis one corner piece andaddingthe opposite corner, the pairing they form as two parallel diagonals (see WorldMap.diag2), else -1.Link zu diesem Eintragstatic func _parallel_diagonal(existing: int, adding: int) -> int- Parameter
existing: intadding: int
- Rückgabewert
int
scripts/sim/build_ops.gd:245BuildOps.apply_linestatic funcLink zu diesem Eintragstatic func apply_line(m: WorldMap, p: Dictionary) -> void- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:255BuildOps.dock_facingstatic funcDirection from a shore tile down to open water, or -1.Link zu diesem Eintragstatic func dock_facing(m: WorldMap, x: int, y: int) -> intDocks sit on a shore slope whose low edge meets the water (or on a level tile at the water's edge).
- Parameter
m: WorldMapx: inty: int
- Rückgabewert
int
scripts/sim/build_ops.gd:276BuildOps.station_tile_problemstatic funcLink zu diesem Eintragstatic func station_tile_problem(m: WorldMap, kind: String, x: int, y: int, axis: int) -> String- Parameter
m: WorldMapkind: Stringx: inty: intaxis: int
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:284BuildOps.MAX_STATION_SPREADconsta station's tiles fit in a square this many tiles acrossBuildOps.plan_stationstatic funcPlan station tiles ofkind("rail" or "road") alongaxis.Link zu diesem Eintragstatic func plan_station(m: WorldMap, kind: String, pts: Array[Vector2i], axis: int) -> DictionaryExtra keys: kind, axis, tiles, join (Station or null), catch (catchment incl. joined station), accepts, supplies, attractions (attraction types in the catchment).
- Parameter
m: WorldMapkind: Stringpts: Array[Vector2i]axis: int
- Rückgabewert
Dictionary
- Ruft auf
L.t,Station.add_catchment,Station.coverage
scripts/sim/build_ops.gd:333BuildOps.apply_stationstatic funcLink zu diesem Eintragstatic func apply_station(m: WorldMap, p: Dictionary) -> Station- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
Station
- Ruft auf
Station.make_name,WorldMap.axis_of
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:389BuildOps.add_rig_dockstatic funcThe open dock an industry at sea (an oil rig) comes with, so a rig can be served by ship however far from the shore it stands.Link zu diesem Eintragstatic func add_rig_dock(m: WorldMap, ind: Industry) -> StationNobody owns it and every company's ships may load there. Made with the map, and on loading a save from before rigs had one. Returns the dock (the one it already has, if any), or null when no open water touches the rig.
- Parameter
m: WorldMapind: Industry
- Rückgabewert
Station
- Ruft auf
L.t,WorldMap.axis_of
scripts/sim/build_ops.gd:424BuildOps.rig_dock_spotstatic funcWhere a rig's dock goes: a free water tile along one of the rig's sides, the one with the most open water around it (away from any shore), so ships come and go easily.Link zu diesem Eintragstatic func rig_dock_spot(m: WorldMap, ind: Industry) -> Vector2i(-1, -1) if none.
- Parameter
m: WorldMapind: Industry
- Rückgabewert
Vector2i
scripts/sim/build_ops.gd:455BuildOps.is_rig_dockstatic funcTrue on the tile of a rig's own dock (see add_rig_dock).Link zu diesem Eintragstatic func is_rig_dock(o) -> bool- Parameter
o
- Rückgabewert
bool
scripts/sim/build_ops.gd:486BuildOps.bulldoze_targetstatic funcWhat bulldozing a tile would remove (one layer: station, track, road, building or trees) and its cost.Link zu diesem Eintragstatic func bulldoze_target(m: WorldMap, x: int, y: int, who_id: int = -1) -> Dictionarywho_id: the company bulldozing. On a level crossing over someone else's track it takes the road.- Parameter
m: WorldMapx: inty: intwho_id: int = -1
- Rückgabewert
Dictionary
scripts/sim/build_ops.gd:494BuildOps.plan_bulldozestatic funcExtra keys: rect, count.Link zu diesem Eintragstatic func plan_bulldoze(m: WorldMap, rect: Rect2i, who_id: int = -1) -> Dictionary- Parameter
m: WorldMaprect: Rect2iwho_id: int = -1
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/build_ops.gd:526BuildOps.apply_bulldozestatic funcApplies to every removable tile in the rect; industries are skipped.Link zu diesem Eintragstatic func apply_bulldoze(m: WorldMap, p: Dictionary) -> void- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
void
- Ruft auf
WorldMap.crossing_tiles,Town.footprint,Const.opp
scripts/sim/build_ops.gd:566BuildOps.plan_terraformstatic funcRaise (delta = 1) or lower (delta = -1) one tile corner.Link zu diesem Eintragstatic func plan_terraform(m: WorldMap, c: Vector2i, delta: int) -> DictionaryNeighbouring corners follow so that edge-adjacent corners never differ by more than one level. Extra keys: corner, corners (Vector2i -> new height), tiles (affected tiles).
- Parameter
m: WorldMapc: Vector2idelta: int
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/build_ops.gd:648BuildOps.apply_terraformstatic funcLink zu diesem Eintragstatic func apply_terraform(m: WorldMap, p: Dictionary) -> void- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
void
- Ruft auf
TerrainGen.classify_tile
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:701BuildOps.plan_levelstatic funcLevel the tiles inrect(all their corners) toheight, as far as the rules allow.Link zu diesem Eintragstatic func plan_level(m: WorldMap, rect: Rect2i, height: int, blocked: Dictionary = {}) -> DictionaryCorners move one level at a time - cutting from the top down, then filling from the bottom up - and drag their neighbours along the way plan_terraform does, so edge-adjacent corners never differ by more than one level. A tile that can't change shape (a building, road or track, a bridge or tunnel, water, or a tile in
blocked: tile -> reason) pins its corners, and any move that would disturb a pinned corner is left out; the rest of the area is still levelled. Trees on tiles that change shape are cleared. Extra keys: rect, height, corners (Vector2i -> new height), steps (corner moves, each costing Data.COST.terraform), tiles (tiles that change shape), trees (those of them with trees), why (refused tile -> reason; the same tiles are inbad).- Parameter
m: WorldMaprect: Rect2iheight: intblocked: Dictionary = {}
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/build_ops.gd:723BuildOps._level_problemstatic funcWhy tiletcan't change shape while levelling ("" if it can).Link zu diesem Eintragstatic func _level_problem(m: WorldMap, t: Vector2i, blocked: Dictionary) -> String- Parameter
m: WorldMapt: Vector2iblocked: Dictionary
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/build_ops.gd:783BuildOps._level_stepstatic funcMove cornercone level (delta) tov, dragging neighbours along.Link zu diesem Eintragstatic func _level_step(m: WorldMap, c: Vector2i, v: int, delta: int, work: Dictionary, blocked: Dictionary, problems: Dictionary, p: Dictionary) -> boolFails, changing nothing in
work, when a corner that would move belongs to a tile that can't change (recorded in p.why).- Parameter
m: WorldMapc: Vector2iv: intdelta: intwork: Dictionaryblocked: Dictionaryproblems: Dictionaryp: Dictionary
- Rückgabewert
bool
scripts/sim/build_ops.gd:800BuildOps.apply_levelstatic funcLink zu diesem Eintragstatic func apply_level(m: WorldMap, p: Dictionary) -> void- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
void
- Ruft auf
TerrainGen.classify_tile
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:838BuildOps.MAX_BRIDGEconstLink zu diesem Eintragconst MAX_BRIDGE := 24Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:857BuildOps.MAX_TUNNELconstLink zu diesem Eintragconst MAX_TUNNEL := 30Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:858BuildOps.edge_heightsstatic funcCorner heights of the edge of tiletfacing directiond.Link zu diesem Eintragstatic func edge_heights(m: WorldMap, t: Vector2i, d: int) -> Vector2i- Parameter
m: WorldMapt: Vector2id: int
- Rückgabewert
Vector2i
scripts/sim/build_ops.gd:862BuildOps._end_piecestatic funcThe network piece a bridge or tunnel needs on tilet(toward directiond), added to the plan.Link zu diesem Eintragstatic func _end_piece(m: WorldMap, p: Dictionary, t: Vector2i, d: int) -> void- Parameter
m: WorldMapp: Dictionaryt: Vector2id: int
- Rückgabewert
void
scripts/sim/build_ops.gd:871BuildOps.plan_bridgestatic funcA bridge from ramp tileato ramp tileb(same row or column).Link zu diesem Eintragstatic func plan_bridge(m: WorldMap, kind: String, a: Vector2i, b: Vector2i, style: String = "") -> DictionaryThe deck sits at the height of the ramps' inner edges, which must match. The ground underneath may not rise above the deck, and roads or track passing under need a level of clearance. Extra keys: kind, type, s0, s1, dir, level, add (ramp pieces), tiles (spans).
- Parameter
m: WorldMapkind: Stringa: Vector2ib: Vector2istyle: String = ""
- Rückgabewert
Dictionary
- Ruft auf
L.t,L.lower,Const.opp,WorldMap.axis_of
scripts/sim/build_ops.gd:890BuildOps.plan_electrifystatic funcOverhead wires over the track alongpts.Link zu diesem Eintragstatic func plan_electrify(m: WorldMap, pts: Array[Vector2i]) -> DictionaryTiles without track are skipped; wired ones are free. Extra keys: tiles (the tiles that get wires).
- Parameter
m: WorldMappts: Array[Vector2i]
- Rückgabewert
Dictionary
- Ruft auf
L.t
scripts/sim/build_ops.gd:966BuildOps.apply_electrifystatic funcLink zu diesem Eintragstatic func apply_electrify(m: WorldMap, p: Dictionary) -> void- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:984BuildOps.plan_depotstatic funcA depot on tilet, its door - and its one road or track connection - facingfacing.Link zu diesem Eintragstatic func plan_depot(m: WorldMap, kind: String, t: Vector2i, facing: int) -> DictionaryExtra keys: kind, tile, facing, link (joins the road/track in front), link_reason.
- Parameter
m: WorldMapkind: Stringt: Vector2ifacing: int
- Rückgabewert
Dictionary
scripts/sim/build_ops.gd:999BuildOps.apply_depotstatic funcLink zu diesem Eintragstatic func apply_depot(m: WorldMap, p: Dictionary, owner: Company) -> void- Parameter
m: WorldMapp: Dictionaryowner: Company
- Rückgabewert
void
- Ruft auf
Const.opp
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:1034BuildOps.tunnel_exitstatic funcWhere a tunnel from hillside tilea(headingd, its mouth at heightlevel) comes out: how many tiles on the far mouth is, at the first tile whose far edge comes back down tolevelat either corner.Link zu diesem Eintragstatic func tunnel_exit(m: WorldMap, a: Vector2i, d: int, level: int) -> int0 when the ground doesn't come down that far within MAX_TUNNEL tiles (or the map ends first).
- Parameter
m: WorldMapa: Vector2id: intlevel: int
- Rückgabewert
int
scripts/sim/build_ops.gd:1060BuildOps._edge_cornersstatic funcThe corners of the edge of tiletfacing directiond, in edge_heights' order.Link zu diesem Eintragstatic func _edge_corners(t: Vector2i, d: int) -> Array[Vector2i]- Parameter
t: Vector2id: int
- Rückgabewert
Array[Vector2i]
scripts/sim/build_ops.gd:1072BuildOps.plan_tunnelstatic funcA tunnel starting at hillside tilea(an incline rising straight ahead).Link zu diesem Eintragstatic func plan_tunnel(m: WorldMap, kind: String, a: Vector2i, hint: bool = true) -> DictionaryIt runs into the hill to the first tile where the ground comes back down to the entrance's height (tunnel_exit), and that tile is the far mouth. A hill seldom ends in a slope exactly like the one it started with - it comes down on a slant, or one corner sticks up - so the far mouth's tile is evened out into one, its corners lowered the way Level land lowers them (dragging the land around along). Extra keys as plan_bridge, plus corners (corner -> new height, evening out the far mouth: see apply_level) and trees (tiles that change shape and lose their trees).
hint: when there's no way out, look further up the slope for a hillside that has one.- Parameter
m: WorldMapkind: Stringa: Vector2ihint: bool = true
- Rückgabewert
Dictionary
scripts/sim/build_ops.gd:1088BuildOps._no_exitstatic funcplan_tunnel finding no way out: say so, on the entrance alone (not the whole line it looked along).Link zu diesem Eintragstatic func _no_exit(m: WorldMap, p: Dictionary, a: Vector2i, d: int, level: int, hint: bool) -> voidThe ground may come back down on the far side, only not as low as here: then a hillside further up the same slope, still on the way up (before the ground first levels off or falls), may well take a tunnel - when one does, say where.
- Parameter
m: WorldMapp: Dictionarya: Vector2id: intlevel: inthint: bool
- Rückgabewert
void
- Ruft auf
L.t,WorldMap.axis_of,L.n
scripts/sim/build_ops.gd:1162BuildOps._even_out_mouthstatic funcEven out tunnel tilet(headingd) into the far mouth: a straight incline fromlevel+ 1 on its near edge down tolevelon its far edge.Link zu diesem Eintragstatic func _even_out_mouth(m: WorldMap, p: Dictionary, t: Vector2i, d: int, level: int, keep: Array) -> voidAdds the corners that move, their cost and the trees they take to
p;keepare tiles that mustn't change shape.- Parameter
m: WorldMapp: Dictionaryt: Vector2id: intlevel: intkeep: Array
- Rückgabewert
void
scripts/sim/build_ops.gd:1189BuildOps._set_cornersstatic funcPut corner heights (corner -> height) on the map as they are, without redrawing anything.Link zu diesem Eintragstatic func _set_corners(m: WorldMap, corners: Dictionary) -> DictionaryReturns the heights they had, to put back the same way.
- Parameter
m: WorldMapcorners: Dictionary
- Rückgabewert
Dictionary
scripts/sim/build_ops.gd:1234BuildOps.apply_crossingstatic funcLink zu diesem Eintragstatic func apply_crossing(m: WorldMap, p: Dictionary) -> Dictionary- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:1243BuildOps.signal_problemstatic funcLink zu diesem Eintragstatic func signal_problem(m: WorldMap, t: Vector2i) -> String- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:1268BuildOps.plan_signalstatic funcPlace a two-way signal, or cycle an existing one: two-way -> one-way -> one-way the other way -> two-way.Link zu diesem Eintragstatic func plan_signal(m: WorldMap, t: Vector2i) -> DictionaryExtra keys: tile, state (see WorldMap.signals).
- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
Dictionary
scripts/sim/build_ops.gd:1288BuildOps.apply_signalstatic funcLink zu diesem Eintragstatic func apply_signal(m: WorldMap, p: Dictionary) -> void- Parameter
m: WorldMapp: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/build_ops.gd:1307BuildOps._corner_ofstatic func[a, b] ifbitsis a single corner piece, else [].Link zu diesem Eintragstatic func _corner_of(bits: int) -> Array- Parameter
bits: int
- Rückgabewert
Array
scripts/sim/build_ops.gd:1314BuildOps.signal_dirsstatic funcThe two directions trains can pass a signal on tilet(headings on entering the tile).Link zu diesem Eintragstatic func signal_dirs(m: WorldMap, t: Vector2i) -> Array- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
Array
- Ruft auf
Const.opp
scripts/sim/build_ops.gd:1323
Calendar
Calendar.MONTHSconstLink zu diesem Eintragconst MONTHS := ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/calendar.gd:4Calendar.MONTH_DAYSconstLink zu diesem Eintragconst MONTH_DAYS := [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/calendar.gd:5Calendar.is_leapstatic funcLink zu diesem Eintragstatic func is_leap(y: int) -> bool- Parameter
y: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/calendar.gd:8Calendar.year_daysstatic funcLink zu diesem Eintragstatic func year_days(y: int) -> int- Parameter
y: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/calendar.gd:12Calendar.from_daystatic funcReturns Vector3i(year, month 0-11, day of month 1-31).Link zu diesem Eintragstatic func from_day(day: int) -> Vector3i- Parameter
day: int
- Rückgabewert
Vector3i
scripts/core/calendar.gd:17Calendar.formatstatic funcLink zu diesem Eintragstatic func format(day: int) -> String- Parameter
day: int
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/calendar.gd:33Calendar.is_christmasstatic funcChristmas time in the towns: 1 December to 6 January.Link zu diesem Eintragstatic func is_christmas(day: int) -> bool- Parameter
day: int
- Rückgabewert
bool
scripts/core/calendar.gd:39Calendar.doy_is_christmasstatic funcThe same for a day of the year (0 = 1 January), ignoring leap years.Link zu diesem Eintragstatic func doy_is_christmas(doy: int) -> bool- Parameter
doy: int
- Rückgabewert
bool
scripts/core/calendar.gd:45Calendar.day_of_year_startstatic funcDay number of 1 January ofyear.Link zu diesem Eintragstatic func day_of_year_start(year: int) -> int- Parameter
year: int
- Rückgabewert
int
scripts/core/calendar.gd:50
ConnectPlanner
ConnectPlanner.MAX_DISTconsttiles apart (along the grid) beyond which it doesn't search at allConnectPlanner.ENDS_TRIEDconstsides of a joined end worth tryingConnectPlanner.PAIRSconst(start side, end side) pairs searched at mostConnectPlanner.LIVE_EXPANSIONSconstRouteBuilder's budget while the pointer moves (the click that builds searches with its own, larger one), so a search that finds nothing doesn't hold up the game.ConnectPlanner.SHORTCUT_SAVESconstA bridge or tunnel is taken over the cheapest way round when it saves at least SHORTCUT_SAVES tiles and SHORTCUT_SHARE of the line's length.Link zu diesem Eintragconst SHORTCUT_SAVES := 4In that search a crossing tile costs plain line plus SHORTCUT_PRICE of what it costs over that, and each crossing SHORTCUT_CROSSING tiles on top.
Deklariert inscripts/sim/connect_planner.gd:24ConnectPlanner.SHORTCUT_SHAREconstLink zu diesem Eintragconst SHORTCUT_SHARE := 0.3Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/connect_planner.gd:25ConnectPlanner.SHORTCUT_PRICEconstLink zu diesem Eintragconst SHORTCUT_PRICE := 0.25Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/connect_planner.gd:26ConnectPlanner.SHORTCUT_CROSSINGconstLink zu diesem Eintragconst SHORTCUT_CROSSING := 2.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/connect_planner.gd:27ConnectPlanner.pathstatic funcTiles fromatob(both included, each one next to the one before), or [] when no line was found within the search's budget; never over water or through a hill (see route for those).Link zu diesem Eintragstatic func path(m: WorldMap, kind: String, a: Vector2i, b: Vector2i, arriving: int = -1, max_expansions: int = 0, pairs_tried: int = PAIRS) -> Array[Vector2i]arriving: the way a line already reachesa(a waypoint), so this one carries on from it instead of doubling back (-1: none).max_expansions: RouteBuilder's budget (0: its own default, which grows with the distance; otherwise never more than that).pairs_tried: how many (start side, end side) pairs to try at most.- Parameter
m: WorldMapkind: Stringa: Vector2ib: Vector2iarriving: int = -1max_expansions: int = 0pairs_tried: int = PAIRS
- Rückgabewert
Array[Vector2i]
scripts/sim/connect_planner.gd:36ConnectPlanner.routestatic funcpath, with bridges and tunnels where the way needs them: {"tiles", "crossings": as RouteBuilder.last_crossings gives them}.Link zu diesem Eintragstatic func route(m: WorldMap, kind: String, a: Vector2i, b: Vector2i, year: int, arriving: int = -1, max_expansions: int = 0, pairs_tried: int = PAIRS) -> Dictionaryyear: the bridge styles there are by then (-1: no bridges or tunnels at all).- Parameter
m: WorldMapkind: Stringa: Vector2ib: Vector2iyear: intarriving: int = -1max_expansions: int = 0pairs_tried: int = PAIRS
- Rückgabewert
Dictionary
- Ruft auf
RouteBuilder.jumps_for
scripts/sim/connect_planner.gd:44ConnectPlanner._shortcutstatic funcjumps(RouteBuilder.jumps_for) with every crossing weighed mostly by its length: a span or tunnel tile costs little more than a tile of plain line, and a crossing little on top.Link zu diesem Eintragstatic func _shortcut(jumps: Dictionary) -> Dictionary- Parameter
jumps: Dictionary
- Rückgabewert
Dictionary
scripts/sim/connect_planner.gd:73ConnectPlanner._routestatic funcOne search withjumps, from the best sides of the ends: route's {"tiles", "crossings"}.Link zu diesem Eintragstatic func _route(m: WorldMap, kind: String, a: Vector2i, b: Vector2i, jumps: Dictionary, arriving: int, max_expansions: int, pairs_tried: int) -> Dictionary- Parameter
m: WorldMapkind: Stringa: Vector2ib: Vector2ijumps: Dictionaryarriving: intmax_expansions: intpairs_tried: int
- Rückgabewert
Dictionary
- Ruft auf
Const.opp,RouteBuilder.find
scripts/sim/connect_planner.gd:83ConnectPlanner.endsstatic funcWhere a search may start from endp(or, read backwards, finish at it), the other end being attoward: [{"tile", "dir": the way in (-1 any), "joined": true whenpitself is an existing piece the line joins from the free tile beside it}], best first.Link zu diesem Eintragstatic func ends(m: WorldMap, kind: String, p: Vector2i, toward: Vector2i) -> Array- Parameter
m: WorldMapkind: Stringp: Vector2itoward: Vector2i
- Rückgabewert
Array
scripts/sim/connect_planner.gd:129ConnectPlanner._takes_a_piecestatic funcWhether any piece of road or track at all (straight or a bend) could go on tilet.Link zu diesem Eintragstatic func _takes_a_piece(m: WorldMap, kind: String, t: Vector2i) -> bool- Parameter
m: WorldMapkind: Stringt: Vector2i
- Rückgabewert
bool
- Ruft auf
RouteBuilder._tile_cost
scripts/sim/connect_planner.gd:154ConnectPlanner._openstatic funcWhether a line ofkindcan be searched through tiletas it is: no building, station or depot on it, and no track already there for a railway (a road may run along a road).Link zu diesem Eintragstatic func _open(m: WorldMap, kind: String, t: Vector2i) -> bool- Parameter
m: WorldMapkind: Stringt: Vector2i
- Rückgabewert
bool
scripts/sim/connect_planner.gd:163
Const
Const.MAP_SIZEconstLink zu diesem Eintragconst MAP_SIZE := 128Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:4Const.CHUNKconstLink zu diesem Eintragconst CHUNK := 16Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:5Const.HEIGHT_STEPconstworld units per height levelConst.MAX_HEIGHTconstLink zu diesem Eintragconst MAX_HEIGHT := 10Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:7Const.WATER_Yconstwater surface height in world unitsConst.DAY_SECONDSconstreal seconds per game day at 1x (OpenTTD: 74 ticks x 30 ms = 2.22 s)Const.VEHICLE_PACEconstVehicles get this much done per game day - moving, loading, being serviced - so trips take fewer days while they move on screen exactly as fast as before the day got longer.Const.START_YEARconstLink zu diesem Eintragconst START_YEAR := 1950Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:14Const.DIRSconstLink zu diesem Eintragconst DIRS: Array[Vector2i] = [Vector2i(0, -1), Vector2i(1, 0), Vector2i(0, 1), Vector2i(-1, 0)]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:17Const.BITconstLink zu diesem Eintragconst BIT: Array[int] = [1, 2, 4, 8]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:18Const.AXIS_BITSconstLink zu diesem Eintragconst AXIS_BITS: Array[int] = [10, 5]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:20Const.oppstatic funcLink zu diesem Eintragstatic func opp(d: int) -> int- Parameter
d: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/constants.gd:23
Economy
Economy.PRODUCTION_DAYSconstproduction runs every this many daysEconomy.LATE_SPANconsta late cargo loses its fare, on average, at a rate that would take all of it over this many times its on-time daysEconomy.LATE_EARLYconstbelow 1 the S-curve starts falling sooner after the on-time days; 1 is a symmetric SEconomy.LATE_FLOORconstno delivery pays less than this share of the full fareEconomy.PAX_PER_POPconstpassengers per resident per monthEconomy.MAIL_PER_POPconstbags of mail per resident per monthEconomy.WASTE_PER_POPconsttonnes of waste per resident per month (from the Late century, RAIL-29)Economy.PER_POPconstLink zu diesem Eintragconst PER_POP := {"pax": PAX_PER_POP, "mail": MAIL_PER_POP, "waste": WASTE_PER_POP}Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:12Economy.MAX_WAITINGconstLink zu diesem Eintragconst MAX_WAITING := 3000.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:13Economy.GIVE_UPconsteach production run, cargo waiting beyond a month's worth loses this share times (1 - rating)Economy.INFLOW_EASEconsthow fast a station's estimate of its monthly inflow follows what arrives (per production run)Economy.STAFF_NEUTRALconststaffing at which an industry leans neither to growing nor shrinking (see staff_lean)Economy.STAFF_TILTconsthow far staff_lean moves the odds that a production change is a riseEconomy.PROD_MINconstthe least a mine, farm or well makes in a monthEconomy.paymentstatic funcPayment for deliveringamountof cargocoverdisttiles indaysdays.Link zu diesem Eintragstatic func payment(c: String, amount: float, dist: float, days: float) -> int- Parameter
c: Stringamount: floatdist: floatdays: float
- Rückgabewert
int
scripts/sim/economy.gd:22Economy.farestatic funcWhat one unit of cargocpays fordisttiles afterdayson the way.Link zu diesem Eintragstatic func fare(c: String, dist: float, days: float) -> floatFares don't change over the years: distance raises them in proportion, and lateness lowers them (see time_factor).
- Parameter
c: Stringdist: floatdays: float
- Rückgabewert
float
- Ruft auf
Data.cargo_rate
scripts/sim/economy.gd:28Economy.time_factorstatic funcShare of the full fare still paid afterdayson the way: all of it up to the cargo's own number of days, then easing down in a smooth S-curve (slowly at first, fastest half-way, slowly again at the end) to LATE_FLOOR, reached at 8 times that long (see LATE_SPAN).Link zu diesem Eintragstatic func time_factor(c: String, days: float) -> float- Parameter
c: Stringdays: float
- Rückgabewert
float
- Ruft auf
Data.cargo_days
scripts/sim/economy.gd:35Economy.late_loss_per_daystatic funcShare of the full fare lost, on average, for every day between the cargo's own number of days and the day it reaches the floor.Link zu diesem Eintragstatic func late_loss_per_day(c: String) -> floatIn the steep part of the curve it falls about twice as fast.
- Parameter
c: String
- Rückgabewert
float
- Ruft auf
Data.cargo_days
scripts/sim/economy.gd:44Economy.station_distancestatic funcLink zu diesem Eintragstatic func station_distance(a: Station, b: Station) -> float- Parameter
a: Stationb: Station
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:48Economy.producestatic funcLink zu diesem Eintragstatic func produce(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
Data.town_makes,Calendar.from_day
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:56Economy._linksstatic funcWhich stations reach which industries, both ways round: {"sts": Industry -> [Station], "inds": Station -> [Industry]}, each list in map order.Link zu diesem Eintragstatic func _links(m: WorldMap) -> DictionaryKept on the map and rebuilt only when a station's catchment changes or a station or industry comes or goes (never saved).
- Parameter
m: WorldMap
- Rückgabewert
Dictionary
scripts/sim/economy.gd:112Economy.industry_stationsstatic funcStations whose catchment touches any tile of the industry.Link zu diesem Eintragstatic func industry_stations(m: WorldMap, ind: Industry) -> Array- Parameter
m: WorldMapind: Industry
- Rückgabewert
Array
scripts/sim/economy.gd:142Economy._distributestatic funcGiveamtof cargo to the (up to two) best-rated stations that serve it.Link zu diesem Eintragstatic func _distribute(stations: Array, c: String, amt: float) -> floatReturns the amount moved.
- Parameter
stations: Arrayc: Stringamt: float
- Rückgabewert
float
scripts/sim/economy.gd:157Economy.shut_outstatic funcWhetherstgets no new cargo because another company holds exclusive transport rights in its town (a town request's reward, see Opportunities).Link zu diesem Eintragstatic func shut_out(st: Station) -> bool- Parameter
st: Station
- Rückgabewert
bool
scripts/sim/economy.gd:195Economy._update_ratingsstatic funcRatings drift toward a target set by pickup frequency, vehicle speed and waiting cargo.Link zu diesem Eintragstatic func _update_ratings(sim: Sim) -> voidThen cargo that has piled up gives up (see give_up).
- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/economy.gd:201Economy.give_upstatic funcCargocwaiting atstthat gives up this production run (RAIL-56): of what waits beyond a month's worth (Station.inflow), a share of GIVE_UP times what the rating falls short of 100%.Link zu diesem Eintragstatic func give_up(st: Station, c: String) -> floatAt 50% that is 3% every run, about a quarter a month; at 90%, 0.6%. A queue that fits the station's own trade is never touched, and every queue settles instead of filling to MAX_WAITING.
- Parameter
st: Stationc: String
- Rückgabewert
float
scripts/sim/economy.gd:234Economy._update_inflowstatic funcFold what came tostsince the last production run into its estimate of a month's inflow.Link zu diesem Eintragstatic func _update_inflow(st: Station) -> void- Parameter
st: Station
- Rückgabewert
void
scripts/sim/economy.gd:242Economy.unloadstatic funcUnload what this station accepts; pay the owner.Link zu diesem Eintragstatic func unload(sim: Sim, v: Vehicle, st: Station) -> intReturns units moved.
- Parameter
sim: Simv: Vehiclest: Station
- Rückgabewert
int
scripts/sim/economy.gd:256Economy.FEEDER_SHAREconstA feeder's share of the fare for cargo it leaves at a transfer stop: part of what the trip so far would pay, less what earlier feeders already showed.Link zu diesem Eintragconst FEEDER_SHARE := 0.75It only goes on the vehicle's books (its profit); the money comes when the cargo is delivered, so passing cargo back and forth earns nothing.
Deklariert inscripts/sim/economy.gd:324Economy.deliver_to_industriesstatic funcLink zu diesem Eintragstatic func deliver_to_industries(sim: Sim, st: Station, c: String, amount: int) -> void- Parameter
sim: Simst: Stationc: Stringamount: int
- Rückgabewert
void
- Ruft auf
IndustryLife.build
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:333Economy._full_setsstatic funcA plant that needs every input (Data.INDUSTRY "needs_all") holds what comes until the rest does:amountofcjoins its store, and every full set (one unit of each input) goes into the works.Link zu diesem Eintragstatic func _full_sets(ind: Industry, c: String, amount: float) -> floatReturns how many units go in, so each set makes as many units of output as it took in.
- Parameter
ind: Industryc: Stringamount: float
- Rückgabewert
float
scripts/sim/economy.gd:369Economy.hire_commutersstatic funcPassengers delivered tostgo to work at the industries it reaches (RAIL-28), each taking on what it still needs this month, in map order.Link zu diesem Eintragstatic func hire_commuters(m: WorldMap, st: Station, amount: float) -> floatReturns how many found work; the rest are ordinary passengers (the fare is the same either way).
- Parameter
m: WorldMapst: Stationamount: float
- Rückgabewert
float
scripts/sim/economy.gd:384Economy.reachesstatic funcWhetherst's catchment touchesind(from the cached links: nothing is copied).Link zu diesem Eintragstatic func reaches(m: WorldMap, st: Station, ind: Industry) -> bool- Parameter
m: WorldMapst: Stationind: Industry
- Rückgabewert
bool
scripts/sim/economy.gd:394Economy.industry_stations_reversestatic funcLink zu diesem Eintragstatic func industry_stations_reverse(m: WorldMap, st: Station) -> Array- Parameter
m: WorldMapst: Station
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:398Economy.monthlystatic funcLink zu diesem Eintragstatic func monthly(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:413Economy._charge_infrastructurestatic funcMonthly upkeep of everything companies own besides stations: track, overhead wires, signals, bridges and tunnels, and depots.Link zu diesem Eintragstatic func _charge_infrastructure(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
WorldMap.crossing_tiles
scripts/sim/economy.gd:446Economy._councilstatic funcCouncils like companies that serve their town and grow tired of neglected stations.Link zu diesem Eintragstatic func _council(sim: Sim, t: Town) -> void- Parameter
sim: Simt: Town
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/economy.gd:491Economy.staff_leanstatic funcHow staffing leans an industry's future (RAIL-28): from -STAFF_NEUTRAL with nobody at work to 1 - STAFF_NEUTRAL with a full staff, 0 at about what walkers-in from a nearby town give.Link zu diesem Eintragstatic func staff_lean(m: WorldMap, ind: Industry, index: Industry.StaffingIndex = null) -> float_maybe_change_production weighs it into growing or shrinking; closures (RAIL-23) can too.
- Parameter
m: WorldMapind: Industryindex: Industry.StaffingIndex = null
- Rückgabewert
float
scripts/sim/economy.gd:528Economy._maybe_change_productionstatic funcLink zu diesem Eintragstatic func _maybe_change_production(sim: Sim, ind: Industry, index: Industry.StaffingIndex) -> void- Parameter
sim: Simind: Industryindex: Industry.StaffingIndex
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/economy.gd:532
FirstSteps
FirstSteps.PAIR_DISTconsttiles apart a first bus route pays well over and costs little road forFirstSteps.PAIR_MINconstcloser than this, two towns are one place to a passengerFirstSteps.PAIR_FROMconstpairs are chosen among this many towns nearest the viewFirstSteps.CENTREconsttiles from a town's centre whose roads count as the town'sFirstSteps.town_pairstatic funcTwo towns neararound(a tile) that make a good first bus route: about PAIR_DIST apart, near the view, the bigger the better.Link zu diesem Eintragstatic func town_pair(m: WorldMap, around: Vector2) -> Array[Town, Town], or [] on a map with fewer than two towns.
- Parameter
m: WorldMaparound: Vector2
- Rückgabewert
Array
scripts/sim/first_steps.gd:15FirstSteps._fromstatic funcLink zu diesem Eintragstatic func _from(t: Town, p: Vector2) -> float- Parameter
t: Townp: Vector2
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/first_steps.gd:35FirstSteps.towns_joinedstatic funcWhether a road runs from the middle of townato the middle of townb.Link zu diesem Eintragstatic func towns_joined(m: WorldMap, a: Town, b: Town) -> bool- Parameter
m: WorldMapa: Townb: Town
- Rückgabewert
bool
- Ruft auf
Pathfinder.find
scripts/sim/first_steps.gd:40FirstSteps._centre_roadsstatic funcThe road tiles near a town's centre (its first crossroads is there), as a set.Link zu diesem Eintragstatic func _centre_roads(m: WorldMap, t: Town) -> Dictionary- Parameter
m: WorldMapt: Town
- Rückgabewert
Dictionary
scripts/sim/first_steps.gd:49FirstSteps.road_stopsstatic funcwho's road stops (a station with a road stop).Link zu diesem Eintragstatic func road_stops(m: WorldMap, who: Company) -> Array- Parameter
m: WorldMapwho: Company
- Rückgabewert
Array
scripts/sim/first_steps.gd:59FirstSteps.joined_stopsstatic funcTwo ofwho's road stops that a road joins, so a bus could run between them: [Station, Station], or [].Link zu diesem Eintragstatic func joined_stops(sim: Sim, who: Company) -> ArrayOne search per stop at most, each towards all the stops after it.
- Parameter
sim: Simwho: Company
- Rückgabewert
Array
scripts/sim/first_steps.gd:69FirstSteps.depot_readystatic funcWhether a new bus could leave forstnow: with depots in the rules, one ofwho's road depots must be joined to it.Link zu diesem Eintragstatic func depot_ready(sim: Sim, who: Company, st: Station) -> bool- Parameter
sim: Simwho: Companyst: Station
- Rückgabewert
bool
scripts/sim/first_steps.gd:87FirstSteps.route_vehiclestatic funcwho's newest vehicle that has a route (two stops or more), or null.Link zu diesem Eintragstatic func route_vehicle(sim: Sim, who: Company) -> Vehicle- Parameter
sim: Simwho: Company
- Rückgabewert
Vehicle
scripts/sim/first_steps.gd:92FirstSteps.has_stationstatic funcWhetherwhohas a station of any kind.Link zu diesem Eintragstatic func has_station(m: WorldMap, who: Company) -> bool- Parameter
m: WorldMapwho: Company
- Rückgabewert
bool
scripts/sim/first_steps.gd:101FirstSteps.town_linkstatic funcA vehicle ofwho's that carries passengers between stops in two different towns, or null.Link zu diesem Eintragstatic func town_link(sim: Sim, who: Company) -> Vehicle- Parameter
sim: Simwho: Company
- Rückgabewert
Vehicle
scripts/sim/first_steps.gd:109FirstSteps._takenstatic varcargo -> true: what some industry takes, in any era (industry_takes)FirstSteps.industry_takesstatic funcWhether cargocis something an industry takes in, in any era (so delivering it delivers to an industry).Link zu diesem Eintragstatic func industry_takes(c: String) -> bool- Parameter
c: String
- Rückgabewert
bool
- Ruft auf
Data.accepts
scripts/sim/first_steps.gd:128
Fmt
Fmt.int_commasstatic funcLink zu diesem Eintragstatic func int_commas(n: int) -> String- Parameter
n: int
- Rückgabewert
String
- Ruft auf
L.thousands
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/fmt.gd:5Fmt.moneystatic funcFormats an integer dollar amount with the active language’s digit grouping and currency placement.Link zu diesem Eintragstatic func money(n: int) -> StringThe result is a string for display.
- Parameter
n: int
- Rückgabewert
String
- Ruft auf
L.t
scripts/core/fmt.gd:15Fmt.cargo_liststatic funcLink zu diesem Eintragstatic func cargo_list(ids: Array) -> String- Parameter
ids: Array
- Rückgabewert
String
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/fmt.gd:19Fmt.short_moneystatic funcCompact money for chart axes and tiles: $950, $12k, $1.4M.Link zu diesem Eintragstatic func short_money(n: int) -> String- Parameter
n: int
- Rückgabewert
String
- Ruft auf
L.t
scripts/core/fmt.gd:27
Goals
Goals.STEPSconstThe checklist, in the order a company usually gets there: [id, title, how to do it].Goals.ACHIEVEMENTSconstAchievements:tiersgives one achievement per number ("<kind>_<number>"); the others are one each.Goals.KINDSconstLink zu diesem Eintragconst KINDS := ["road", "rail", "water", "air"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:42Goals.SERVED_DAYSconsta town counts as served while one of your stations there has picked up passengers this recentlyGoals.LEAGUE_AGEconstdays: a lead in the league counts once the company is this old (before, it isGoals.GOAL_IDSconstThe company goals a new game can set, and what each takes: a company value, or first place in the league, within so many years of the company's founding.Link zu diesem Eintragconst GOAL_IDS := ["none", "value_1m", "value_10m", "league"]Deklariert inscripts/sim/goals.gd:49Goals.GOALSconstLink zu diesem Eintragconst GOALSFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:50Goals.stepsvarstep id -> game day it was doneGoals.unlockedvarachievement id -> game day it was wonGoals.goal_resultvar"won" or "missed" once the company goal is decidedGoals.goal_dayvar...and the day it wasGoals.paxvarpassengers delivered, all closed months togetherGoals.deliveredvarcargo -> true: every cargo the company has deliveredGoals.revvargoes up whenever something is ticked off, won or missedGoals._station_idvarthe map's next station id at the last look (a new station since?)Goals._vehicle_idvarthe same for vehiclesGoals._pax_monthvarpassengers delivered this month at the last lookGoals._quietvarcatching up an old save: no newsGoals.check_stepsfuncTick off the first steps done since the last look.Link zu diesem Eintragfunc check_steps(sim: Sim) -> voidCheap: see the top of the file.
- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/goals.gd:72Goals._check_stepsfunccargo: what the company has delivered lately, cargo -> [units, $];rail_paid: a train has earned.Link zu diesem Eintragfunc _check_steps(sim: Sim, cargo: Dictionary, rail_paid: bool) -> void- Parameter
sim: Simcargo: Dictionaryrail_paid: bool
- Rückgabewert
void
- Ruft auf
FirstSteps.has_station,FirstSteps.route_vehicle,FirstSteps.town_link,FirstSteps.industry_takes
scripts/sim/goals.gd:80Goals._tickfuncLink zu diesem Eintragfunc _tick(sim: Sim, id: String) -> void- Parameter
sim: Simid: String
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:107Goals.step_titlestatic funcLink zu diesem Eintragstatic func step_title(id: String) -> String- Parameter
id: String
- Rückgabewert
String
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:116Goals.monthlyfuncMonth end (Sim._on_day, once the month's books are closed): the month in profit, the achievements and the company goal.Link zu diesem Eintragfunc monthly(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/goals.gd:127Goals._judgefuncLook at the figures again and unlock what they reach, then decide the goal if it is due.Link zu diesem Eintragfunc _judge(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/goals.gd:140Goals.operating_profitstatic funcA month's income less its running costs and upkeep (buying and building aside), as the company overview's chart counts it.Link zu diesem Eintragstatic func operating_profit(mo: Dictionary) -> int- Parameter
mo: Dictionary
- Rückgabewert
int
scripts/sim/goals.gd:151Goals.measurefuncThe figures the achievements and the goal are judged by: one pass over the vehicles and the stations, and the company value of each company for the league.Link zu diesem Eintragfunc measure(sim: Sim) -> Dictionarybestis the best rival's value;leads, whether the company is worth more than every rival and old enough to count.- Parameter
sim: Sim
- Rückgabewert
Dictionary
scripts/sim/goals.gd:158Goals.cargos_in_gamestatic funcThe cargos this map has now: passengers, mail (and from the Late century waste) from the towns, and what its industries make.Link zu diesem Eintragstatic func cargos_in_game(m: WorldMap) -> ArrayCargos whose industries haven't appeared yet (a later era's) aren't among them until one opens.
- Parameter
m: WorldMap
- Rückgabewert
Array
- Ruft auf
Data.town_makes
scripts/sim/goals.gd:190Goals.ids_ofstatic funcThe ids of an achievement's tiers (or its one id).Link zu diesem Eintragstatic func ids_of(a: Dictionary) -> Array- Parameter
a: Dictionary
- Rückgabewert
Array
scripts/sim/goals.gd:201Goals.reachedstatic funcWhether the figuresf(see measure) reach achievementid.Link zu diesem Eintragstatic func reached(id: String, f: Dictionary) -> bool- Parameter
id: Stringf: Dictionary
- Rückgabewert
bool
scripts/sim/goals.gd:208Goals.unlockfuncWin achievementidtoday (if it isn't already), with news.Link zu diesem Eintragfunc unlock(sim: Sim, id: String) -> void- Parameter
sim: Simid: String
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/goals.gd:219Goals.achievement_namestatic funcWhat an achievement is called: the tier's own name, or the achievement's.Link zu diesem Eintragstatic func achievement_name(id: String) -> String- Parameter
id: String
- Rückgabewert
String
- Ruft auf
L.t,Fmt.money,Fmt.int_commas
scripts/sim/goals.gd:228Goals.title_ofstatic funcAn achievement's heading in the Goals window.Link zu diesem Eintragstatic func title_of(kind: String) -> String- Parameter
kind: String
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/goals.gd:240Goals.goal_ofstatic funcLink zu diesem Eintragstatic func goal_of(sim: Sim) -> String- Parameter
sim: Sim
- Rückgabewert
String
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:255Goals.goal_namestatic funcWhat a goal asks, in a few words.Link zu diesem Eintragstatic func goal_name(id: String) -> String- Parameter
id: String
- Rückgabewert
String
scripts/sim/goals.gd:260Goals.goal_shortstatic funcThe same, short enough for the new-game screen's list.Link zu diesem Eintragstatic func goal_short(id: String) -> String- Parameter
id: String
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/goals.gd:270Goals.round_numberstatic funcA round number in few characters: 50, 100k, 10M.Link zu diesem Eintragstatic func round_number(n: int) -> String- Parameter
n: int
- Rückgabewert
String
scripts/sim/goals.gd:280Goals.deadlinestatic funcThe last day to reach the goal: so many years after the company was founded.Link zu diesem Eintragstatic func deadline(sim: Sim) -> int- Parameter
sim: Sim
- Rückgabewert
int
scripts/sim/goals.gd:289Goals.goal_metstatic funcWhether figuresf(see measure) meet the game's goal.Link zu diesem Eintragstatic func goal_met(sim: Sim, f: Dictionary) -> bool- Parameter
sim: Simf: Dictionary
- Rückgabewert
bool
scripts/sim/goals.gd:297Goals._check_goalfuncLink zu diesem Eintragfunc _check_goal(sim: Sim, f: Dictionary) -> void- Parameter
sim: Simf: Dictionary
- Rückgabewert
void
- Ruft auf
L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:306Goals._newsfuncLink zu diesem Eintragfunc _news(sim: Sim, text: String, kind: String = "good") -> void- Parameter
sim: Simtext: Stringkind: String = "good"
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:322Goals.to_dictfuncLink zu diesem Eintragfunc to_dict() -> Dictionary- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:329Goals.from_dictstatic funcLink zu diesem Eintragstatic func from_dict(d: Dictionary) -> Goals- Parameter
d: Dictionary
- Rückgabewert
Goals
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/goals.gd:334Goals.caught_upstatic funcA game saved before there were goals: tick off and unlock what it has done already, quietly, from what the save remembers (the last two years of deliveries, the last 24 months' books).Link zu diesem Eintragstatic func caught_up(sim: Sim) -> Goals- Parameter
sim: Sim
- Rückgabewert
Goals
scripts/sim/goals.gd:350
IndustryLife
IndustryLife.OPENS_A_YEARconstopenings a year for each industry the map started withIndustryLife.WARNS_A_YEARconstchance a year a struggling industry is warned (staff tilt it)IndustryLife.UNSERVED_MONTHSconstnobody has loaded its cargo for this long before it can struggleIndustryLife.FLOORconst...and it makes at most this share of its kind's usual outputIndustryLife.WARN_DAYSconsthow long before closing it is warnedIndustryLife.RESCUE_DAYSconsta pickup (or delivery) this recent lifts the warningIndustryLife.FADEconsta retiring mine loses this share of its output every yearIndustryLife.RENEWABLEconsthow much likelier a renewable kind is to open than its count saysIndustryLife.WIND_REACHconsttowns this close to a wind farm grow faster and thank its buildersIndustryLife.WIND_RATINGconstcouncil rating a builder gains, times its share of the deliveriesIndustryLife.WIND_GROWTHconst...and growth waits this share as long in a town near oneIndustryLife.monthlystatic funcLink zu diesem Eintragstatic func monthly(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
L.t,Economy.staff_lean
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/industry_life.gd:40IndustryLife.yearlystatic funcOnce a year: retiring mines make a little less.Link zu diesem Eintragstatic func yearly(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
Data.retiring
scripts/sim/industry_life.gd:72IndustryLife._roomstatic funcThe map's room for industries ashore and at sea (see Sim.industry_room).Link zu diesem Eintragstatic func _room(sim: Sim) -> Vector2i- Parameter
sim: Sim
- Rückgabewert
Vector2i
- Ruft auf
WorldGen.industry_room
scripts/sim/industry_life.gd:79IndustryLife.servedstatic funcWhether a company has loadedind's cargo at a station in its reach, or delivered cargo to it, within the lastdays.Link zu diesem Eintragstatic func served(sim: Sim, ind: Industry, days: float) -> bool- Parameter
sim: Simind: Industrydays: float
- Rückgabewert
bool
- Ruft auf
Economy.industry_stations
scripts/sim/industry_life.gd:89IndustryLife.strugglingstatic funcA primary industry at least UNSERVED_MONTHS old that nobody has served in that time, and whose output (staff included) is down to FLOOR of its kind's usual rate.Link zu diesem Eintragstatic func struggling(sim: Sim, ind: Industry, index: Industry.StaffingIndex = null) -> boolOne with nobody at work gets there at its usual rate (Industry.PRIMARY_MIN); one with a town at its gate only after a cut. A customer on its way out (a power station in the Green age) struggles once nobody has supplied it for that long.
- Parameter
sim: Simind: Industryindex: Industry.StaffingIndex = null
- Rückgabewert
bool
- Ruft auf
Data.retiring
scripts/sim/industry_life.gd:107IndustryLife.warnstatic funcTell everyoneindcloses in a year unless it is served by then.Link zu diesem Eintragstatic func warn(sim: Sim, ind: Industry) -> void- Parameter
sim: Simind: Industry
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/industry_life.gd:119IndustryLife.closing_textstatic funcThe day a struggling industry closes and what saves it, for its window and the Problems list.Link zu diesem Eintragstatic func closing_text(ind: Industry) -> String- Parameter
ind: Industry
- Rückgabewert
String
- Ruft auf
L.t,Calendar.format
scripts/sim/industry_life.gd:127IndustryLife.rescuestatic funcThe cargo that saves a struggling industry, in lower case: what it makes, carried away, or for a customer (a power station) what it takes, brought to it.Link zu diesem Eintragstatic func rescue(ind: Industry) -> String- Parameter
ind: Industry
- Rückgabewert
String
- Ruft auf
L.lower,Fmt.cargo_list
scripts/sim/industry_life.gd:135IndustryLife.closestatic funcTakeindoff the map: its tiles, an oil rig's own dock, what the stations around it accept and supply, the rivals' routes that served it, and the subsidies about it (Opportunities).Link zu diesem Eintragstatic func close(sim: Sim, ind: Industry) -> void- Parameter
sim: Simind: Industry
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/industry_life.gd:141IndustryLife._pick_typestatic funcWhich kind opens: weighed by how common each is on a new map, among those of this era that the map has room for.Link zu diesem Eintragstatic func _pick_type(sim: Sim) -> StringKinds on their way out open no more, and from the era that retires the old ones (the Green age) the new kinds that take their place (wind farm sites) are favoured.
- Parameter
sim: Sim
- Rückgabewert
String
- Ruft auf
Data.opens,Data.retiring
scripts/sim/industry_life.gd:169IndustryLife._renewablestatic funcA kind that comes with the era that retires others (the Green age's wind farm sites).Link zu diesem Eintragstatic func _renewable(type: String) -> bool- Parameter
type: String
- Rückgabewert
bool
scripts/sim/industry_life.gd:191IndustryLife._introducestatic funcThe kinds of a later era, once it has come, that the map has fewer of than a new map would get each open one more this month (at the era's start, or in a game saved before it had them).Link zu diesem Eintragstatic func _introduce(sim: Sim) -> voidA kind made from another (a wind farm from its site) counts with it. Where no site turns up, the next try waits a year (Sim.introduce_wait).
- Parameter
sim: Sim
- Rückgabewert
void
- Ruft auf
Data.opens,WorldGen.type_count
scripts/sim/industry_life.gd:205IndustryLife._made_fromstatic funcThe kind an industry oftypewas before it was finished (a wind farm: its site), ortype.Link zu diesem Eintragstatic func _made_from(type: String) -> String- Parameter
type: String
- Rückgabewert
String
scripts/sim/industry_life.gd:221IndustryLife.buildstatic funcamountofcdelivered to a construction site (Data.INDUSTRY "builds") bywho: it counts towards the site's totals, and once they are all in the site becomes what it was building.Link zu diesem Eintragstatic func build(sim: Sim, ind: Industry, c: String, amount: float, who: Company) -> void- Parameter
sim: Simind: Industryc: Stringamount: floatwho: Company
- Rückgabewert
void
scripts/sim/industry_life.gd:232IndustryLife.finishstatic funcA site has all it needs: it becomes a wind farm.Link zu diesem Eintragstatic func finish(sim: Sim, ind: Industry) -> voidIts builders gain standing with the councils of the towns around it, in proportion to what each delivered, and the stations around it stop taking what it took.
- Parameter
sim: Simind: Industry
- Rückgabewert
void
- Ruft auf
WorldGen.industry_name,L.t
scripts/sim/industry_life.gd:243IndustryLife.near_wind_farmstatic funcWhether a wind farm stands within WIND_REACH of townt(it grows faster: see Sim).Link zu diesem Eintragstatic func near_wind_farm(m: WorldMap, t: Town) -> bool- Parameter
m: WorldMapt: Town
- Rückgabewert
bool
scripts/sim/industry_life.gd:270IndustryLife.openstatic funcOpen an industry oftypewhere WorldGen would put one, on ground where nothing is built.Link zu diesem Eintragstatic func open(sim: Sim, type: String) -> IndustryReturns it, or null when there is no such site (or a ship is on its way through the one found).
- Parameter
sim: Simtype: String
- Rückgabewert
Industry
- Ruft auf
WorldGen.find_site,WorldGen.spacing,WorldGen.unserved_feeders,WorldGen.put_industry,WorldGen.industry_name,BuildOps.add_rig_dock,WorldGen.level_ground,L.t,L.lower
scripts/sim/industry_life.gd:280IndustryLife._ships_throughstatic funcWhether a ship's course runs throughr(an oil rig opening there would stand in its way).Link zu diesem Eintragstatic func _ships_through(sim: Sim, r: Rect2i) -> bool- Parameter
sim: Simr: Rect2i
- Rückgabewert
bool
scripts/sim/industry_life.gd:312IndustryLife._changedstatic funcAfter an industry came or went insider: stations around it look again at what they accept and supply, and everything made from the list of industries is made again (WorldMap.industry_rev).Link zu diesem Eintragstatic func _changed(sim: Sim, r: Rect2i) -> void- Parameter
sim: Simr: Rect2i
- Rückgabewert
void
scripts/sim/industry_life.gd:323
L
L.DIRSconstLink zu diesem Eintragconst DIRS := ["res://lang", "user://lang"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:18L.FALLBACKconstLink zu diesem Eintragconst FALLBACK := "en"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:19L.ELIDE_DEconstLanguages where "de" before a vowel is written "d'" (see tidy).L.KEEP_CASEconstLanguages whose nouns keep their capital in mid-sentence (see lower).L.langstatic varLink zu diesem Eintragstatic var lang := "en"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:25L._tablesstatic varlanguage code -> {english: translated}L._tablestatic varthe current language's tableL._loadedstatic varLink zu diesem Eintragstatic var _loaded := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:28L._registeredstatic varlanguage code -> Translation given to the TranslationServerL.missesstatic varSet to a dictionary to collect every text looked up that has no translation (for tools/i18n_report).L._miss_mutexstatic varLink zu diesem Eintragstatic var _miss_mutex := Mutex.new()Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:32L._guardedstatic varLink zu diesem Eintragstatic var _guarded := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:33L._elidestatic varLink zu diesem Eintragstatic var _elide: RegEx = nullFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:34L.tstatic funcThe text in the current language.Link zu diesem Eintragstatic func t(s: String) -> String- Parameter
s: String
- Rückgabewert
String
scripts/core/l.gd:58L.tidystatic funcSmooth text assembled from pieces, where a name was dropped into a translated sentence.Link zu diesem Eintragstatic func tidy(s: String) -> StringCatalan and French write "de" as "d'" before a vowel: "Mina de carbó de Elmley" -> "Mina de carbó d'Elmley", "Mine de charbon de Ashford" -> "Mine de charbon d'Ashford". (Not before h: these are English-style names, where the h is sounded.)
- Parameter
s: String
- Rückgabewert
String
scripts/core/l.gd:75L.lowerstatic funcA name (cargo, building...) in lower case for use mid-sentence - except in German, where nouns keep their capital: "Takes coal", "Nimmt Kohle".Link zu diesem Eintragstatic func lower(s: String) -> String- Parameter
s: String
- Rückgabewert
String
scripts/core/l.gd:86L.nstatic func"1 tile" / "7 tiles":oneis used for exactly one,many(with a %d) otherwise.Link zu diesem Eintragstatic func n(one: String, many: String, count: int) -> String- Parameter
one: Stringmany: Stringcount: int
- Rückgabewert
String
scripts/core/l.gd:91L.eachstatic funcA list of names in the current language, e.g.Link zu diesem Eintragstatic func each(items: Array) -> PackedStringArraycargo names from the data tables.
- Parameter
items: Array
- Rückgabewert
PackedStringArray
scripts/core/l.gd:98L.load_allstatic funcRead every language file.Link zu diesem Eintragstatic func load_all(extra_dirs: Array = []) -> voidLater directories (the player's own, then mods) override earlier ones.
- Parameter
extra_dirs: Array = []
- Rückgabewert
void
scripts/core/l.gd:106L.load_filestatic funcParse one language file into the tables.Link zu diesem Eintragstatic func load_file(path: String) -> intReturns the number of translations read.
- Parameter
path: String
- Rückgabewert
int
scripts/core/l.gd:122L._unquotestatic funcText that starts or ends with a space is written in double quotes: > "Tip: "Link zu diesem Eintragstatic func _unquote(s: String) -> String- Parameter
s: String
- Rückgabewert
String
scripts/core/l.gd:148L.languagesstatic funcLanguages the player can pick: [[code, name in that language]], English first.Link zu diesem Eintragstatic func languages() -> Array- Rückgabewert
Array
scripts/core/l.gd:155L.system_languagestatic funcThe language to use for a setting of "auto": the system's, if we have it.Link zu diesem Eintragstatic func system_language() -> String- Rückgabewert
String
scripts/core/l.gd:168L.set_languagestatic funcSwitch language.Link zu diesem Eintragstatic func set_language(code: String) -> void"auto" follows the system.
- Parameter
code: String
- Rückgabewert
void
scripts/core/l.gd:176L.releasestatic funcTake our translations back out of the TranslationServer (see _Guard).Link zu diesem Eintragstatic func release() -> void- Rückgabewert
void
scripts/core/l.gd:195L.thousandsstatic funcHow thousands are grouped: 1,234 in English, 1.234 in most others, 1 234 in French.Link zu diesem Eintragstatic func thousands() -> String- Rückgabewert
String
scripts/core/l.gd:203L._guardstatic funcLink zu diesem Eintragstatic func _guard() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/l.gd:207
Line
Line.COLORSconstLink zu diesem Eintragconst COLORSFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:11Line.idvarLink zu diesem Eintragvar id := 0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:14Line.namevarLink zu diesem Eintragvar name := ""Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:15Line.colorvarLink zu diesem Eintragvar color := Color.WHITEFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:16Line.kindvarLink zu diesem Eintragvar kind := "road"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:17Line.ownervarLink zu diesem Eintragvar owner: CompanyFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:18Line.ordersvar[{"st": Station, "full": bool, "transfer": bool}], shared with every vehicle on itLine.spacingvarKeep the vehicles evenly spread round the line: each one waits at the first stop until the one before it is a fair share of a round trip ahead.Line.lap_daysvara round trip, on average (days); -1 until one has been timedLine.last_departurevargame day a vehicle of the line last left the first stopLine._initfuncLink zu diesem Eintragfunc _init(p_id: int = 0, p_name: String = "", p_kind: String = "road", p_owner: Company = null) -> void- Parameter
p_id: int = 0p_name: String = ""p_kind: String = "road"p_owner: Company = null
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/line.gd:27Line.stopsfuncReturns the station objects in the order vehicles visit them on this line.Line.vehiclesfuncThe vehicles on this line, in the order they were bought.Link zu diesem Eintragfunc vehicles(sim: Sim) -> Array- Parameter
sim: Sim
- Rückgabewert
Array
scripts/sim/line.gd:40Line.gapfuncThe gap (in days) the vehicles should keep at the first stop: a round trip shared out amongnof them.Link zu diesem Eintragfunc gap(n: int) -> float0 when there is nothing to keep apart, or no round trip timed yet.
- Parameter
n: int
- Rückgabewert
float
scripts/sim/line.gd:46Line.note_departurefuncA vehicle of this line just left the first stop;lapis how long it took to come round since it last left it (-1 the first time).Link zu diesem Eintragfunc note_departure(day: float, lap: float) -> void- Parameter
day: floatlap: float
- Rückgabewert
void
scripts/sim/line.gd:54Line.route_textfuncA route in a few words: "Ashford → Millbury".Link zu diesem Eintragfunc route_text() -> String- Rückgabewert
String
scripts/sim/line.gd:61Line.totalsfuncThe line's numbers, added up over its vehicles: {"count", "profit", "last", "load" (-1 when none known), "running", "old", "stopped"}.Link zu diesem Eintragfunc totals(sim: Sim) -> Dictionary- Parameter
sim: Sim
- Rückgabewert
Dictionary
scripts/sim/line.gd:73
Mods
Mods.DIRSconstLink zu diesem Eintragconst DIRS := ["res://mods", "user://mods"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:14Mods.USER_DIRconstLink zu diesem Eintragconst USER_DIR := "user://mods"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:15Mods.UNPACKEDconstLink zu diesem Eintragconst UNPACKED := "user://mods/.unpacked"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:16Mods.SAMPLES_ZIPconstAn exported game can't hold the samples' folder as it is (the editor skips it: see mods/.gdignore), so tools/release.sh packs it into this zip, which is unpacked to SAMPLES whenever it changes.Link zu diesem Eintragconst SAMPLES_ZIP := "res://sample_mods.zip"Deklariert inscripts/core/mods.gd:19Mods.SAMPLESconstLink zu diesem Eintragconst SAMPLES := "user://mods/.samples"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:20Mods.KINDSconstLink zu diesem Eintragconst KINDS := ["rail", "road", "water", "air"]Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:21Mods.foundstatic varEvery mod found: {"id", "name", "version", "author", "description", "path", "builtin", "has": {"data", "lang", "maps", "models", "script"}, "enabled", "error"}.Mods.scriptsstatic varlive Mod instances of the enabled script modsMods.mapsstatic varMaps offered in New game: {"name", "description", "heightmap", "params", "mod"}.Mods._meshesstatic varmodel id -> ArrayMesh loaded from a mod's .glbMods._appliedstatic varLink zu diesem Eintragstatic var _applied := falseFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:30Mods.log_linesstatic varwhat went wrong, for the Mods screenMods.scanstatic funcLook through the mod folders.Link zu diesem Eintragstatic func scan() -> voidZips in the player's folder are unpacked first.
- Rückgabewert
void
scripts/core/mods.gd:37Mods.read_infostatic funcRead a mod folder's mod.json.Link zu diesem Eintragstatic func read_info(path: String) -> DictionaryReturns {} if it isn't a mod (with a note in the log if it tried to be).
- Parameter
path: String
- Rückgabewert
Dictionary
scripts/core/mods.gd:72Mods._unpack_zipsstatic funcA .zip dropped in the mods folder is unpacked next to the others (once per version of the file).Link zu diesem Eintragstatic func _unpack_zips() -> void- Rückgabewert
void
scripts/core/mods.gd:102Mods._unpack_samplesstatic funcUnpack the samples that ship in an exported game (once per version of them).Link zu diesem Eintragstatic func _unpack_samples() -> boolFalse if that failed.
- Rückgabewert
bool
scripts/core/mods.gd:143Mods._remove_treestatic funcLink zu diesem Eintragstatic func _remove_tree(path: String) -> void- Parameter
path: String
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:172Mods._notestatic funcLink zu diesem Eintragstatic func _note(line: String) -> void- Parameter
line: String
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:184Mods.enabledstatic funcLink zu diesem Eintragstatic func enabled() -> Array- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:189Mods.by_idstatic funcLink zu diesem Eintragstatic func by_id(id: String) -> Dictionary- Parameter
id: String
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:193Mods.set_enabledstatic funcSwitch a mod on or off and rebuild what mods add.Link zu diesem Eintragstatic func set_enabled(id: String, on: bool) -> voidRemembered in the settings.
- Parameter
id: Stringon: bool
- Rückgabewert
void
scripts/core/mods.gd:201Mods.applystatic funcRebuild everything the enabled mods add.Link zu diesem Eintragstatic func apply(rescan: bool = true) -> voidSafe to call again: it starts from the plain game.
- Parameter
rescan: bool = true
- Rückgabewert
void
- Ruft auf
Data.clear_mods,L.load_all,L.set_language
scripts/core/mods.gd:214Mods._apply_onestatic funcLink zu diesem Eintragstatic func _apply_one(m: Dictionary) -> String- Parameter
m: Dictionary
- Rückgabewert
String
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:241Mods._apply_datastatic funcCheck and merge one mod's data.json.Link zu diesem Eintragstatic func _apply_data(m: Dictionary, d: Dictionary) -> StringReturns "" or what's wrong (nothing is added then).
- Parameter
m: Dictionaryd: Dictionary
- Rückgabewert
String
scripts/core/mods.gd:265Mods._collect_mapsstatic funcmaps/NAME.png, with an optional maps/NAME.json: {"name", "description", "settings": {...}} where settings are new-game parameters (w, h, towns, industries, year, ...).Link zu diesem Eintragstatic func _collect_maps(m: Dictionary) -> void- Parameter
m: Dictionary
- Rückgabewert
void
scripts/core/mods.gd:333Mods.vehicle_meshstatic funcThe mesh a mod supplies for a vehicle model (from its .glb), or null to use the game's own.Link zu diesem Eintragstatic func vehicle_mesh(model_id: String) -> ArrayMeshThe mesh keeps the materials it was made with.
- Parameter
model_id: String
- Rückgabewert
ArrayMesh
- Ruft auf
Data.model,Data.has_model
scripts/core/mods.gd:364Mods.load_glbstatic funcRead a .glb / .gltf into one mesh (every mesh in the file, in place, with its materials).Link zu diesem Eintragstatic func load_glb(file: String) -> ArrayMeshConvention, as for the game's own models: the vehicle faces -Z, stands on y = 0, centred.
- Parameter
file: String
- Rückgabewert
ArrayMesh
scripts/core/mods.gd:379Mods._merge_meshesstatic funcLink zu diesem Eintragstatic func _merge_meshes(n: Node, xf: Transform3D, out: ArrayMesh) -> void- Parameter
n: Nodexf: Transform3Dout: ArrayMesh
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/core/mods.gd:393Mods.hookstatic funcCall a hook on every enabled script mod.Link zu diesem Eintragstatic func hook(method: String, args: Array = []) -> voidA mod whose hook fails is reported, not fatal.
- Parameter
method: Stringargs: Array = []
- Rückgabewert
void
scripts/core/mods.gd:424Mods.allow_newsstatic funcNews goes out unless a mod's _on_news returns false.Link zu diesem Eintragstatic func allow_news(sim: Sim, item: Dictionary) -> bool- Parameter
sim: Simitem: Dictionary
- Rückgabewert
bool
scripts/core/mods.gd:430Mods.save_statestatic funcWhat goes into a saved game: which mods were on, and each script mod's own data.Link zu diesem Eintragstatic func save_state(sim: Sim) -> Dictionary- Parameter
sim: Sim
- Rückgabewert
Dictionary
scripts/core/mods.gd:438Mods.load_statestatic funcAfter loading a game: hand script mods their data, and return the mods the save was made with that aren't on now (names, for a warning).Link zu diesem Eintragstatic func load_state(sim: Sim, state: Dictionary) -> Array- Parameter
sim: Simstate: Dictionary
- Rückgabewert
Array
scripts/core/mods.gd:451
Opportunities
Opportunities.MAX_SUBSIDIESconstFew at once, and seldom (a new one of each kind every eight months or so): each is news, and a stream of them buries the player's own (RAIL-78).Link zu diesem Eintragconst MAX_SUBSIDIES := 2subsidies on offer at once (won ones aside)
Deklariert inscripts/sim/opportunities.gd:44Opportunities.MAX_REQUESTSconsttown requests open on the map at onceOpportunities.OFFER_CHANCEconstchance a month of a new subsidy while there is room, and the same for a requestOpportunities.DAY_CHANCEconst...as a chance a day (daily), so that over a month it comes to OFFER_CHANCE.Link zu diesem Eintragconst DAY_CHANCE := 1.0 - pow(1.0 - OFFER_CHANCE, 1.0 / 30.0)Deklariert inscripts/sim/opportunities.gd:48Opportunities.TRIESconstsources (or towns) tried for a new offerOpportunities.SUBSIDY_MINconsttiles between the ends of a subsidised route (along the axes)Opportunities.SUBSIDY_MAXconstLink zu diesem Eintragconst SUBSIDY_MAX := 60Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:51Opportunities.SUBSIDY_DAYSconstan offer nobody takes lapses after this longOpportunities.SUBSIDY_MULTconstthe winner's fares on the route...Opportunities.SUBSIDY_YEARSconst...for this longOpportunities.UNSERVED_DAYSconsta source whose cargo was loaded this recently is served alreadyOpportunities.TOWN_CARGOconstwhat every town takes besides passengers and mail (Station.coverage)Link zu diesem Eintragconst TOWN_CARGO := ["goods", "food"]Deklariert inscripts/sim/opportunities.gd:56Opportunities.TOWN_TAKES_POPconsta town this big takes them (a station in its centre reaches 60 people)Opportunities.LINK_POPconsta town this big asks for passenger links...Opportunities.LINK_TO_POPconst...to a town at least this bigOpportunities.RAIL_POPconsttwo towns this big may want the link by railOpportunities.SUPPLY_PER_POPconsta supply asks this many units a resident a month of its timeOpportunities.VISITORS_PER_POPconst...and visitors as manyOpportunities.SERVICE_RATINGconsta service request: every station rated this or more...Opportunities.SERVICE_MONTHSconst...this many month ends in a row...Opportunities.SERVICE_DEADLINEconst...within this many monthsOpportunities.REQUEST_MONTHSconstthe time other requests giveLink zu diesem Eintragconst REQUEST_MONTHS := Vector2i(6, 18)Deklariert inscripts/sim/opportunities.gd:66Opportunities.REWARDSconstThe rewards that fit each request; one is chosen when it is made.Link zu diesem Eintragconst REWARDSExclusive rights take a new link: good service alone, which rivals' stations give without trying, doesn't shut the others out.
Deklariert inscripts/sim/opportunities.gd:69Opportunities.RATING_BOOSTconstLink zu diesem Eintragconst RATING_BOOST := 25.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:71Opportunities.GRANTconstLink zu diesem Eintragconst GRANT := 50000Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:72Opportunities.RIGHTS_DAYSconstexclusive rights and half-price stations last this longOpportunities.CHEAPconstwhat stations and depots cost thenOpportunities.BOOM_DAYSconsta growth reward: fast growth this long (as Fund buildings)Opportunities.offersvarLink zu diesem Eintragvar offers: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:77Opportunities.rngvarIts own random numbers (seeded by Sim from the game's seed, saved), so offers don't reshuffle the rest of the game's.Link zu diesem Eintragvar rng := RandomNumberGenerator.new()Deklariert inscripts/sim/opportunities.gd:80Opportunities.revvargoes up whenever something is offered, won, met, lapses or makes progressOpportunities.on_deliveryfuncamtunits ofcloaded atfrom(null when that station is gone) delivered byvatst: wins and progress.Link zu diesem Eintragfunc on_delivery(sim: Sim, v: Vehicle, from: Station, st: Station, c: String, amt: int) -> floatReturns what the fare is multiplied by (a won subsidy's SUBSIDY_MULT, else 1).
- Parameter
sim: Simv: Vehiclefrom: Stationst: Stationc: Stringamt: int
- Rückgabewert
float
scripts/sim/opportunities.gd:88Opportunities._reachesstatic funcWhether stationstreachesplace: an industry in its catchment, or a town it belongs to.Link zu diesem Eintragstatic func _reaches(m: WorldMap, st: Station, place: Object) -> bool- Parameter
m: WorldMapst: Stationplace: Object
- Rückgabewert
bool
- Ruft auf
Economy.reaches
scripts/sim/opportunities.gd:117Opportunities._joinsstatic funcLink zu diesem Eintragstatic func _joins(o: Dictionary, a: Town, b: Town) -> bool- Parameter
o: Dictionarya: Townb: Town
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:123Opportunities._win_subsidyfuncLink zu diesem Eintragfunc _win_subsidy(sim: Sim, o: Dictionary, who: Company) -> void- Parameter
sim: Simo: Dictionarywho: Company
- Rückgabewert
void
- Ruft auf
L.t,Calendar.format
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:127Opportunities._metfuncRequestkis met bywho: its reward, news, and it leaves the list.Link zu diesem Eintragfunc _met(sim: Sim, k: int, who: Company) -> void- Parameter
sim: Simk: intwho: Company
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/opportunities.gd:139Opportunities.monthlyfuncMonth end (Sim._on_day, after the industries' month): service months and rights that end.Link zu diesem Eintragfunc monthly(sim: Sim) -> voidThen what lapses, as every day.
- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/opportunities.gd:169Opportunities.dailyfuncEvery day (Sim._on_day): offers that lapse or end that day, and now and then a new subsidy or a new request while there is room, so news of them comes at any time of the month.Link zu diesem Eintragfunc daily(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/opportunities.gd:187Opportunities._lapsefuncTakes off the offers whose day has come, with news; a service request only at the month end (month_end), once its last month is counted.Link zu diesem Eintragfunc _lapse(sim: Sim, month_end: bool) -> Vector2iReturns how many subsidies (x) and requests (y) are still open.
- Parameter
sim: Simmonth_end: bool
- Rückgabewert
Vector2i
- Ruft auf
L.t
scripts/sim/opportunities.gd:198Opportunities._count_servicefuncOne more month for each company whose stations in the town are all rated SERVICE_RATING or more (it needs one at least); back to none for the others.Link zu diesem Eintragfunc _count_service(sim: Sim, o: Dictionary) -> void- Parameter
sim: Simo: Dictionary
- Rückgabewert
void
scripts/sim/opportunities.gd:231Opportunities._leaderstatic funcThe company furthest on with a request (-1: nobody has started).Link zu diesem Eintragstatic func _leader(o: Dictionary) -> int- Parameter
o: Dictionary
- Rückgabewert
int
scripts/sim/opportunities.gd:251Opportunities.industry_closedfuncAn industry closes (IndustryLife.close): offers about it are withdrawn, and a won subsidy ends.Link zu diesem Eintragfunc industry_closed(sim: Sim, ind: Industry) -> void- Parameter
sim: Simind: Industry
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/opportunities.gd:260Opportunities.offer_subsidyfuncOffer a subsidy for a route nobody serves yet, if one turns up in a few tries: a cargo an industry makes (or, from the Late century, the waste a town makes: Data.town_makes) that nobody loads there, to a place in reach that takes it.Link zu diesem Eintragfunc offer_subsidy(sim: Sim) -> DictionaryReturns it, or {}.
- Parameter
sim: Sim
- Rückgabewert
Dictionary
scripts/sim/opportunities.gd:276Opportunities.pos_ofstatic funcWhere an industry or a town is: its middle.Link zu diesem Eintragstatic func pos_of(place: Object) -> Vector2- Parameter
place: Object
- Rückgabewert
Vector2
scripts/sim/opportunities.gd:324Opportunities.offer_requestfuncAsk for something from a town without a request, if one in a few tries can ask for anything: the bigger the town, the likelier it is to ask.Link zu diesem Eintragfunc offer_request(sim: Sim) -> DictionaryReturns the request, or {}.
- Parameter
sim: Sim
- Rückgabewert
Dictionary
- Ruft auf
Goals.cargos_in_game
scripts/sim/opportunities.gd:330Opportunities.request_kindsfuncWhat towntcould ask for: links when it is big, supplies when it takes goods or food and the map makes some (have: Goals.cargos_in_game), visitors when it has an attraction, service when some company has a station there.Link zu diesem Eintragfunc request_kinds(sim: Sim, t: Town, have: Array) -> Array- Parameter
sim: Simt: Townhave: Array
- Rückgabewert
Array
scripts/sim/opportunities.gd:359Opportunities.make_requestfuncMake a request oftypefrom townt(see request_kinds), with news.Link zu diesem Eintragfunc make_request(sim: Sim, t: Town, type: String, have: Array) -> Dictionary{} when there is nothing to ask for after all (a link with no town in reach that isn't linked already).
- Parameter
sim: Simt: Towntype: Stringhave: Array
- Rückgabewert
Dictionary
- Ruft auf
L.t,Calendar.format
scripts/sim/opportunities.gd:376Opportunities._link_partnerfuncA town for a link fromt: SUBSIDY_MIN..SUBSIDY_MAX tiles away, at least LINK_TO_POP people, and no passenger vehicle of anyone's calling at both yet.Link zu diesem Eintragfunc _link_partner(sim: Sim, t: Town) -> TownNull when there is none.
- Parameter
sim: Simt: Town
- Rückgabewert
Town
scripts/sim/opportunities.gd:412Opportunities._offerfuncLink zu diesem Eintragfunc _offer(sim: Sim, type: String, cargo: String, expires: int) -> Dictionary- Parameter
sim: Simtype: Stringcargo: Stringexpires: int
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:434Opportunities._offeredfuncWhether an industry or a town is the source of a subsidy already.Link zu diesem Eintragfunc _offered(place: Object) -> bool- Parameter
place: Object
- Rückgabewert
bool
scripts/sim/opportunities.gd:443Opportunities._in_rangestatic funcLink zu diesem Eintragstatic func _in_range(a: Vector2, b: Vector2) -> bool- Parameter
a: Vector2b: Vector2
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:447Opportunities._roundstatic funcA target in round numbers: to the nearest 50, at least 100.Link zu diesem Eintragstatic func _round(n: float) -> int- Parameter
n: float
- Rückgabewert
int
scripts/sim/opportunities.gd:453Opportunities.attractions_ofstatic funcThe attractions townthas, as Data.HOUSES types.Link zu diesem Eintragstatic func attractions_of(t: Town) -> Array- Parameter
t: Town
- Rückgabewert
Array
scripts/sim/opportunities.gd:458Opportunities.request_offuncThe request townthas open, or {}.Link zu diesem Eintragfunc request_of(t: Town) -> Dictionary- Parameter
t: Town
- Rückgabewert
Dictionary
scripts/sim/opportunities.gd:463Opportunities.whatstatic funcWhat an offer asks, in a few words, as it reads mid-sentence: "coal from Ashford Mine to Elmford Power Station", "300 food for Elmford" (titlefor the start of one).Link zu diesem Eintragstatic func what(o: Dictionary) -> String- Parameter
o: Dictionary
- Rückgabewert
String
- Ruft auf
L.t,L.lower,Fmt.int_commas
scripts/sim/opportunities.gd:474Opportunities.titlestatic funcwhat, starting with a capital: a heading.Link zu diesem Eintragstatic func title(o: Dictionary) -> String- Parameter
o: Dictionary
- Rückgabewert
String
scripts/sim/opportunities.gd:488Opportunities.reward_namestatic funcWhat meeting a request brings, in a few words ("a grant of $50,000").Link zu diesem Eintragstatic func reward_name(reward: String) -> String- Parameter
reward: String
- Rückgabewert
String
scripts/sim/opportunities.gd:494Opportunities.placestatic funcWhere an offer is, for the map: the middle of its route (or the town), and a zoom that shows it.Link zu diesem Eintragstatic func place(o: Dictionary) -> Array- Parameter
o: Dictionary
- Rückgabewert
Array
scripts/sim/opportunities.gd:505Opportunities._newsfuncworld: news the player can't act on (a rival's win, an offer that lapsed): Sim.post_world_news.Link zu diesem Eintragfunc _news(sim: Sim, text: String, kind: String, o: Dictionary, world: bool = false) -> voidA new offer is the player's news: it is a chance for them.
- Parameter
sim: Simtext: Stringkind: Stringo: Dictionaryworld: bool = false
- Rückgabewert
void
scripts/sim/opportunities.gd:513Opportunities.to_dictfuncLink zu diesem Eintragfunc to_dict() -> Dictionary- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/opportunities.gd:519Opportunities._refstatic funcAn industry or a town as a save keeps it: ["i" or "t", its id] ([] for none).Link zu diesem Eintragstatic func _ref(place: Object) -> Array- Parameter
place: Object
- Rückgabewert
Array
scripts/sim/opportunities.gd:531Opportunities.restorefuncTake back the offers of a save (d: to_dict's) on mapm.Link zu diesem Eintragfunc restore(d: Dictionary, m: WorldMap) -> voidAn offer about a place that isn't there is left out. A save from before there were any leaves none, and the seed Sim gave.
- Parameter
d: Dictionarym: WorldMap
- Rückgabewert
void
scripts/sim/opportunities.gd:537
Pathfinder
Pathfinder.MAX_EXPANSIONSconstLink zu diesem Eintragconst MAX_EXPANSIONS := 400000Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/pathfinder.gd:8Pathfinder.findstatic funcReturns {"tiles": Array[Vector2i], "end_heading": int} or {} when there is no route.Link zu diesem Eintragstatic func find(m: WorldMap, kind: String, start: Vector2i, heading: int, goals: Dictionary, allow_reverse_start: bool, allow_dead_end_uturn: bool, wired: bool = false, obey_signals: bool = true, avoid: Dictionary = {}) -> DictionaryA route that took a search also carries "box": every tile the search looked at lies inside it, so as long as the network doesn't change in there the same search gives the same route.
goals: Dictionary of goal tiles.heading-1 means any first move is allowed.wired: an electric train, which can only run under overhead wires.obey_signalsfalse: as if one-way signals let trains through both ways (to tell the player when they are what stands in the way).avoid: track blocks (ids of WorldMap.blocks) to keep off, where other trains are (RAIL-80).- Parameter
m: WorldMapkind: Stringstart: Vector2iheading: intgoals: Dictionaryallow_reverse_start: boolallow_dead_end_uturn: boolwired: bool = falseobey_signals: bool = trueavoid: Dictionary = {}
- Rückgabewert
Dictionary
- Ruft auf
Const.opp
scripts/sim/pathfinder.gd:19Pathfinder._find_waterstatic funcThe way over water fromstartto the nearest ofgoals.Link zu diesem Eintragstatic func _find_water(m: WorldMap, start: Vector2i, goals: Dictionary) -> DictionaryShips turn where they like and sail a straight course afterwards (Vehicle.water_course), so this is the eight-way way of
find_seawith each diagonal step split in two: a search over tiles rather than tiles and headings, with a heuristic that fits open water. Remembered on the map (see_sea_memo).- Parameter
m: WorldMapstart: Vector2igoals: Dictionary
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.dir_between
scripts/sim/pathfinder.gd:101Pathfinder.find_seastatic funcThe shortest way by water fromstarttogoal, moving between tiles in eight directions (diagonally only where both tiles beside the step are water too), or [] when there is none.Link zu diesem Eintragstatic func find_sea(m: WorldMap, start: Vector2i, goal: Vector2i, max_len: float = INF) -> Array[Vector2i]Ships pull it straight afterwards (Vehicle.water_course): unlike the four-way route, it already runs close to the direct line, so the pulled course doesn't keep the corners of an L.
max_len: ways longer than this don't count, which keeps the search to the water near the straight line (an answer of "none" then comes quickly even on a big sea).- Parameter
m: WorldMapstart: Vector2igoal: Vector2imax_len: float = INF
- Rückgabewert
Array[Vector2i]
scripts/sim/pathfinder.gd:127Pathfinder._sea_memostatic funcA way over water found earlier underkeyfromstartto one ofends([] if none, if it no longer runs over open water, or if it answers another question whose key hashed the same).Link zu diesem Eintragstatic func _sea_memo(m: WorldMap, key: int, start: Vector2i, ends: Dictionary) -> Array[Vector2i]Ships ask the same questions at every departure, and open water only changes with the ground (WorldMap.notify empties
sea_memothen).- Parameter
m: WorldMapkey: intstart: Vector2iends: Dictionary
- Rückgabewert
Array[Vector2i]
scripts/sim/pathfinder.gd:142Pathfinder._sea_rememberstatic funcLink zu diesem Eintragstatic func _sea_remember(m: WorldMap, key: int, tiles: Array[Vector2i]) -> void- Parameter
m: WorldMapkey: inttiles: Array[Vector2i]
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/pathfinder.gd:155Pathfinder._find_seastatic funcfind_sea's search, to the nearest ofgoals.Link zu diesem Eintragstatic func _find_sea(m: WorldMap, start: Vector2i, goals: Array, max_len: float) -> Array[Vector2i]- Parameter
m: WorldMapstart: Vector2igoals: Arraymax_len: float
- Rückgabewert
Array[Vector2i]
scripts/sim/pathfinder.gd:162Pathfinder._octilestatic funcThe eight-way distance over open water from (x, y) to the nearest ofgoals.Link zu diesem Eintragstatic func _octile(x: int, y: int, goals: Array) -> float- Parameter
x: inty: intgoals: Array
- Rückgabewert
float
scripts/sim/pathfinder.gd:223Pathfinder._heuristicstatic funcLink zu diesem Eintragstatic func _heuristic(t: Vector2i, goals: Array) -> float- Parameter
t: Vector2igoals: Array
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/pathfinder.gd:232Pathfinder._buildstatic funcLink zu diesem Eintragstatic func _build(m: WorldMap, came: Dictionary, s: int, end_heading: int) -> Dictionary- Parameter
m: WorldMapcame: Dictionarys: intend_heading: int
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/pathfinder.gd:239Pathfinder._pushstatic funcLink zu diesem Eintragstatic func _push(f: PackedFloat32Array, s: PackedInt32Array, pri: float, state: int) -> void- Parameter
f: PackedFloat32Arrays: PackedInt32Arraypri: floatstate: int
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/pathfinder.gd:250Pathfinder._popstatic funcLink zu diesem Eintragstatic func _pop(f: PackedFloat32Array, s: PackedInt32Array) -> void- Parameter
f: PackedFloat32Arrays: PackedInt32Array
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/pathfinder.gd:263
Problems
Problems.SIGNAL_DAYSconsta train held at a red signal this longProblems.QUEUE_DAYSconsta vehicle held up in traffic, off a berth or holding this long (RAIL-26)Problems.NO_CALL_DAYSconsta station in use that no vehicle has called at for this longProblems.PILE_UPconstcargo piling up: at least this much waiting, more than comes in a month...Problems.PILE_RATINGconst...and the station's rating for it under this, so some of it gives upProblems.SERVICE_LATEconstoverdue a service: this many service intervals since the last oneProblems.STAFF_SHORTconstan industry with under this share of the staff it wantsProblems.HELD_UPconsta plant that needs every input holding this much while it waits for anotherProblems.REFRESHconstreal seconds between two looks (tick)Problems.TOLD_DAYSconsta vehicle that gets lost is announced at most once in this many daysProblems.rowsvarthe last look, most serious firstProblems.seriousvarrows of level 0Problems.revvargoes up when what is on the list (things and kinds) changesProblems._ofvarthing -> its most serious rowProblems._sigvarLink zu diesem Eintragvar _sig: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/problems.gd:37Problems._waitvarLink zu diesem Eintragvar _wait := 0.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/problems.gd:38Problems._lostvarids of the vehicles lost at the last lookProblems._toldvarvehicle id -> game day it was last announced as lostProblems._primedvarthe first look announces nothing: those were lost alreadyProblems._alertsvarLink zu diesem Eintragvar _alerts: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/problems.gd:42Problems.tickfuncLook again if REFRESH seconds have passed since the last look.Link zu diesem Eintragfunc tick(sim: Sim, delta: float) -> boolTrue when it did.
- Parameter
sim: Simdelta: float
- Rückgabewert
bool
scripts/sim/problems.gd:46Problems.refreshfuncLook again now.Link zu diesem Eintragfunc refresh(sim: Sim) -> void- Parameter
sim: Sim
- Rückgabewert
void
scripts/sim/problems.gd:55Problems.hasfuncLink zu diesem Eintragfunc has(thing: Object) -> bool- Parameter
thing: Object
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/problems.gd:83Problems.offuncThe most serious row aboutthing, or {}.Link zu diesem Eintragfunc of(thing: Object) -> Dictionary- Parameter
thing: Object
- Rückgabewert
Dictionary
scripts/sim/problems.gd:88Problems.take_alertsfuncVehicles that got lost since the last call (at most once a month each): for a toast.Link zu diesem Eintragfunc take_alerts() -> Array- Rückgabewert
Array
scripts/sim/problems.gd:93Problems.liststatic funcEvery problem of the player's company, most serious first.Link zu diesem Eintragstatic func list(sim: Sim) -> ArrayCheap enough for a few times a second with hundreds of vehicles: one pass over vehicles, stations, towns and the industries the stations reach, text only for the rows, and each platform measured once.
- Parameter
sim: Sim
- Rückgabewert
Array
scripts/sim/problems.gd:104Problems.vehicle_rowstatic funcThe worst problem of one vehicle, or {}.Link zu diesem Eintragstatic func vehicle_row(sim: Sim, v: Vehicle) -> Dictionary- Parameter
sim: Simv: Vehicle
- Rückgabewert
Dictionary
scripts/sim/problems.gd:146Problems._station_rowsstatic funccallsis cargo -> the player's vehicles that take it on atst(see _note_calls).Link zu diesem Eintragstatic func _station_rows(sim: Sim, st: Station, out: Array, calls: Dictionary) -> void- Parameter
sim: Simst: Stationout: Arraycalls: Dictionary
- Rückgabewert
void
- Ruft auf
L.t
scripts/sim/problems.gd:173Problems._piling_rowstatic funcCargocpiling up atst, and what holds it back.Link zu diesem Eintragstatic func _piling_row(st: Station, c: String, w: float, r: float, vs: Array) -> DictionaryWhen more waits than the biggest of the vehicles that load it there can take, each of them leaves full: a train wants more wagons (its fix opens that train, where Change cargo adds them), anything else more vehicles. When there is room on board they call too seldom. A player who sees a full train leave thinks it took everything, so the hint says how much it takes.
- Parameter
st: Stationc: Stringw: floatr: floatvs: Array
- Rückgabewert
Dictionary
scripts/sim/problems.gd:189Problems._note_callsstatic funcNote the stops wherevtakes cargo on (not unload-only or don't-load ones), incalls: Station -> cargo -> [Vehicle].Link zu diesem Eintragstatic func _note_calls(v: Vehicle, calls: Dictionary) -> void- Parameter
v: Vehiclecalls: Dictionary
- Rückgabewert
void
scripts/sim/problems.gd:219Problems._short_platformsstatic funcNote the longest of the player's trains too long for each of its rail stops (as VehicleWindow.short_platform_text works it out), measuring each station once.Link zu diesem Eintragstatic func _short_platforms(m: WorldMap, v: Vehicle, platforms: Dictionary, short: Dictionary) -> void- Parameter
m: WorldMapv: Vehicleplatforms: Dictionaryshort: Dictionary
- Rückgabewert
void
- Ruft auf
Vehicle.tiles_long
scripts/sim/problems.gd:232Problems._tradesstatic funcWhetherstcarries a cargoindmakes or takes.Link zu diesem Eintragstatic func _trades(ind: Industry, st: Station) -> bool- Parameter
ind: Industryst: Station
- Rückgabewert
bool
scripts/sim/problems.gd:246Problems._industry_rowsstatic funcLink zu diesem Eintragstatic func _industry_rows(sim: Sim, ind: Industry, out: Array) -> void- Parameter
sim: Simind: Industryout: Array
- Rückgabewert
void
- Ruft auf
L.t,IndustryLife.closing_text,L.lower,Fmt.cargo_list
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/problems.gd:253Problems._wherestatic funcWhere a vehicle is: the tile its front is on (or, before it has set off, its next stop).Link zu diesem Eintragstatic func _where(v: Vehicle) -> Vector2- Parameter
v: Vehicle
- Rückgabewert
Vector2
scripts/sim/problems.gd:291Problems._rowstatic funcLink zu diesem Eintragstatic func _row(kind: String, level: int, obj: Object, pos: Vector2, text: String, fix: String) -> Dictionary- Parameter
kind: Stringlevel: intobj: Objectpos: Vector2text: Stringfix: String
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/problems.gd:298Problems._beforestatic funcMost serious first, then by name.Link zu diesem Eintragstatic func _before(a: Dictionary, b: Dictionary) -> bool- Parameter
a: Dictionaryb: Dictionary
- Rückgabewert
bool
scripts/sim/problems.gd:303
RouteBuilder
RouteBuilder.MAX_EXPANSIONSconstLink zu diesem Eintragconst MAX_EXPANSIONS := 8000Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/route_builder.gd:20RouteBuilder.SHAPE_EXPANSIONSconstThe second pass's share of the search budget, at the most.RouteBuilder.REACHconstHow far from the rough path (in tiles) the second pass may stray.RouteBuilder.DETOURconstA rough path up to this much longer than the straight distance had nothing much in its way.RouteBuilder.TURNconstWhat the shape of the line costs, in tiles of track: the first turning tile after straight trackRouteBuilder.LONE_BENDconst...when straight track follows it: a 90-degree bend (2.0 in all)RouteBuilder.SECOND_TURNconst...when it turns back on the next tile: the start of a diagonal (1.5)RouteBuilder.SIDESTEPconsta diagonal that ends after those two tiles: a one-tile sidestep (4.0)RouteBuilder.RUNconsteach further tile of a diagonal: it is that much shorter to driveRouteBuilder.HAIRPINconsttwo turns the same way on neighbouring tilesRouteBuilder.CAREFULconstThe second pass first looks for the best line with this share of its budget; if that runs out it settles for a good one, weighting the distance left by HASTY.RouteBuilder.HASTYconstLink zu diesem Eintragconst HASTY := 2.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/route_builder.gd:37RouteBuilder.TURN_INDEXconst(way out - way in) & 3 -> straight on, right, leftLink zu diesem Eintragconst TURN_INDEX: Array[int] = [0, 1, 0, 2]Deklariert inscripts/sim/route_builder.gd:38RouteBuilder.last_expansionsstatic varstates looked at by the last search (benchmark tooling)RouteBuilder.last_refinedstatic varwhether the last search's second pass finished (benchmark tooling)RouteBuilder.log_tostatic varan Array: every search adds itsdescribeentry (benchmark tooling)RouteBuilder.last_crossingsstatic varThe bridges and tunnels on the path the last search returned, in order along it: [{"type": "bridge" | "tunnel", "from", "to": the tiles either side (a bridge's ramps, the tiles before and after a tunnel's mouths), "between": the tiles in between (spans / tunnel), "dir", "a", "b", "style": what Sim.build_crossing takes}].Link zu diesem Eintragstatic var last_crossings: Array = []Empty when
Deklariert injumpswas.scripts/sim/route_builder.gd:46RouteBuilder.CROSSINGconstWhat a crossing costs on top of its tiles, in tiles of track: short detours still win.Link zu diesem Eintragconst CROSSING := 8.0(The first pass leans towards the goal, so a tile sideways looks dearer to it than it is: this has to cover that too.)
Deklariert inscripts/sim/route_builder.gd:50RouteBuilder.findstatic funcPath of tiles fromstarttogoal(both included).Link zu diesem Eintragstatic func find(m: WorldMap, kind: String, start: Vector2i, start_dir: int, goal: Vector2i, goal_dir: int, reserved: Dictionary = {}, max_expansions: int = 0, jumps: Dictionary = {}) -> Array[Vector2i]start_dir: direction of travel when enteringstart(-1: any).goal_dir: direction the path must leavegoalin (-1: any).reservedtiles are never used. Returns [] if none found.jumps(jumps_for): the bridges and tunnels it may build; {} for none. The path then may not be buildable by Sim.build_line alone: see last_crossings and Sim.build_route.- Parameter
m: WorldMapkind: Stringstart: Vector2istart_dir: intgoal: Vector2igoal_dir: intreserved: Dictionary = {}max_expansions: int = 0jumps: Dictionary = {}
- Rückgabewert
Array[Vector2i]
scripts/sim/route_builder.gd:58RouteBuilder.describestatic funcThe shape of a path: how many tiles turn, and how those turns group.Link zu diesem Eintragstatic func describe(path: Array[Vector2i], start_dir: int = -1, goal_dir: int = -1) -> DictionaryA run of turning tiles is a bend one turn on its own, a sidestep a left and a right (or right and left) with straight track either side: the line jumps one tile sideways, which shows as a wobble, a diagonal three or more alternating turns, drawn and driven as one straight 45-degree line, a hairpin two turns the same way on neighbouring tiles.
start_dir/goal_dir: the directions the path is entered and left in, when known.- Parameter
path: Array[Vector2i]start_dir: int = -1goal_dir: int = -1
- Rückgabewert
Dictionary
- Ruft auf
BuildOps.dir_between
scripts/sim/route_builder.gd:104RouteBuilder._roughstatic funcThe first pass.Link zu diesem Eintragstatic func _rough(m: WorldMap, kind: String, start: Vector2i, start_dir: int, goal: Vector2i, goal_dir: int, reserved: Dictionary, budget: int, jumps: Dictionary = {}, out_crossings: Array = []) -> Array[Vector2i]With
jumps, the bridges and tunnels on the path found go intoout_crossings.- Parameter
m: WorldMapkind: Stringstart: Vector2istart_dir: intgoal: Vector2igoal_dir: intreserved: Dictionarybudget: intjumps: Dictionary = {}out_crossings: Array = []
- Rückgabewert
Array[Vector2i]
- Ruft auf
Pathfinder._push,Pathfinder._pop,Const.opp
scripts/sim/route_builder.gd:140RouteBuilder._refinestatic funcThe second pass: the best-shaped path throughcorridor(see _corridor).Link zu diesem Eintragstatic func _refine(m: WorldMap, kind: String, rough: Array[Vector2i], corridor: Dictionary, start_dir: int, goal_dir: int, reserved: Dictionary, budget: int, weight: float) -> Array[Vector2i]A* over (tile, entry direction, shape), where
shaperemembers the turning tiles just behind: 0 straight track 1, 2 one turn so far, to the right / to the left 3, 4 two alternating turns, the last to the right / left 5, 6 three or more: a diagonal Open ground costs the same everywhere here (the rough pass has weighed up trees and slopes), which is what lets the search run straight to the goal.weight: 1 for the best line, more to settle sooner for a good one. Returns [] whenbudgetruns out.- Parameter
m: WorldMapkind: Stringrough: Array[Vector2i]corridor: Dictionarystart_dir: intgoal_dir: intreserved: Dictionarybudget: intweight: float
- Rückgabewert
Array[Vector2i]
- Ruft auf
Pathfinder._push,Pathfinder._pop,Const.opp
scripts/sim/route_builder.gd:222RouteBuilder._corridorstatic funcThe tiles the second pass may use: every tile within REACH of the rough path (and, where little was in its way, of the two straight-and-diagonal lines between its ends), each with its distance to the goal through the corridor, so the search is drawn round a lake the way the rough path went.Link zu diesem Eintragstatic func _corridor(m: WorldMap, rough: Array[Vector2i]) -> Dictionary- Parameter
m: WorldMaprough: Array[Vector2i]
- Rückgabewert
Dictionary
scripts/sim/route_builder.gd:336RouteBuilder.jumps_forstatic funcWhat find() may use to cross water and hills inyear: every bridge style there is by then, cheapest first ("unit": a span tile's price in tiles of plainkind), and tunnels (likewise).Link zu diesem Eintragstatic func jumps_for(kind: String, year: int) -> DictionaryA caller may add "crossing": what each crossing costs on top of its tiles (CROSSING if not).
- Parameter
kind: Stringyear: int
- Rückgabewert
Dictionary
scripts/sim/route_builder.gd:399RouteBuilder._jumpstatic funcA bridge or tunnel from tiletheadingd(see last_crossings for its keys, plus "cost" in tiles of track), or {} when there is none to build.Link zu diesem Eintragstatic func _jump(m: WorldMap, kind: String, t: Vector2i, d: int, jumps: Dictionary, reserved: Dictionary, cache: Dictionary) -> DictionaryA bridge is tried where the tile ahead is water or takes no piece, a tunnel where the ground ahead rises straight up the way it goes.
- Parameter
m: WorldMapkind: Stringt: Vector2id: intjumps: Dictionaryreserved: Dictionarycache: Dictionary
- Rückgabewert
Dictionary
- Ruft auf
WorldMap.axis_of
scripts/sim/route_builder.gd:413RouteBuilder._risesstatic funcWhether the ground on tilenclimbs on its way across it headingd.Link zu diesem Eintragstatic func _rises(m: WorldMap, n: Vector2i, d: int) -> bool- Parameter
m: WorldMapn: Vector2id: int
- Rückgabewert
bool
- Ruft auf
BuildOps.edge_heights,Const.opp
scripts/sim/route_builder.gd:447RouteBuilder._bridgestatic funcThe shortest bridge from ramptheadingdthat the player's bridge tool would allow, in the cheapest style long enough for it.Link zu diesem Eintragstatic func _bridge(m: WorldMap, kind: String, t: Vector2i, d: int, jumps: Dictionary, reserved: Dictionary) -> Dictionary- Parameter
m: WorldMapkind: Stringt: Vector2id: intjumps: Dictionaryreserved: Dictionary
- Rückgabewert
Dictionary
scripts/sim/route_builder.gd:455RouteBuilder._tunnelstatic funcThe tunnel the player's tunnel tool would dig from the hillside just ahead oft(headingd): the line goes fromtinto it and comes out on the tile beyond its far mouth.Link zu diesem Eintragstatic func _tunnel(m: WorldMap, kind: String, t: Vector2i, d: int, jumps: Dictionary, reserved: Dictionary) -> Dictionary- Parameter
m: WorldMapkind: Stringt: Vector2id: intjumps: Dictionaryreserved: Dictionary
- Rückgabewert
Dictionary
scripts/sim/route_builder.gd:494RouteBuilder._build_jumpedstatic func_build for a first pass that jumped: the bridges' spans and the tunnels' tiles go into the path where they are, and the crossings intoout_crossings.Link zu diesem Eintragstatic func _build_jumped(m: WorldMap, came: Dictionary, s: int, jumped: Dictionary, out_crossings: Array) -> Array[Vector2i]- Parameter
m: WorldMapcame: Dictionarys: intjumped: Dictionaryout_crossings: Array
- Rückgabewert
Array[Vector2i]
scripts/sim/route_builder.gd:539RouteBuilder._refine_betweenstatic funcThe second pass for a path with crossings: each stretch of land between them is shaped on its own (a stretch it can't improve on in its share of the budget stays as the first pass laid it), leaving every bridge and tunnel where it is and entered and left straight on.Link zu diesem Eintragstatic func _refine_between(m: WorldMap, kind: String, path: Array[Vector2i], crossings: Array, start_dir: int, goal_dir: int, reserved: Dictionary, budget: int) -> Array[Vector2i]- Parameter
m: WorldMapkind: Stringpath: Array[Vector2i]crossings: Arraystart_dir: intgoal_dir: intreserved: Dictionarybudget: int
- Rückgabewert
Array[Vector2i]
scripts/sim/route_builder.gd:562RouteBuilder._manhattanstatic funcLink zu diesem Eintragstatic func _manhattan(a: Vector2i, b: Vector2i) -> float- Parameter
a: Vector2ib: Vector2i
- Rückgabewert
float
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/route_builder.gd:599RouteBuilder._tile_coststatic funcCost of putting a piece withbitson tilet, or -1 when it can't be built.Link zu diesem Eintragstatic func _tile_cost(m: WorldMap, kind: String, t: Vector2i, bits: int, fine: bool = false) -> floatfine: for the second pass, which doesn't tell trees and slopes from open ground.- Parameter
m: WorldMapkind: Stringt: Vector2ibits: intfine: bool = false
- Rückgabewert
float
scripts/sim/route_builder.gd:605RouteBuilder._buildstatic funcLink zu diesem Eintragstatic func _build(m: WorldMap, came: Dictionary, s: int, per_tile: int) -> Array[Vector2i]- Parameter
m: WorldMapcame: Dictionarys: intper_tile: int
- Rückgabewert
Array[Vector2i]
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/route_builder.gd:645
SaveGame
SaveGame.VERSIONconstLink zu diesem Eintragconst VERSION := 1Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:6SaveGame.DIRconstLink zu diesem Eintragconst DIR := "user://saves"Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:7SaveGame.list_savesstatic funcLink zu diesem Eintragstatic func list_saves() -> Array- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:10SaveGame.delete_savestatic funcLink zu diesem Eintragstatic func delete_save(path: String) -> void- Parameter
path: String
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:29SaveGame._vstatic funcLink zu diesem Eintragstatic func _v(v: Vector2i) -> Array- Parameter
v: Vector2i
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:36SaveGame._vistatic funcLink zu diesem Eintragstatic func _vi(a: Array) -> Vector2i- Parameter
a: Array
- Rückgabewert
Vector2i
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:40SaveGame._b64static funcLink zu diesem Eintragstatic func _b64(p: PackedByteArray) -> String- Parameter
p: PackedByteArray
- Rückgabewert
String
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:44SaveGame._unb64static funcLink zu diesem Eintragstatic func _unb64(s: String) -> PackedByteArray- Parameter
s: String
- Rückgabewert
PackedByteArray
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:48SaveGame.savestatic funcLink zu diesem Eintragstatic func save(sim: Sim, path: String) -> Error- Parameter
sim: Simpath: String
- Rückgabewert
Error
- Ruft auf
Mods.save_state,Town.size_of
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:54SaveGame.load_simstatic funcLink zu diesem Eintragstatic func load_sim(path: String) -> Sim- Parameter
path: String
- Rückgabewert
Sim
- Ruft auf
Data.era_index,Town.restore_annexes,Town.enlarge_old_buildings,Town.recount_all,WorldGen.add_rig_docks,Data.has_model,Data.reliability,Vehicle.make_seg,Vehicle.free_seg,AiPlayer.from_dict,Goals.from_dict,Goals.caught_up,Mods.load_state,Mods.hook
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:177SaveGame._order_outstatic funcAn order as saved: [station id, full, then each of Vehicle.ORDER_FLAGS].Link zu diesem Eintragstatic func _order_out(o: Dictionary) -> Array- Parameter
o: Dictionary
- Rückgabewert
Array
scripts/sim/save_game.gd:532SaveGame._order_instatic funcAn order back fromrow(see _order_out), at stationst.Link zu diesem Eintragstatic func _order_in(row: Array, st: Station) -> DictionaryFlags an older save didn't have are off.
- Parameter
row: Arrayst: Station
- Rückgabewert
Dictionary
scripts/sim/save_game.gd:540SaveGame._floatsstatic funcLink zu diesem Eintragstatic func _floats(src: Dictionary) -> Dictionary- Parameter
src: Dictionary
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:547SaveGame._intsstatic funcLink zu diesem Eintragstatic func _ints(d: Dictionary) -> Dictionary- Parameter
d: Dictionary
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:554SaveGame._pairsstatic funccargo -> [units, $]Link zu diesem Eintragstatic func _pairs(d: Dictionary) -> Dictionary- Parameter
d: Dictionary
- Rückgabewert
Dictionary
scripts/sim/save_game.gd:562SaveGame._stat_monthstatic funcLink zu diesem Eintragstatic func _stat_month(mo: Dictionary) -> Dictionary- Parameter
mo: Dictionary
- Rückgabewert
Dictionary
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:569SaveGame._course_outstatic funcA ship's course (see Vehicle.water_course) as [x, y, turn, x, y, turn, ...] over its route.Link zu diesem Eintragstatic func _course_out(v: Vehicle) -> Array- Parameter
v: Vehicle
- Rückgabewert
Array
scripts/sim/save_game.gd:585SaveGame._course_instatic funcLink zu diesem Eintragstatic func _course_in(v: Vehicle, a: Array) -> void- Parameter
v: Vehiclea: Array
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/save_game.gd:596
SignalTraps
SignalTraps._memo_keystatic varLink zu diesem Eintragstatic var _memo_key := []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/signal_traps.gd:17SignalTraps._memostatic varLink zu diesem Eintragstatic var _memo: Array = []Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/signal_traps.gd:18SignalTraps.findstatic funcThe stations ofwhothat one-way signals shut: [{"station", "way": "out" | "in", "signal"}], one per station ("out" when both are true), the order of map.stations.Link zu diesem Eintragstatic func find(sim: Sim, who: Company, over: Dictionary = {}) -> Arraysignalis the tile of the first signal in the way, seen from the station.over({tile: state}) stands in for those tiles' signals (see WorldMap.signals), to ask what a click would do; without it the answer is remembered until the rail network, the stations or the depots change.- Parameter
sim: Simwho: Companyover: Dictionary = {}
- Rückgabewert
Array
scripts/sim/signal_traps.gd:26SignalTraps.after_clickstatic funcWhat setting the signal onttostatewould change: {"shut": [...], "freed": [...]}, each in find's form, "shut" for stations it would shut that are open now and "freed" for those it would open again.Link zu diesem Eintragstatic func after_click(sim: Sim, who: Company, t: Vector2i, state: int) -> DictionaryA station that stays shut (say, the far end of a line made one-way) isn't news.
- Parameter
sim: Simwho: Companyt: Vector2istate: int
- Rückgabewert
Dictionary
scripts/sim/signal_traps.gd:64SignalTraps.textstatic funcOne of find's rows in words.Link zu diesem Eintragstatic func text(r: Dictionary, when: String) -> Stringwhen: "careful" (what the click under the mouse would do), "now" (what the click just did), "freed" (what the click would put right) or "problem" (a Problems row, which names the station already).- Parameter
r: Dictionarywhen: String
- Rückgabewert
String
- Ruft auf
L.t
scripts/sim/signal_traps.gd:73SignalTraps.blockerstatic funcThe tile of the one-way signal that keeps trains from getting betweentilesand any of thegoalstiles - out oftilesor, withinward, into them - or (-1, -1) when they can, or when there is no track between them at all.Link zu diesem Eintragstatic func blocker(m: WorldMap, tiles: Dictionary, goals: Dictionary, inward: bool, over: Dictionary = {}) -> Vector2i- Parameter
m: WorldMaptiles: Dictionarygoals: Dictionaryinward: boolover: Dictionary = {}
- Rückgabewert
Vector2i
scripts/sim/signal_traps.gd:92SignalTraps._passesstatic funcWhether a train headingh(or,inward, heading the other way) may pass tilen's signal.Link zu diesem Eintragstatic func _passes(m: WorldMap, n: Vector2i, h: int, inward: bool, over: Dictionary) -> bool- Parameter
m: WorldMapn: Vector2ih: intinward: boolover: Dictionary
- Rückgabewert
bool
- Ruft auf
Const.opp
scripts/sim/signal_traps.gd:104SignalTraps._floodstatic funcFlood the rail network outward fromtilesuntil one ofgoalsis reached.Link zu diesem Eintragstatic func _flood(m: WorldMap, tiles: Dictionary, goals: Dictionary, obey: bool, inward: bool, over: Dictionary) -> ArrayReturns the steps from the start to that goal, [{"t": tile, "h": heading on entering it}], or [] when none is reached.
obeyfalse lets trains through one-way signals both ways.- Parameter
m: WorldMaptiles: Dictionarygoals: Dictionaryobey: boolinward: boolover: Dictionary
- Rückgabewert
Array
- Ruft auf
Const.opp
scripts/sim/signal_traps.gd:112SignalTraps._stepstatic funcLink zu diesem Eintragstatic func _step(m: WorldMap, tile: Vector2i, d: int, bits: int, from: int, obey: bool, inward: bool, over: Dictionary, came: Dictionary, queue: PackedInt32Array) -> void- Parameter
m: WorldMaptile: Vector2id: intbits: intfrom: intobey: boolinward: boolover: Dictionarycame: Dictionaryqueue: PackedInt32Array
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/signal_traps.gd:142SignalTraps._minusstatic funcLink zu diesem Eintragstatic func _minus(a: Array, b: Array) -> Array- Parameter
a: Arrayb: Array
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/signal_traps.gd:156
TerrainGen
TerrainGen.generatestatic funcTerrain only (no towns or industries).Link zu diesem Eintragstatic func generate(m: WorldMap, seed_value: int) -> voidWorldGen.generate builds a full world.
- Parameter
m: WorldMapseed_value: int
- Rückgabewert
void
scripts/sim/terrain_gen.gd:7TerrainGen.heights_from_imagestatic funcHeights from a greyscale image (white = high, black = sea), like OpenTTD heightmaps.Link zu diesem Eintragstatic func heights_from_image(m: WorldMap, path: String) -> bool- Parameter
m: WorldMappath: String
- Rückgabewert
bool
scripts/sim/terrain_gen.gd:14TerrainGen.generate_heightsstatic funcwater: sea level 0 (low) ..Link zu diesem Eintragstatic func generate_heights(m: WorldMap, seed_value: int, water: int = 1, rough: int = 2, sample_scale: float = 1.0) -> void3 (islands). rough: 0 flat .. 3 mountainous. sample_scale stretches the noise so a small preview map shows the same world as a big one.
- Parameter
m: WorldMapseed_value: intwater: int = 1rough: int = 2sample_scale: float = 1.0
- Rückgabewert
void
scripts/sim/terrain_gen.gd:30TerrainGen.enforce_slopesstatic funcLower corners until every pair of edge-adjacent corners differs by at most one level.Link zu diesem Eintragstatic func enforce_slopes(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
scripts/sim/terrain_gen.gd:73TerrainGen.classifystatic funcTerrain types (from heights) and tree cover.Link zu diesem Eintragstatic func classify(m: WorldMap, seed_value: int) -> void- Parameter
m: WorldMapseed_value: int
- Rückgabewert
void
scripts/sim/terrain_gen.gd:100TerrainGen.terrain_typestatic funcLink zu diesem Eintragstatic func terrain_type(m: WorldMap, x: int, y: int) -> int- Parameter
m: WorldMapx: inty: int
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/terrain_gen.gd:123TerrainGen.classify_tilestatic funcRe-derive one tile's terrain after its corners changed; trees only survive on grass.Link zu diesem Eintragstatic func classify_tile(m: WorldMap, x: int, y: int) -> void- Parameter
m: WorldMapx: inty: int
- Rückgabewert
void
scripts/sim/terrain_gen.gd:138TerrainGen._near_waterstatic funcLink zu diesem Eintragstatic func _near_water(m: WorldMap, x: int, y: int) -> bool- Parameter
m: WorldMapx: inty: int
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/terrain_gen.gd:145
UndoStack
UndoStack.MAX_STEPSconstLink zu diesem Eintragconst MAX_STEPS := 20Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:23UndoStack.MAX_AGE_DAYSconstLink zu diesem Eintragconst MAX_AGE_DAYS := 60.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:24UndoStack.stepsvaroldest firstUndoStack.enabledvarLink zu diesem Eintragvar enabled := trueFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:30UndoStack.lostvarThe step that was given up last, for the button's tooltip: {"what", "why"}.UndoStack.clearfuncLink zu diesem Eintragfunc clear() -> void- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:35UndoStack.sizefuncLink zu diesem Eintragfunc size() -> int- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:40UndoStack._tilestatic funcLink zu diesem Eintragstatic func _tile(m: WorldMap, t: Vector2i) -> Array- Parameter
m: WorldMapt: Vector2i
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:46UndoStack._putstatic funcLink zu diesem Eintragstatic func _put(m: WorldMap, t: Vector2i, s: Array) -> void- Parameter
m: WorldMapt: Vector2is: Array
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:52UndoStack._stationstatic funcLink zu diesem Eintragstatic func _station(m: WorldMap, st: Station) -> Array- Parameter
m: WorldMapst: Station
- Rückgabewert
Array
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:83UndoStack._orders_tostatic funcLink zu diesem Eintragstatic func _orders_to(sim: Sim, st: Station) -> int- Parameter
sim: Simst: Station
- Rückgabewert
int
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:89UndoStack.bulldoze_tilesstatic funcEvery tile a bulldoze ofrectmay change: the area and its edge (a depot lets go of the road in front of it), the whole of each bridge or tunnel it reaches and of each airfield.Link zu diesem Eintragstatic func bulldoze_tiles(m: WorldMap, rect: Rect2i) -> Array- Parameter
m: WorldMaprect: Rect2i
- Rückgabewert
Array
scripts/sim/undo.gd:100UndoStack.terraform_tilesstatic funcEvery tile raising or loweringcornersmay change (see BuildOps.apply_terraform).Link zu diesem Eintragstatic func terraform_tiles(m: WorldMap, corners: Array) -> Array- Parameter
m: WorldMapcorners: Array
- Rückgabewert
Array
scripts/sim/undo.gd:124UndoStack.beginfuncCall before an action changes anything.Link zu diesem Eintragfunc begin(sim: Sim, who: Company, tiles: Array, opt: Dictionary = {}) -> Dictionarytiles: every tile it may touch (more is fine: tiles that end up unchanged are dropped).opt: "corners" (corner heights it may change), "stations" (stations it may change that don't stand ontiles), "ratings" (it may move council ratings). Returns whatcommitneeds; {} when the action isn't the player's (nothing is recorded then).- Parameter
sim: Simwho: Companytiles: Arrayopt: Dictionary = {}
- Rückgabewert
Dictionary
scripts/sim/undo.gd:142UndoStack._log_ofstatic funcLink zu diesem Eintragstatic func _log_of(t: Town, cid: int) -> Variant- Parameter
t: Towncid: int
- Rückgabewert
Variant
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:171UndoStack.commitfuncCall when the action is done and paid for.Link zu diesem Eintragfunc commit(sim: Sim, u: Dictionary, kind: String, info: Dictionary = {}) -> voidkindandinfo("n": how many tiles, "name": a station's or town's name, "category": the ledger line it was paid from) only describe it.- Parameter
sim: Simu: Dictionarykind: Stringinfo: Dictionary = {}
- Rückgabewert
void
scripts/sim/undo.gd:177UndoStack._monthstatic funcLink zu diesem Eintragstatic func _month(sim: Sim) -> Vector2i- Parameter
sim: Sim
- Rückgabewert
Vector2i
- Ruft auf
Calendar.from_day
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:237UndoStack.describestatic funcA step in words: "12 tiles of rail", "Ashford North", "demolition of 3 tiles".Link zu diesem Eintragstatic func describe(step: Dictionary) -> String- Parameter
step: Dictionary
- Rückgabewert
String
scripts/sim/undo.gd:245UndoStack._problemfuncWhy the newest step can't be undone now: [reason, given up for good].Link zu diesem Eintragfunc _problem(sim: Sim, step: Dictionary) -> Array["", false] when it can.
- Parameter
sim: Simstep: Dictionary
- Rückgabewert
Array
- Ruft auf
L.t
scripts/sim/undo.gd:266UndoStack._vehicle_onfuncLink zu diesem Eintragfunc _vehicle_on(sim: Sim, step: Dictionary) -> bool- Parameter
sim: Simstep: Dictionary
- Rückgabewert
bool
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:299UndoStack._block_heldfuncWith realistic blocking: whether a train holds (stands in, or has been let into) a block of track that undoing the step would take away.Link zu diesem Eintragfunc _block_held(sim: Sim, step: Dictionary) -> bool- Parameter
sim: Simstep: Dictionary
- Rückgabewert
bool
scripts/sim/undo.gd:320UndoStack.statusfuncFor the Undo button: {"can", "what", "money" (what undoing pays back), "tip"}.Link zu diesem Eintragfunc status(sim: Sim) -> DictionaryA step that can never be undone again is dropped here, with everything older.
- Parameter
sim: Sim
- Rückgabewert
Dictionary
scripts/sim/undo.gd:340UndoStack.undofuncUndo the newest step.Link zu diesem Eintragfunc undo(sim: Sim) -> DictionaryReturns {"ok", "text" (what to tell the player), "what", "money"}.
- Parameter
sim: Sim
- Rückgabewert
Dictionary
scripts/sim/undo.gd:362UndoStack._revertfuncLink zu diesem Eintragfunc _revert(sim: Sim, step: Dictionary) -> void- Parameter
sim: Simstep: Dictionary
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/undo.gd:376
WorldGen
WorldGen.DENSITYconstOptions: "water" 0..3 (sea level), "rough" 0..3 (terrain), "towns" / "industries" 0..3 (density), "heightmap" (path to a greyscale image, OpenTTD-style).Link zu diesem Eintragconst DENSITY := [0.55, 1.0, 1.5, 2.2]Deklariert inscripts/sim/world_gen.gd:8WorldGen.INDUSTRY_AREAconstTiles of land (or sea) that hold one full set of Data.INDUSTRY counts at normal density: 24 industries here is about one per 600 tiles.WorldGen.FEED_MINconstHow far (in tiles) a processing industry is sited from the producers that feed it: far enough for a route to pay, near enough for an early train or lorry.WorldGen.FEED_MAXconstLink zu diesem Eintragconst FEED_MAX := 50.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:15WorldGen.SAME_APART_MAXconstUpper bound on how far apart two industries of one type are kept (see _place_industries).WorldGen.SPREAD_TRIESconstUsable sites weighed for each industry placed at random; the one farthest from its own kind wins.WorldGen.TOWN_SITE_TOWNSconstAn industry that stands by a town (a printing works) looks around the biggest few towns, up to TOWN_SITE_MAX tiles from the centre.WorldGen.TOWN_SITE_MAXconstLink zu diesem Eintragconst TOWN_SITE_MAX := 16.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:23WorldGen.TOWN_INDUSTRY_MINconstHow far (in tiles) a town centre is founded from an industry's centre, so the town starts with room to grow before it meets the ground kept clear around the industry (BuildOps.INDUSTRY_GAP).WorldGen.TOWN_INDUSTRY_FALLBACKconstLink zu diesem Eintragconst TOWN_INDUSTRY_FALLBACK := 10.0Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:27WorldGen.TOWN_EXTRAconstLink zu diesem Eintragconst TOWN_EXTRAFür diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:28WorldGen.generatestatic funcLink zu diesem Eintragstatic func generate(m: WorldMap, seed_value: int, opts: Dictionary = {}) -> void- Parameter
m: WorldMapseed_value: intopts: Dictionary = {}
- Rückgabewert
void
- Ruft auf
Data.era_index,L.t,TerrainGen.heights_from_image,TerrainGen.generate_heights,TerrainGen.classify
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:31WorldGen.add_rig_docksstatic funcEvery industry out at sea gets its own open dock (see BuildOps.add_rig_dock).Link zu diesem Eintragstatic func add_rig_docks(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
- Ruft auf
BuildOps.add_rig_dock
scripts/sim/world_gen.gd:57WorldGen._place_industriesstatic funcLink zu diesem Eintragstatic func _place_industries(m: WorldMap, rng: RandomNumberGenerator, density: float = 1.0) -> void- Parameter
m: WorldMaprng: RandomNumberGeneratordensity: float = 1.0
- Rückgabewert
void
- Ruft auf
Data.opens,Data.accepts
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:65WorldGen._place_town_industriesstatic funcThe kinds that stand by a town (a printing works, RAIL-31), once the towns are founded: on ground the towns have left clear, levelled like an industry opening during the game.Link zu diesem Eintragstatic func _place_town_industries(m: WorldMap, rng: RandomNumberGenerator, density: float) -> void- Parameter
m: WorldMaprng: RandomNumberGeneratordensity: float
- Rückgabewert
void
- Ruft auf
Data.opens
scripts/sim/world_gen.gd:84WorldGen._place_kindstatic funcPut down a new map's industries oftype(see type_count) and return them.Link zu diesem Eintragstatic func _place_kind(m: WorldMap, rng: RandomNumberGenerator, room: Vector2i, type: String, density: float) -> Array- Parameter
m: WorldMaprng: RandomNumberGeneratorroom: Vector2itype: Stringdensity: float
- Rückgabewert
Array
scripts/sim/world_gen.gd:93WorldGen.industry_roomstatic funcThe room there is to build industries in: x land tiles (for industries ashore), y open water (for those at sea).Link zu diesem Eintragstatic func industry_room(m: WorldMap) -> Vector2iSampled every other tile, which is plenty for a head count.
- Parameter
m: WorldMap
- Rückgabewert
Vector2i
scripts/sim/world_gen.gd:110WorldGen.type_countstatic funcHow many industries oftypea map withroom(see industry_room) gets atdensity: counts follow the room there is to build in, and every type gets at least one.Link zu diesem Eintragstatic func type_count(room: Vector2i, type: String, density: float) -> int- Parameter
room: Vector2itype: Stringdensity: float
- Rückgabewert
int
scripts/sim/world_gen.gd:124WorldGen.spacingstatic funcHow far apartcountindustries oftypeare kept.Link zu diesem Eintragstatic func spacing(room: Vector2i, type: String, count: int) -> floatTwo of a kind side by side look like a mistake and split one area's trade between them: keep each a fair share of its own type's room apart (half the even spacing, capped so a rare processor can still sit near its feeders).
- Parameter
room: Vector2itype: Stringcount: int
- Rückgabewert
float
scripts/sim/world_gen.gd:132WorldGen.find_sitestatic funcWhere a new industry oftypegoes: near producers inunserved(see unserved_feeders) that have nobody to take their cargo, if any; else near producers none of its own kind is near yet (a paper mill by forests that already have a sawmill); else anywhere, as far from its own kind as it can.Link zu diesem Eintragstatic func find_site(m: WorldMap, rng: RandomNumberGenerator, type: String, apart: float, unserved: Array) -> Vector3iA plant that needs every input (Data.INDUSTRY "needs_all") goes where it reaches makers of as many of its inputs as it can. A kind that stands by a town (a printing works) goes at the edge of one of the biggest. (x, y) is the north-west tile and z the level it stands at; z is -1 when no usable site turned up.
- Parameter
m: WorldMaprng: RandomNumberGeneratortype: Stringapart: floatunserved: Array
- Rückgabewert
Vector3i
scripts/sim/world_gen.gd:144WorldGen.put_industrystatic funcPut an industry oftypewith ididonspot(from find_site): the ground under it flattened to its level (the corners only: the caller works out the rest), added to the map's list and its tiles.Link zu diesem Eintragstatic func put_industry(m: WorldMap, id: int, type: String, spot: Vector3i) -> IndustryReturns it.
- Parameter
m: WorldMapid: inttype: Stringspot: Vector3i
- Rückgabewert
Industry
scripts/sim/world_gen.gd:162WorldGen._site_levelstatic funcThe level asitekind of industry would stand at with its north-west tile on (x, y): 0 at sea, the flattened ground level ashore, -1 where it can't go.Link zu diesem Eintragstatic func _site_level(m: WorldMap, site: String, x: int, y: int) -> int- Parameter
m: WorldMapsite: Stringx: inty: int
- Rückgabewert
int
scripts/sim/world_gen.gd:178WorldGen.unserved_feedersstatic funcIndustries making somethingtypeaccepts that have no taker within FEED_MAX tiles yet.Link zu diesem Eintragstatic func unserved_feeders(m: WorldMap, type: String) -> ArrayFor a plant that needs every input, all of them, taken or not: it can't work on one alone.
- Parameter
m: WorldMaptype: String
- Rückgabewert
Array
- Ruft auf
Data.accepts
scripts/sim/world_gen.gd:189WorldGen._feeders_of_ownstatic funcIndustries making somethingtypeaccepts that have no industry oftypewithin FEED_MAX tiles: for a second customer of a cargo (a paper mill, where the forests already have a sawmill).Link zu diesem Eintragstatic func _feeders_of_own(m: WorldMap, type: String) -> Array- Parameter
m: WorldMaptype: String
- Rückgabewert
Array
- Ruft auf
Data.accepts
scripts/sim/world_gen.gd:225WorldGen._site_near_feedersstatic funcA site FEED_MIN..FEED_MAX tiles from a producer inunservedand at leastaparttiles from any othertype: the best of several usable ones, counting how many such producers each would serve (for a plant that needs every input, how many of its inputs they make), then how far it keeps from its own kind.Link zu diesem Eintragstatic func _site_near_feeders(m: WorldMap, rng: RandomNumberGenerator, site: String, type: String, apart: float, unserved: Array) -> Vector3iz is -1 when none turned up.
- Parameter
m: WorldMaprng: RandomNumberGeneratorsite: Stringtype: Stringapart: floatunserved: Array
- Rückgabewert
Vector3i
- Ruft auf
Data.accepts
scripts/sim/world_gen.gd:239WorldGen._site_spreadstatic funcA usable site anywhere on the map: of SPREAD_TRIES random ones, the farthest from other industries oftype(best-candidate sampling, which spreads them out without a hard rule that could leave one unplaced).Link zu diesem Eintragstatic func _site_spread(m: WorldMap, rng: RandomNumberGenerator, site: String, type: String) -> Vector3iz is -1 when no usable site turned up.
- Parameter
m: WorldMaprng: RandomNumberGeneratorsite: Stringtype: String
- Rückgabewert
Vector3i
scripts/sim/world_gen.gd:286WorldGen._site_by_townstatic funcA site by one of the TOWN_SITE_TOWNS biggest towns, at leastaparttiles from any othertype: the usable one nearest the centre of the biggest town that has any within TOWN_SITE_MAX tiles, so it stands at the edge of town or in a gap inside it.Link zu diesem Eintragstatic func _site_by_town(m: WorldMap, rng: RandomNumberGenerator, type: String, apart: float) -> Vector3iz is -1 when none turned up.
- Parameter
m: WorldMaprng: RandomNumberGeneratortype: Stringapart: float
- Rückgabewert
Vector3i
scripts/sim/world_gen.gd:309WorldGen.level_groundstatic funcThe ground of an industry put down where the land is already shaped (one opening during the game, or one by a town once the towns are founded): no trees on it or around it, its corners at the level put_industry flattened them to, and its tiles looked at again.Link zu diesem Eintragstatic func level_ground(m: WorldMap, ind: Industry) -> Rect2iReturns the tiles that changed.
- Parameter
m: WorldMapind: Industry
- Rückgabewert
Rect2i
- Ruft auf
TerrainGen.classify_tile
scripts/sim/world_gen.gd:334WorldGen._gap_to_kindstatic funcDistance fromcto the nearest industry oftype, INF when there is none yet.Link zu diesem Eintragstatic func _gap_to_kind(m: WorldMap, type: String, c: Vector2) -> float- Parameter
m: WorldMaptype: Stringc: Vector2
- Rückgabewert
float
scripts/sim/world_gen.gd:348WorldGen._sea_site_okstatic funcOffshore: open water all over the footprint and a margin, with a shore close enough for a dock.Link zu diesem Eintragstatic func _sea_site_ok(m: WorldMap, x: int, y: int) -> bool- Parameter
m: WorldMapx: inty: int
- Rückgabewert
bool
scripts/sim/world_gen.gd:357WorldGen._near_coaststatic funcA harbour sits on the shore: open water within a couple of tiles of its footprint.Link zu diesem Eintragstatic func _near_coast(m: WorldMap, x: int, y: int) -> bool- Parameter
m: WorldMapx: inty: int
- Rückgabewert
bool
scripts/sim/world_gen.gd:380WorldGen._industry_site_levelstatic funcReturns the level the footprint can be flattened to, or -1 if the site is unusable.Link zu diesem Eintragstatic func _industry_site_level(m: WorldMap, x: int, y: int) -> intFlattening only lowers corners by one, and only where that keeps neighbours within one level.
- Parameter
m: WorldMapx: inty: int
- Rückgabewert
int
scripts/sim/world_gen.gd:391WorldGen._site_clearstatic funcNothing built on the footprint of an industry with its north-west tile on (x, y), or by it: no road, track, bridge or tunnel within a tile (flattening reshapes the ground there), and no building, station or depot within BuildOps.INDUSTRY_GAP (the ground towns keep clear around industries).Link zu diesem Eintragstatic func _site_clear(m: WorldMap, x: int, y: int) -> boolThis is for industries opening during the game (RAIL-23): when the world is made, nothing is built yet but other industries, and those keep further apart than this anyway.
- Parameter
m: WorldMapx: inty: int
- Rückgabewert
bool
scripts/sim/world_gen.gd:419WorldGen._name_industriesstatic funcLink zu diesem Eintragstatic func _name_industries(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:433WorldGen.industry_namestatic funcAn industry is named after the nearest town: "Ashford Coal Mine".Link zu diesem Eintragstatic func industry_name(m: WorldMap, ind: Industry) -> String- Parameter
m: WorldMapind: Industry
- Rückgabewert
String
scripts/sim/world_gen.gd:439WorldGen._place_townsstatic funcLink zu diesem Eintragstatic func _place_towns(m: WorldMap, rng: RandomNumberGenerator, density: float = 1.0, opts: Dictionary = {}) -> void- Parameter
m: WorldMaprng: RandomNumberGeneratordensity: float = 1.0opts: Dictionary = {}
- Rückgabewert
void
- Ruft auf
L.t,Town.pick_style
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:453WorldGen._town_site_okstatic funcLink zu diesem Eintragstatic func _town_site_ok(m: WorldMap, x: int, y: int, spacing: float = 22.0, industry_clear: float = TOWN_INDUSTRY_MIN) -> bool- Parameter
m: WorldMapx: inty: intspacing: float = 22.0industry_clear: float = TOWN_INDUSTRY_MIN
- Rückgabewert
bool
- Ruft auf
BuildOps.can_build_house
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:481WorldGen._town_namestatic funcLink zu diesem Eintragstatic func _town_name(rng: RandomNumberGenerator, used: Dictionary) -> String- Parameter
rng: RandomNumberGeneratorused: Dictionary
- Rückgabewert
String
- Ruft auf
Data.town_prefixes,Data.town_suffixes,L.t
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:502WorldGen._clear_treesstatic funcLink zu diesem Eintragstatic func _clear_trees(m: WorldMap) -> void- Parameter
m: WorldMap
- Rückgabewert
void
Für diesen Eintrag fehlt noch eine Beschreibung des Verhaltens.
Deklariert inscripts/sim/world_gen.gd:517
Dateioptionen
Bei Feldnamen zählt die Groß- und Kleinschreibung. Die verlinkten Abschnitte erklären die Dateien mit Beispielen.
| Datei oder Abschnitt | Pflichtfelder | Optionale Felder |
|---|---|---|
mod.json | id | name, version, author, description |
data.json → vehicles.<id> | name, kind, cargos, speed, cost und run. Verwende look oder model sowie max_wagons für Loks oder cap für andere Fahrzeuge. | desc, year, rel, electric, steam, length |
data.json → cargo.<id> | Vorhandene Fracht-ID | rate, days |
data.json → town_names | Keine | prefixes, suffixes, replace |
data.json → company_names | Namensliste | Keine |
maps/<name>.json | Keine | name, description, settings |
In settings sind w und h (64, 128, 256, 512, 1024), year (1950, 1960, 1970, 1980, 1990, 2000) sowie towns, industries, rough und water (Indizes 0–3) möglich. rough reicht von flach bis bergig. Bei water folgen auf niedrig die Stufen normal, hoch und Inseln.
Der Wahrheitswert steam aktiviert Dampfeffekte und das Fahrverhalten für Dampfloks. length gibt die Länge eines eigenen Modells in Feldern an.
Das Dictionary Sim.options enthält die Simulationsoptionen cost, blocking, ai_level, max_loan, depots, breakdowns und goal. Karten-Mods verwenden die oben aufgeführten Felder unter settings.
Fracht-IDs
| ID | Name |
|---|---|
pax | Passengers |
coal | Coal |
wood | Wood |
grain | Grain |
oil | Oil |
goods | Goods |
food | Food |
iron_ore | Iron ore |
steel | Steel |
fish | Fish |
mail | |
plastics | Plastics |
waste | Waste |
electronics | Electronics |
cars | Cars |
paper | Paper |
news | Newspapers |
Modelle des Grundspiels
| ID | Name | Typ |
|---|---|---|
cargoplane | Pelican Freighter | air |
cargoprop | Stork Cargo Prop | air |
eplane | Breeze Electric Commuter | air |
h2liner | Aurora H2 Airliner | air |
jet | Albatross Jet | air |
jumbo | Condor Jumbo | air |
mailplane | Petrel Mailplane | air |
narrowbody | Falcon Narrowbody | air |
prop | Skylark Prop | air |
regional | Swift Regional Jet | air |
superjumbo | Leviathan Double-Deck | air |
supersonic | Arrow Supersonic | air |
turboprop | Kittiwake Turboprop | air |
widebody | Osprey Widebody | air |
diesel | Meridian Diesel | rail |
efreight | Tempest Electric Freight | rail |
electric | Aurora Electric | rail |
express | Vanguard Express | rail |
heavydiesel | Ironclad Freight Diesel | rail |
hst | Swift High-Speed | rail |
hydrogen | Zephyr Hydrogen | rail |
mogul | Highland Mogul | rail |
railcar | Sparrow Railcar | rail |
steam | Kestrel Steam | rail |
tank | Brigand Tank Engine | rail |
tilting | Swallow Tilting Express | rail |
artbus | Comet Articulated | road |
bus | Comet City Bus | road |
bus2 | Comet Coach | road |
cartruck | Atlas Car Transporter | road |
ddbus | Comet Double-Decker | road |
ebus | Volt Electric Bus | road |
etruck | Volt Electric Truck | road |
roadtrain | Titan Road Train | road |
truck | Atlas Hauler | road |
truck2 | Atlas Hauler Mk II | road |
truck3 | Atlas Hauler Mk III | road |
bulker | Granite Bulk Carrier | water |
container | Atlas Box Carrier | water |
eferry | Ripple Electric Ferry | water |
ferry | Gull Ferry | water |
freighter | Tern Freighter | water |
hydrofoil | Skimmer Hydrofoil | water |
liner | Majestic Liner | water |
tanker | Petrel Tanker | water |