Skip to content

blimp_util

Source: base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl

Notes

Airship that circles a town during a marketing campaign.

BlimpUtil

record global base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl:3

global record BlimpUtil

Notes

Airship that flies to a town when a marketing campaign starts there, circles it while the campaign runs, and then leaves the map.

Details

The fun elements game script spawns one on the Towns event startMarketingCampaign and calls update for it every frame.

Functions

spawnNew(townEntity : Engine.Entity, callback : function(BlimpData)) base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl:34

Notes

Spawns an airship near a town, with a model chosen by the current year.

Parameter Type Description
townEntity Engine.Entity Town to fly to.
callback function(BlimpData) Receives the new airship's data once the entity exists.

update(blimpData : BlimpData, dt : number) : boolean base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl:35

Notes

Moves the airship one step and advances its flight stage.

Parameter Type Description
blimpData BlimpData Airship to update; changed in place.
dt number Time step in seconds.

Returns boolean: True when the airship was removed and its data can be dropped.

BlimpUtil.BlimpState

enum base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl:4

enum BlimpState

Notes

Flight stage of an airship.

Value Description
"Approaching" Flying to the town at 4 times cruise speed.
"Circling" Flying to random points around the town while the campaign runs.
"Leaving" Flying to the nearest map edge.
"Despawn" Shrunk at the map edge, waiting to be removed.

BlimpUtil.Era

enum base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl:11

enum Era

Notes

Era that decides the airship models.

Used in the base game: 1 time in 1 file

base/content/game_mechanics/game_mechanics/fun_elements/blimp_util.tl:112

local blimpEra : BlimpUtil.Era = "EraA"

Value Description
"EraA" Up to 1950; ZMC-2 only.
"EraB" 1951 to 1990; adds the LZ 127 Graf Zeppelin.
"EraC" After 1990; adds the Zeppelin NT.

BlimpUtil.BlimpData

record base/tealdef/game_mechanics/fun_elements/blimp_util.d.tl:17

record BlimpData

Notes

Saved state of one airship. It is also sent to the entity as custom state blimpData.

Used in the base game: 7 times in 3 files

base/content/vehicle/zeppelin/shared/shared/transformator_zeppelin.script.tl:11

local blimpData = zeppelinState.blimpData as BlimpUtil.BlimpData
base/content/game_mechanics/game_mechanics/fun_elements/blimp_util.tl:58
local setVelocity = function(data : BlimpUtil.BlimpData, velocityNew : Vec3f, dt : number)
base/content/game_mechanics/game_mechanics/fun_elements/fun_elements.script.tl:34
blimp_util.spawnNew(townEntity, function(blimpData : BlimpUtil.BlimpData)

Fields

Name Type Description
blimpEntity EntityUtil.EntityAndRevision Airship entity.
townEntity EntityUtil.EntityAndRevision Town the airship circles.
era Era Era at spawn time.
state BlimpState Current flight stage.
velocity {number} Velocity as {x, y, z} in metres per second.
velocityNormalized number Current speed (length of velocity).
velocityMin number Minimum cruise speed (5).
velocityMax number Maximum cruise speed (15).
roll number Turn rate estimated from the last velocity change; negative when turning right.
elevator number Vertical speed divided by the maximum cruise speed.
flyHeight number Height above the town at spawn, 105 to 150 metres.
flyRadius number Distance from the town centre at spawn, 125 to 250 metres.
target {number} Current target position as {x, y, z}.
targetSetTime number Game time (ms) when target was set. After 20 seconds the airship picks a new target even if it has not reached it.