Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
ExtendedAIVehicle
DescriptionSpecialization to track ai helper costsFunctions
prerequisitesPresent
DescriptionChecks if all prerequisite specializations are loadedDefinition
prerequisitesPresent(table specializations)Arguments
table | specializations | specializations |
boolean | hasPrerequisite | true if all prerequisite specializations are loaded |
19 | function ExtendedAIVehicle.prerequisitesPresent(specializations) |
20 | return SpecializationUtil.hasSpecialization(AIFieldWorker, specializations) and SpecializationUtil.hasSpecialization(PrecisionFarmingStatistic, specializations) |
21 | end |
updateAIFieldWorkerLowFrequency
DescriptionDefinitionupdateAIFieldWorkerLowFrequency()Code
35 | function ExtendedAIVehicle:updateAIFieldWorkerLowFrequency(superFunc, dt) |
36 | if self:getIsAIActive() then |
37 | local difficultyMultiplier = g_currentMission.missionInfo.buyPriceMultiplier; |
38 | local price = -dt * difficultyMultiplier * AIJobFieldWork.getPricePerMs(nil) |
39 | |
40 | local farmlandStatistics, _, farmlandId = self:getPFStatisticInfo() |
41 | if farmlandStatistics ~= nil then |
42 | if farmlandId ~= nil then |
43 | farmlandStatistics:updateStatistic(farmlandId, "helperCosts", -price) |
44 | end |
45 | end |
46 | end |
47 | |
48 | superFunc(self, dt) |
49 | end |