|Has anyone had any luck modifying horse fitness and/or riding percentage? I can't find anything useful in the source scripts sadly, but I assume the values are there somewhere.
|Jean Fainges (Makrond)||25.12.2021 06:07|
|From the Rideable specialisation:
local spec = self.spec_rideable
if spec.cluster ~= nil and spec.currentSpeed ~= 0.0 then
local ridingTime = spec.cluster:getDailyRidingTime()
local changeDelta = ridingTime / 100
local speedFactor = 1
local gaitType = spec.inputValues.currentGait
if gaitType == Rideable.GAITTYPES.CANTER then
speedFactor = 2
elseif gaitType == Rideable.GAITTYPES.GALLOP then
speedFactor = 3
spec.ridingTimer = spec.ridingTimer + (dt*speedFactor)
if spec.ridingTimer > changeDelta then
spec.ridingTimer = 0
spec.cluster:changeRiding(1) -- I believe these are the values you're looking for
if self.lastMovedDistance > 0.001 then
local stats = g_currentMission:farmStats(self:getOwnerFarmId())
local distance = self.lastMovedDistance*0.001
Rideable also provides a getCluster() function so you can access the cluster of a specific instance from other classes.
|Aha! Thank you very much! Going to see what I can do with changeRiding and report back, in case someone else is looking for the same.
|And done, although I had to do some recursive table printing to find the proper function and all:
Note: Log in to post. Create a new account here.