Jump to content

Prefab gatherable/minable distance (list of parameters)

Recommended Posts

I'm in search of any info is there a way to increase minable/gatherable distance of a plant/deposit prefab. I can set collision physics alright but gather range is nowhere to be found. =(

Is there some comprehensive list of prefab parameters? Cuz all the guides focus on specifics and no complete list there to find. Makes modding some stuff hard and requires to search for similar and repurpose for myself. And that is really time consuming. T_T

Link to comment
Share on other sites

The code involved happens here. When the locomotor is asked to go to something, it calculates an arrival distance. It is either specifically set in the buffered action (an attack, chop or whatever) OR calculated using a constant called ARRIVE_STEP and the physics-radius of both insts involved. This arrival distance is used in its OnUpdate() and when the locomotor is within the arrival distance, it fires the buffered action.

Have fun :) At least it's public.

function LocoMotor:GoToEntity(target, bufferedaction, run)
    self.dest = Dest(target)
    self.throttle = 1

    self.wantstomoveforward = true

    local arrive_dist = nil
    if bufferedaction ~= nil and bufferedaction.distance ~= nil then
        arrive_dist = bufferedaction.distance
        arrive_dist = ARRIVE_STEP + target:GetPhysicsRadius(0) + self.inst:GetPhysicsRadius(0)

        local extra_arrive_dist = (bufferedaction ~= nil and bufferedaction.action ~= nil and bufferedaction.action.extra_arrive_dist) or nil
        if extra_arrive_dist ~= nil then
            arrive_dist = arrive_dist + extra_arrive_dist(self.inst, self.dest)

        if bufferedaction ~= nil and bufferedaction.action.mindistance ~= nil and bufferedaction.action.mindistance > arrive_dist then
            arrive_dist = bufferedaction.action.mindistance

    self.arrive_dist = arrive_dist
lots more code in locomotor.lua


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...