[0.11.11+] FARL 0.2.8 (Rail Layer)

The raillayer; must have, if you want to play with railway.

Moderator: Choumiko

Locked
Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [0.11.11+] FARL 0.1.9 (Rail Layer)

Post by Vitduo »

Please, make the mod translateable

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.11.11+] FARL 0.1.9 (Rail Layer)

Post by Choumiko »

Kane wrote:Getting a new type of crash when I came back to lay new line I had deleted a few tracks and then I started to go forward again and when I hit start or at least get to the end she crashes with the following error:
http://i.imgur.com/aOvxg1N.jpg

Edit: I found out this was caused by some how my engine flipping and causing it to sort of go backwards and cause this error.
Could be both, i'll look into it, thanks.
Vitduo wrote:Please, make the mod translateable
It should be already. The gui uses locale files, only error messages are still hardcoded

Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [0.11.11+] FARL 0.1.9 (Rail Layer)

Post by Vitduo »

Choumiko wrote:It should be already. The gui uses locale files, only error messages are still hardcoded
If so, add the Ukrainian translation: https://www.dropbox.com/s/aj64qw3no6504py/FARL.zip?dl=0

StoneLegion
Filter Inserter
Filter Inserter
Posts: 668
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [0.11.11+] FARL 0.1.9 (Rail Layer)

Post by StoneLegion »

Love this mod it needs a bump. Also a small bug I like to report. I'm using a double engine setup. I find the farl tends to place tracks based on the 1 engine and not the engine your in and direction your going. So if you are going to fast or actually just trying to gas it you end up hitting the edge of the track and stopping none stop. But then if you go the other direction it goes just fine. It seems like farl will take one engine into account and not the one your in I guess.

Thanks :)

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

[0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Choumiko »

New version: FARL 0.2.1

Changes:
  • fixed that items got removed from all wagons
    fixed items not being removed for non vanilla wagons
    update cargo when de-/activated
    added ukranian translation
The first change was very "funny". Up until 0.2.0 if you had more than one wagon with items in it, FARL would take one rail/pole/lamp out of every wagon for each single item placed, so if you had 5 wagons with rails in it, each placed rail actually cost you 5 rails :D
Kane wrote:Love this mod it needs a bump. Also a small bug I like to report. I'm using a double engine setup. I find the farl tends to place tracks based on the 1 engine and not the engine your in and direction your going. So if you are going to fast or actually just trying to gas it you end up hitting the edge of the track and stopping none stop. But then if you go the other direction it goes just fine. It seems like farl will take one engine into account and not the one your in I guess.
I think i get what you mean, will try to fix this one tomorrow, this should also fix the other bug you reported (and which i completely forgot about until now, sorry)

Edit: updated link to 0.2.1

Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Airat9000 »

:( new version not techology rail (old version)

Image

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Choumiko »

Airat9000 wrote::( new version not techology rail (old version)
I'm not sure what that picture means. FARL supports placing powered rails from 5dims mod. The picture says you are using factorio 0.11.6, FARL won't work with that.

StoneLegion
Filter Inserter
Filter Inserter
Posts: 668
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by StoneLegion »

Here is a very rare crash I get at times. I can't ever really repeat it and it's super rare but just thought I post it anyways in case it does help. I was clicking the button to lay track and boom :)

Version 2.1:
http://i.imgur.com/i7S3kxU.jpg

Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Airat9000 »

Choumiko wrote:
Airat9000 wrote::( new version not techology rail (old version)
I'm not sure what that picture means. FARL supports placing powered rails from 5dims mod. The picture says you are using factorio 0.11.6, FARL won't work with that.
:( can you get to do a 16 version? that would play, thank you in advance

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by n9103 »

Airat9000 wrote: :( can you get to do a 16 version? that would play, thank you in advance
This has been compatible with .16 since ver 1.9
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.

User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Cheata »

If anybody is interested iv tweaked this mod to work with the landfill mod and allow the FARL to build across lakes let me know if you want me to upload my copy or if Choumiko wants my source to intergrate with his exelent mod.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Choumiko »

Cheata wrote:If anybody is interested iv tweaked this mod to work with the landfill mod and allow the FARL to build across lakes let me know if you want me to upload my copy or if Choumiko wants my source to intergrate with his exelent mod.
Nice, that's something i would have done anyways sometime. If you post your source i'll include it in one of the next versions

waduk
Filter Inserter
Filter Inserter
Posts: 372
Joined: Tue Feb 10, 2015 5:44 pm
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by waduk »

Landfill and FARL working together ?
Make it happen guys !

Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [0.11.11+] FARL 0.2.1 (Rail Layer)

Post by Airat9000 »

Choumiko wrote:
Cheata wrote:If anybody is interested iv tweaked this mod to work with the landfill mod and allow the FARL to build across lakes let me know if you want me to upload my copy or if Choumiko wants my source to intergrate with his exelent mod.
Nice, that's something i would have done anyways sometime. If you post your source i'll include it in one of the next versions
I put the version 0.1.9
but still can not see ((to reset the codes.

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: [0.11.11+] FARL 0.2.2 (Rail Layer)

Post by Choumiko »

New version FARL 0.2.2

Changes
  • support for double headed trains
    FARL locomotive doesn't have to be the first wagon/loco
Should fix the issues Kane reported, you still have to sit in the FARL that faces in the direction you want to go though, but now even silly/funny setups like this should work:
Image

@Airat: I absolutely don't know what you are trying to say. For FARL to work you need: Factorio 0.11.11 or higher and you need to research rail signals in your game. If you have rail signals researched try typing /c remote.call("farl", "reset") in the console and it should unlock. If it's another problem, please write a reply in your native language and provide a google translate with it, maybe then i can help you

Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [0.11.11+] FARL 0.2.2 (Rail Layer)

Post by Airat9000 »

Choumiko wrote:New version FARL 0.2.2

Changes
  • support for double headed trains
    FARL locomotive doesn't have to be the first wagon/loco
Should fix the issues Kane reported, you still have to sit in the FARL that faces in the direction you want to go though, but now even silly/funny setups like this should work:
Image

@Airat: I absolutely don't know what you are trying to say. For FARL to work you need: Factorio 0.11.11 or higher and you need to research rail signals in your game. If you have rail signals researched try typing /c remote.call("farl", "reset") in the console and it should unlock. If it's another problem, please write a reply in your native language and provide a google translate with it, maybe then i can help you

not work in code
/c remote.call("farl", "reset")

screen


techology is open

Image
Image

StoneLegion
Filter Inserter
Filter Inserter
Posts: 668
Joined: Fri Sep 05, 2014 7:34 pm
Contact:

Re: [0.11.11+] FARL 0.2.2 (Rail Layer)

Post by StoneLegion »

Thank you for the wonderful update.

User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.11+] FARL 0.2.2 (Rail Layer)

Post by Cheata »

The changes i made are in the code sections below broken up by file and in the order of insert (seperated by ***************************)

Please note that in order to make this work i also modified the landfill mod control.lua with the following line

Code: Select all

remote.addinterface("Landfill",{})
however this is not necessary if a minor modification is made to my code.

simply replace each instance of

Code: Select all

if remote.interfaces["Landfill"] then
with

Code: Select all

if game.entityprototypes["landfill2by2"] then
its just that i perfer to test on interfaces.

also note that i have only modified the english language file somone else will need to make the necessary change in the uk.cfg

using landfill version 2.1.2 and working from FARL version 0.2.1

control.lua

Code: Select all

local function initGlob()
---------><---------------
if glob.poles == nil then
      glob.poles = true
    end
-- added initilisation for global variable "bridge" ~line 182
    if glob.bridge == nill then
      glob.bridge = true
    end
-- end of mod
    if glob.flipSignals == nil then
      glob.flipSignals = false
end

GUI.lua

Code: Select all

    init = function()
      GUI.bindings = {
        signals = glob.signals,
        poles = glob.poles,
        flipSignals = glob.flipSignals,
        medium = glob.medium,
        minPoles = glob.minPoles,
        ccNet = glob.settings.ccNet,       <---------- dont forget to add the comma at the end of this line XD
-- add initilization for bridge variable from global settings ~line 45
        bridge = glob.bridge
-- end of mod
      }
    end

***********************
      createGui = function(player)
      if player.gui.left.farl ~= nil then return end
        local farl = GUI.add(player.gui.left, {type="frame", direction="vertical", name="farl"})
        local rows = GUI.add(farl, {type="table", name="rows", colspan=1})
        local buttons = GUI.add(rows, {type="table", name="buttons", colspan=3})
        GUI.addButton(buttons, {name="start"}, GUI.toggleStart)
        GUI.addButton(buttons, {name="cc"}, GUI.toggleCC)
        GUI.addButton(buttons, {name="settings", caption={"text-settings"}}, GUI.toggleSettingsWindow)
        GUI.add(rows, {type="checkbox", name="signals", caption={"tgl-signal"}}, "signals")
        GUI.add(rows, {type="checkbox", name="poles", caption={"tgl-poles"}}, "poles")
-- added an option to turn "Bridging" on and off   at aprox line 83
        if remote.interfaces["Landfill"] then
          GUI.add(rows, {type="checkbox", name="bridge", caption={"tgl-bridge"}}, "railbridge")
        end
-- end of modification
      end

******************

onGuiClick = function(event, farl, player)
----------------><------------------
-- modify if statment for binary flip with additionl checkbox name "bridge" ~line 94
elseif name == "signals" or name == "poles" or name == "flipSignals" or name == "minPoles" or name == "bridge" then
-- end of mod
        glob[name] = not glob[name]
      elseif name == "ccNet" or name == "flipPoles" then
        glob.settings[name] = not glob.settings[name]
      elseif name == "poweredRails" then
        if not remote.interfaces.dim_trains then
          glob.rail = rails.basic
          return
        end
        glob.settings.electric = not glob.settings.electric
        if glob.settings.electric then
          glob.rail = rails.electric
        else
          glob.rail = rails.basic        
        end
        farl.lastrail = false
      elseif name == "junctionLeft" then
        farl:createJunction(0)
      elseif name == "junctionRight" then
        farl:createJunction(2)
      end

FARL.lua

Code: Select all

-- actual land placement code added to the general cleanup function "removeTrees"
removeTrees = function(self,pos, area)
    if not area then
      area = {{pos.x - 1.5, pos.y - 1.5}, {pos.x + 1.5, pos.y + 1.5}}
    else
      local tl, lr = fixPos(addPos(pos,area[1])), fixPos(addPos(pos,area[2]))
      area = {{tl[1]-1,tl[2]-1},{lr[1]+1,lr[2]+1}}
    end

    for _, entity in ipairs(game.findentitiesfiltered{area = area, type = "tree"}) do
      entity.die()
      if not godmode then self:addItemToCargo("raw-wood", 1) end
    end
    self:pickupItems(pos, area)
    if removeStone then
      for _, entity in ipairs(game.findentitiesfiltered{area = area, name = "stone-rock"}) do
        entity.die()
      end
    end
 -- Land Generation Script as follows starting ~line 115
-- check for landfill mod
    if remote.interfaces["Landfill"] then
    -- check if bridging is turned on in settings
      if glob.bridge then
     -- following code mostly pulled from landfill mod itself and adjusted to fit
        local tiles = {}
        local st, ft = area[1],area[2]
        for x = st[1], ft[1], 1 do
          for y = st[2], ft[2], 1 do
            tileName = game.gettile(x, y).name
      -- check that tile is water, if it is add it to a list of tiles to be changed to grass
            if tileName == "water" or tileName == "deepwater" then
              table.insert(tiles,{name="grass", position={x, y}})
            end
          end
        end
     -- check to make sure water tiles were found
        if #tiles ~= 0 then
     -- if they were calculate the minimum number of landfills to fill them in ( quick and dirty at the moment may need tweeking to prevent overusage)
          local lfills = math.ceil(#tiles/4)
      -- check to make sure there is enough landfill in the FARL and if there is apply the changes, remove landfill.  if not then show error message
          if self["landfill2by2"] > lfills then
            game.settiles(tiles)
            self:removeItemFromCargo("landfill2by2", lfills)
          else
            self:print("Out of 2 by 2 Landfill")
          end
        end
      end
    end
-- end of mod
  end

********************

updateCargo = function(self)
    local types = { "straight-rail", "curved-rail","rail-signal",
      "big-electric-pole", "medium-electric-pole", "small-lamp",
      "green-wire", "red-wire"
    }
    if remote.interfaces.dim_trains then
      table.insert(types, "straight-power-rail")
      table.insert(types, "curved-power-rail")
    else
      self["straight-power-rail"] = nil
      self["curved-power-rail"] = nil
    end
-- add landfill (landfill2by2) to the FARL contents update ~line437 (after adding previous code) 
    if remote.interfaces["Landfill"] then
      table.insert(types, "landfill2by2")
    end
-- end of mod
en.cfg

Code: Select all

-- add check box text to the language file ~line 9
tgl-bridge = Bridge Water
--end of mod
hopefully i havent missed anyting, let me know if you have any issues with it

enjoy :)
Last edited by Cheata on Mon Mar 09, 2015 9:15 am, edited 1 time in total.

User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.11+] FARL 0.2.2 (Rail Layer)

Post by Cheata »

Airat9000 wrote:
Choumiko wrote:New version FARL 0.2.2

not work in code
/c remote.call("farl", "reset")
um just a quick guess here but shouldnt the "farl" be "FARL" script is case sensitive isnt it?

User avatar
Cheata
Long Handed Inserter
Long Handed Inserter
Posts: 78
Joined: Sun Aug 17, 2014 6:46 am
Contact:

Re: [0.11.11+] FARL 0.2.2 (Rail Layer)

Post by Cheata »

lol 3 posts in a row... now i just look like a spammer :P

But seriously just wanted to say iv just spent 10 min following the instructions i posted above with the new version of FARL (v0.2.2) and it seems to have worked fine (except for the comma i forgot at the end of line 44 in the GUI.lua).

Let me know if there are any problems i havent spotted yet

Locked

Return to “F.A.R.L”