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

This subforum contains all the issues which we already resolved.

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

Postby binbinhfr » Sat Jun 11, 2016 10:45 pm

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
My mods on the Factorio Mod Portal :geek:
User avatar
binbinhfr
Smart Inserter
Smart Inserter
 
Posts: 1443
Joined: Sat Feb 27, 2016 7:37 pm
Location: South of France

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

Postby Klonan » Sat Jun 11, 2016 10:47 pm

Thanks for the report,

I guess i can fix this :)
User avatar
Klonan
Factorio Staff
Factorio Staff
 
Posts: 2697
Joined: Sun Jan 11, 2015 2:09 pm

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

Postby Rseding91 » Sat Jun 11, 2016 10:55 pm

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.
If you want to get ahold of me I'm almost always on IRC.
My Github page with my mods: https://github.com/Rseding91?tab=repositories
Find my mods on the mod portal: https://mods.factorio.com/mods/Rseding91
Rseding91
Factorio Staff
Factorio Staff
 
Posts: 5914
Joined: Wed Jun 11, 2014 5:23 am

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

Postby binbinhfr » Sun Jun 12, 2016 7:55 am

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...).
My mods on the Factorio Mod Portal :geek:
User avatar
binbinhfr
Smart Inserter
Smart Inserter
 
Posts: 1443
Joined: Sat Feb 27, 2016 7:37 pm
Location: South of France

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

Postby binbinhfr » Thu Jun 30, 2016 7:31 pm

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
My mods on the Factorio Mod Portal :geek:
User avatar
binbinhfr
Smart Inserter
Smart Inserter
 
Posts: 1443
Joined: Sat Feb 27, 2016 7:37 pm
Location: South of France


Return to Resolved Problems and Bugs

Who is online

Users browsing this forum: No registered users and 1 guest