List of script commands
Contents
Scripts commands
Choose
These commands will pick some specific object from the map. The result could be used as input for many other script functions
- object ChooseIndustry(hash type, object aroundObject, object indexPrefered, float minDistance, float maxDistance, number maxHeightDifference)
- object ChooseStation(object aroundObject, object indexPrefered, float minDistance, float maxDistance, number maxHeightDifference)
- object ChooseDepot(object aroundObject, object indexPrefered, float minDistance, float maxDistance, number maxHeightDifference)
- object ChooseVehicle(hash type, object aroundObject, object indexPrefered, float minDistance, float maxDistance, number maxHeightDifference)
Tests
These functions will test some condition and return the amount or if it is true
- bool AreConnectedByTrack(object objectA, object objectB)
- bool AreNeighbors(object objectA, object objectB)
- bool IsTutorialEnabled()
- bool IsSandboxQuestEnabled()
- bool IsVehicleTurnaroundEnabled()
- number GetStartCash()
- number GetMaxLoan()
- number GetLoanInterest()
- number GetNewEraMode()
- number GetTrainFuelConsumption()
- number GetBuildCost()
- number GetTerrainEditCost()
- bool IsDepotAutoTrackLayingEnabled()
- bool IsRedSignalTurnAroundEnabled()
- bool IsPeroneEndTurnAroundEnabled()
- bool IsOverweightTurnAroundEnabled()
- bool IsNoCashStopEnabled()
- bool IsGoOnReverseEnabled()
- bool IsOneDepotModeEnabled()
Gui
By these functions, you can mainly affect user interface of quests and also define highlighted area on the map where some action may be for free or it just show some predefined space where script can react differently
- UpdateCaption(string caption)
- UpdateCaptionFormat(hash textId, string param1, string param2, string param3, string param4, string param5, string param6, string param7, string param8, string param9, string param10, string param11, string param12, string param13, string param14, string param15, string param16)
- UpdateText(string text)
- UpdateTextFormat(hash textId, string param1, string param2, string param3, string param4, string param5, string param6, string param7, string param8, string param9, string param10, string param11, string param12, string param13, string param14, string param15, string param16)
- UpdateOnScreenText(string text)
- UpdateOnScreenTextFormat(hash textId, string param1, string param2, string param3, string param4, string param5, string param6, string param7, string param8, string param9, string param10, string param11, string param12, string param13, string param14, string param15, string param16)
- AddButton(string caption, number tag, long image, bool enabled)
- AddButtonFormat(hash textId, number tag, number image, bool enabled, string param1, string param2, string param3, string param4, string param5, string param6, string param7, string param8, string param9, string param10, string param11, string param12, string param13, string param14, string param15, string param16)
- RmvButton(number tag)
- GuiHighlight(string itemName)
- number GetGuiMode()
- bool GetGuiChecked(string itemName)
- string GetGuiTag(string itemName)
- string GetLockOnObject()
- string GetLockUsingObject()
- number GetLockSubIndex()
- number GetLockCameraIndex()
- SetNumFreeActions(string actionName, number actionNumber)
- ClearFreeActionArea()
- AddFreeActionArea(number left, number top, number right, number bottom)
- AddFreeActionObject(object objectA, number range)
- SetVisibleSysButtons(bool visible)
Map
By these functions, you can modify map. There are ways how you can build new industry, modify terrain or even progress to another era on the map.
- Goto(string object, float zoom)
- number GetMapSize()
- string BuildStation(number trackId, object mapCenter, float minDist, float maxDist, number maxHeightDiff)
- string BuildIndustry(hash type, object mapCenter, float minDist, float maxDist, number maxHeightDiff)
- string GetName(string object)
- float GetXPosition(string object)
- float GetYPosition(string object)
- float GetZPosition(string object)
- Clear(float left, float top, float right, float bottom, number vegetationOnly, number generateMud)
- Flatten(float left, float top, float right, float bottom, object objectA, object objectB)
- GoToNextEpoch()
- SetEpoch(number epoch)
- number GetEpoch()
- number GetNumUpgrades(object objectA)
- number GetUpgrade(object objectA, number index)
- bool IsUpgradeBuilt(object objectA, number upgradeId)
- AddUpgrade(hash type, object objectA, number upgradeId)
- RmvUpgrade(hash type, object objectA, number upgradeId)
- number GetNumTracks(number trackId)
- float GetTracksLength(number trackId)
- number GetNumPlants(hash plantId)
- ConnectTwoPointsByRoad(object objectA, object objectB)
Tokens
To affect number of tokens, you can use these functions.
- AddTokens(hash tokenType, number amount)
- BorrowTokens(hash tokenType, number amount)
- long GetTokens(hash tokenType)
Vehicles
Variouse things could be done to one of players vehicles, here you can see the list of related functions
- object AddVehicle(hash type, object depo)
- RmvVehicle(object vehicle)
- AddVehicleBonus(object vehicle, number bonusType, float value)
- number GetNumWagons(object objectA, hash wagonType)
- number GetNumVehicles(object objectA)
- number VehicleGetStatus(object objectA)
- number Vehicle(object objectA)
- object DepoGetVehicle(object depo, hash engineType, number vehicleIndex)
- object VehicleGetWagonType(object vehicle, number wagonIndex)
- object GetOldestVehicle()
Quests
Also quests itself can do some modifications
- AddQuest(hash questId)
- RmvQuest(bool succ)
- HighlightQuest()
- ShowQuest(hash questId)
- PostponeQuest()
- ResumeQuest(object objectA)
- SetQuestVisible(bool visible)
- number GetNumQuestsDone(number type, hash questId)
- number GetNumQuestsActive(number type, hash questId)
Statistics
You can get some statistics about current map, or change the time.
Utils
To create arbitrary create some object reference, you can use one of these functions
- object MapCoord(float x, float y)
- object TextHash(hash hash)
- object IconHash(hash hash)
- object Number(number number)
- object Industry(number index)
- object Station(number index)
- object Depot(number index)
- object Vehicle(number index)
- object Town(number index)
- bool IsValid(object objectA)
- DbgText(string text)
- float GetSystemTime()
- float GetGameTime()