Page 1 of 1

Number of "rockets sent" reset to 1 if score window deleted

Posted: Sat Jun 11, 2016 10:45 pm
by binbinhfr
if you delete the rocket score window (by console, or by a mod), at the next rocket you launch, the window is reopened but the score is set to 1. You must wait the next launch to see a correct score.

This could be corrected in the control.lua of the map (rocket event) :

Code: Select all

    for index, player in pairs(force.players) do
      if player.gui.left.rocket_score == nil then
        local frame = player.gui.left.add{name = "rocket_score", type = "frame", direction = "horizontal", caption={"score"}}
        frame.add{name="rocket_count_label", type = "label", caption={"", {"rockets-sent"}, ""}}
        frame.add{name="rocket_count", type = "label", caption="1"}  -- PROBLEM
      else
        player.gui.left.rocket_score.rocket_count.caption = tostring(global.satellite_sent[force.name])
      end
    end
should better be :

Code: Select all

    for index, player in pairs(force.players) do
      if player.gui.left.rocket_score == nil then
        local frame = player.gui.left.add{name = "rocket_score", type = "frame", direction = "horizontal", caption={"score"}}
        frame.add{name="rocket_count_label", type = "label", caption={"", {"rockets-sent"}, ""}}
        frame.add{name="rocket_count", type = "label", caption=tostring(global.satellite_sent[force.name])}
      else
        player.gui.left.rocket_score.rocket_count.caption = tostring(global.satellite_sent[force.name])
      end
    end

Re: Number of "rockets sent" reset to 1 if score window deleted

Posted: Sat Jun 11, 2016 10:47 pm
by Klonan
Thanks for the report,

I guess i can fix this :)

Re: Number of "rockets sent" reset to 1 if score window deleted

Posted: Sat Jun 11, 2016 10:55 pm
by Rseding91
Klonan wrote:Thanks for the report,

I guess i can fix this :)
While you're at it add a remote interface to read the rockets sent so other mods can get that information without needing to track it themselves.

Re: Number of "rockets sent" reset to 1 if score window deleted

Posted: Sun Jun 12, 2016 7:55 am
by binbinhfr
Rseding91 wrote:While you're at it add a remote interface to read the rockets sent so other mods can get that information without needing to track it themselves.
Great idea ! It would be useful for my new mod that has to leach the original score window before closing it ;-)

viewtopic.php?f=92&t=26519

A nice idea would also be to trigger the rocket event at the very beginning of the launch and not only when the rocket is far away.
And to have an easy access to the satellite slot (it would be useful for other mods that use this slot like Orbital Cannon, etc...).

Re: Number of "rockets sent" reset to 1 if score window deleted

Posted: Thu Jun 30, 2016 7:31 pm
by binbinhfr
I see that you implement this change in 0.13. Nice !

But please have a look at this other request, easy to implement, like the previous one...
viewtopic.php?f=28&t=26840