RPG System


This mod adds a basic RPG system to the game (XP, level-up and skills)

a month ago
0.16 - 2.0
134K
Combat Armor

i If possible please close skill assignment window when escape is pressed

2 years ago

Thanks!

7 months ago

This script seem to handle opening/closing the RPG frame by itself. I guess it should rather listen on defines.events.on_gui_switch_state_changed and not on_event("key-I", foo). So even the key i is fixed.

2 months ago
(updated 2 months ago)

Hello, I have fixed this. If you would like to fix it yourself, follow these steps exactly.

  1. open your mods folder (usually C:\Users\YOURNAME\AppData\Roaming\Factorio\mods)
  2. use 7z or similar and select the option "Extract to RPGsystem_2.0.5" NOT "Extract here"
  3. open the RPGsystem_2.0.5 folder and then open control.lua in a text editor, preferably something better than notepad (I use Notepad++)

You are going to make two changes to this code:

  1. First, ctrl+F for player.gui.screen.add
  2. Make a new line directly below that ^ line, and then paste this: player.opened = frame
  3. Now ctrl+F for on_gui_opened
  4. In the EMPTY SPACE below the line you just ctrl+F'd to, paste this entire code block:
script.on_event(defines.events.on_gui_closed, function(event)
    local player = game.players[event.player_index]
    if event.gui_type == defines.gui_type.custom then
        if player and event.element and event.element.name == "char-panel" then
            close_char_panel(player)
        end
    end
end)
  1. save and close the text file
  2. Re-zip the folder back into RPGsystem_2.0.5.zip (very important the name is exact, and say yes if it asks to replace any files)
  3. Delete the unzipped folder (not necessary but good tidiness)

That's it. The window should now close when you press ESC.

Very minor downside: Previously, if the window was opened and then you pressed E to open inventory, it would close the window AND open inventory. Now, it only closes the window and you must press it a second time to open your inventory. Minor, but worth mentioning.

2 months ago

I vote against it. This mod is an actively developed and maintained mod and making local changes makes it harder to update the mod as you have to repeat those steps again. Best is that this mod gets fixed and then all benefit from it.

2 months ago
(updated 2 months ago)

Well I'd make a pull request to implement the fix properly in the mod but the dude hasn't made a github (or hasn't linked it here at least). Besides, if he ever looks at these posts, he'll now know how to fix it himself without needing to figure it out.

New response