Page 1 of 1

Research

Posted: Wed Oct 21, 2015 10:23 am
by MrDrummer
So i have two things that i am trying to figure out.
1. I want to be able to reverse the num-quick-bars quantity in console (for my toolbelt mod so if the player does not like the number of toolbelts, they can execute this command and it will remove one)

2. The ability to execute a standard command on research (like /c game.player.force.manual_crafting_speed_modifier=1000, /c game.player.force.manual_mining_speed_modifier=1000 or even
game.peacefulmode = false)


Hope i am not asking something totally obvious, but i am new to Lua in general :)

Re: Research

Posted: Wed Oct 21, 2015 10:31 am
by ratchetfreak
2. check out the event on_research_finished https://forums.factorio.com/wiki/inde ... h_finished in there you check which research was done and then execute whatever code you which on the force that did the research

Re: Research

Posted: Wed Oct 21, 2015 10:33 am
by Choumiko
MrDrummer wrote:So i have two things that i am trying to figure out.
1. I want to be able to reverse the num-quick-bars quantity in console (for my toolbelt mod so if the player does not like the number of toolbelts, they can execute this command and it will remove one)

2. The ability to execute a standard command on research (like /c game.player.force.manual_crafting_speed_modifier=1000, /c game.player.force.manual_mining_speed_modifier=1000 or even
game.peacefulmode = false)
1. https://forums.factorio.com/wiki/inde ... kbar_count (/c game.local_player.force.quickbar_count = 3)

2. https://forums.factorio.com/wiki/inde ... h_finished
A little sample:

Code: Select all

script.on_event(defines.events.on_research_finished, function(event)
  if event.research.name == "character-logistic-trash-slots-1" then
    for _, player in pairs(event.research.force.players) do
      gui_init(player, "trash")
    end
    return
  end
  if event.research.name == "character-logistic-trash-slots-2" then
    global.configSize[event.research.force.name] = 30
  end
end)

Re: Research

Posted: Wed Oct 21, 2015 11:04 am
by MrDrummer
Man, i need to learn Lua... Thanks for the quick response guys :) No doubt i will need help regarding no.2 again :)