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
ExtendedWearable
DescriptionSpecialization to track vehicle wear costsFunctions
onPostUpdateTick
DescriptionDefinitiononPostUpdateTick()Code
44 | function ExtendedWearable:onPostUpdateTick(dt, isActive, isActiveForInput, isSelected) |
45 | local spec = self.spec_extendedWearable |
46 | |
47 | local damage = self.spec_wearable.damage |
48 | if spec.lastDamage > 0 then |
49 | local price = self:getPrice() |
50 | local lastRepairPrice = Wearable.calculateRepairPrice(price, spec.lastDamage) |
51 | local repairPrice = Wearable.calculateRepairPrice(price, damage) |
52 | local repairCosts = repairPrice - lastRepairPrice |
53 | if repairCosts > 0 then |
54 | local farmlandStatistics, isOnField, farmlandId = self:getPFStatisticInfo() |
55 | if isOnField then |
56 | if farmlandStatistics ~= nil then |
57 | if farmlandId ~= nil then |
58 | farmlandStatistics:updateStatistic(farmlandId, "vehicleCosts", repairCosts) |
59 | end |
60 | end |
61 | end |
62 | end |
63 | end |
64 | |
65 | spec.lastDamage = damage |
66 | end |
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 ExtendedWearable.prerequisitesPresent(specializations) |
20 | return SpecializationUtil.hasSpecialization(Wearable, specializations) and SpecializationUtil.hasSpecialization(PrecisionFarmingStatistic, specializations) |
21 | end |