Research

Place to get help with not working mods / modding interface.
MrDrummer
Fast Inserter
Fast Inserter
Posts: 132
Joined: Sat Nov 22, 2014 2:51 pm
Contact:

Research

Post 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 :)
ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Research

Post 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
Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Research

Post 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)
MrDrummer
Fast Inserter
Fast Inserter
Posts: 132
Joined: Sat Nov 22, 2014 2:51 pm
Contact:

Re: Research

Post by MrDrummer »

Man, i need to learn Lua... Thanks for the quick response guys :) No doubt i will need help regarding no.2 again :)
Post Reply

Return to “Modding help”