Radar Equipment


A portable radar that can be placed in equipment grids. Designed for driving the tank remotely in Space Age.

Utilities
9 months ago
2.0
5.05K
Transportation

b when driving

14 days ago

When (manually) driving the tank at night with the radar equipment, it gets day again when you are in the tank. Would be nice if it would just stay night :-)

21 hours ago

Found the root cause and have a proposed fix for this.

The radar-equipment prototype is of type night-vision-equipment, which is used so the equipment can drain energy from the vehicle grid. The side effect is that it also activates the night vision LUT (colour grading) when it has power — which is what's turning night into day inside the tank.

The fix is two-part:

  1. In the prototype, set darkness_to_turn_on = 1 so the night vision effect never visually activates to disable the automatic drain.
  2. In control.lua, drain the energy buffer manually by script instead, so the power consumption still works correctly:
local ENERGY_DRAIN_PER_UPDATE = 30000 * 5  -- 30kW * 5 seconds = 150,000 J

-- inside update(), before the has_energy check:
if not equipment.to_be_removed then
    equipment.energy = math.max(0, equipment.energy - ENERGY_DRAIN_PER_UPDATE)
end

The drain is expressed per update cycle (every 5 seconds) to match the existing % (60 * 5) cadence in the on_tick handler. The existing has_energy check then works as before.

New response