Odd production time remaining text

The place to discuss scripting and game modifications for X Rebirth.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
User avatar
MegaJohnny
Posts: 1890
Joined: Wed, 4. Jun 08, 22:30

Odd production time remaining text

Post by MegaJohnny » Sat, 6. Jan 18, 22:31

So, this is mostly out of curiosity - but I've been perusing the code for the object detail menu, and found some strange logic for getting the production time left on a production module:

Code: Select all

local remainingtime = "4.2 " .. ReadText(1001, 112)
if proddata.state == "producing" and proddata.remainingtime == 0 then
    local clustermacro = GetComponentData(GetComponentData(menu.object, "clusterid"), "macro")
    if clustermacro == "cluster_a_macro" then
        -- Maelstrom
        remainingtime = "0.9 " .. ReadText(1001, 112)
    elseif clustermacro == "cluster_b_macro" then
        -- Albion
        remainingtime = "4.2 " .. ReadText(1001, 112)
    elseif clustermacro == "cluster_c_macro" then
        -- Omycron Lyrae
        remainingtime = "3.7 " .. ReadText(1001, 112)
    elseif clustermacro == "cluster_d_macro" then
        -- DeVries
        remainingtime = "11.4 " .. ReadText(1001, 112)
    end
else
    remainingtime = ConvertTimeString(proddata.remainingtime , "%h" .. ReadText(1001, 102) .. " %M" .. ReadText(1001, 103) .. " %S" .. ReadText(1001, 100))
end
Where text {1001, 112} is "Ga", with a comment saying it's giga-years. So if a production module is producing, but the remaining time is zero, I suppose this means it produces indefinitely. But every vanillla cluster gets a different fixed "very long time" - is this a funny way of saying it'll stop when the local star dies?!

I'm sure most others have observed this in-game, but I haven't properly played in a while, so this is all unfamiliar to me.

UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 13817
Joined: Sun, 20. Nov 05, 23:45

Post by UniTrader » Sun, 7. Jan 18, 14:39

yep, thats the Display Logic for Solar Power Plants or "a funny way of saying it'll stop when the local star dies".
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)

Post Reply

Return to “X Rebirth - Scripts and Modding”