Page 1 of 1

2 things; code where beacons "work" & a problem with coding

Posted: Sun Nov 16, 2014 8:47 am
by overabuncdance
where do i fdin teh code that actually makes a beacon work?

and i get the error

Code: Select all

---------------------------
Error
---------------------------
...orio_0.11.1.12084\mods\building expansion_0.0.0|data.lua:1: ...ilding expansion_0.0.0|prototypes\entities\buildings.lua:16: '}' expected (to close '{' at line 3) near 'base_picture'
---------------------------
OK   
---------------------------
with this code

Code: Select all

data:extend(
{
  {
    type = "beacon",
    name = "Beacon vII",
    icon = "building expansion/graphics/icons/beaconv2.png",
    flags = {"placeable-player", "player-creation"},
    minable = {mining_time = 1, result = "basic-beacon"},
    max_health = 200,
    corpse = "big-remnants",
    dying_explosion = "huge-explosion",
    collision_box = {{-1.5, -1.5}, {1.5, 1.5}},
    selection_box = {{-2, -2}, {2, 2}},
    allowed_effects = {"consumption", "speed", "pollution"},
    energy_usage = 20
    base_picture =
    {
      filename = "building expansion/graphics/beacomv2base.png",
      width = 116,
      height = 93,
      shift = { 0.34, 0.06}
    }
  }
}
)

maybe i am tired and just need sleep but i dont understand my problem

edit: sorry for posting here as well as reddit with the same post

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 4:09 pm
by Rahjital
What exactly are you trying to do? If you want to increase the range, perhaps raising energy_usage could work. Also, you are missing a comma behind that same attribute.

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 4:42 pm
by L0771
Hi, maybe only need a "," between energy_usage and base_picture

Code: Select all

data:extend(
{
  {
    type = "beacon",
    name = "Beacon vII",
    icon = "building expansion/graphics/icons/beaconv2.png",
    flags = {"placeable-player", "player-creation"},
    minable = {mining_time = 1, result = "basic-beacon"},
    max_health = 200,
    corpse = "big-remnants",
    dying_explosion = "huge-explosion",
    collision_box = {{-1.5, -1.5}, {1.5, 1.5}},
    selection_box = {{-2, -2}, {2, 2}},
    allowed_effects = {"consumption", "speed", "pollution"},
    energy_usage = 20,
    base_picture =
    {
      filename = "building expansion/graphics/beacomv2base.png",
      width = 116,
      height = 93,
      shift = { 0.34, 0.06}
    }
  }
}
)

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 6:38 pm
by overabuncdance
thanks and i found the code to modify what the beacon does, it is the last three lines of the entity in the block in base


but now i have a new error

Code: Select all

---------------------------
Error
---------------------------
Error in assignID, 'Beacon vII' was not recognized id of item
---------------------------
OK   
---------------------------
everything is changed Beacon vII and i have entity name = "Beacon vII",

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 7:06 pm
by L0771
[type = "beacon"] is a entity, an entity basically are all objects in the map (like trees, machines, players, enemies, etc)
If you want build that entity, you need add a [type = "item"]

Code: Select all

data:extend(
{
  {
    type = "item",
    name = "Beacon vII",
    icon = "__base__/graphics/icons/basic-beacon.png",
    flags = {"goes-to-quickbar"},
    subgroup = "module",
    order = "a[beacon]",
    place_result = "Beacon vII",
    stack_size = 10
  },
}
)

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 8:03 pm
by overabuncdance
thanks for that now i have another problem :[

---------------------------
Error
---------------------------
Path __building expansions__/graphics/icons/beaconv2.png does not match any mod.
---------------------------
OK
---------------------------

what does this mean?

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 9:20 pm
by n9103
Path errors mean you're addressing a file that doesn't exist.
Either your path to the mod folder doesn't follow the naming convention, or more likely in this case, you don't actually have a beacon v2 graphic in the graphics/icons/ folder.

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 11:20 pm
by overabuncdance
but i reference it my mod multiple times as the icon for the beacon vII

Code: Select all

   icon = "__building expansions__/graphics/icons/beaconv2.png",

Code: Select all

    icon = "__building_expansions__/graphics/icons/beaconv2.png",

Code: Select all

    icon = "__building expansion__/graphics/icons/beaconv2.png",
its also in teh folder building expansions / graphics /icons/ and is named beaconv2

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Sun Nov 16, 2014 11:48 pm
by n9103
You didn't really respond to my speculation on the likely problem, merely pasted the lines that reference the file.
I guess it's not unreasonable to then assume that this file already exists.

I see you switched between using "expansions" and "expansion", I'm sure that'll toss up an error.
My next guess is that your folder is called "building expansion", not "building expansions".
Pick one and correct all the references to the wrong one.

Hope this helps.

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Mon Nov 17, 2014 12:07 am
by overabuncdance
ah it was also the underscore in building_expansion; the game doesn't seem to care about spaces in the file name


thanks for help i will post if there are any more problems

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Mon Nov 17, 2014 3:04 am
by overabuncdance
for some reason my game crashes when i go to load a previous save so i am confused as to what is causing the problem

i can however start a new map so idk what the problem is

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Mon Nov 17, 2014 3:12 pm
by n9103
You're not going to get useful feedback, as you haven't provided any details.
At a minimum, you should provide:
Version from>to
Mods or stock
Error message & log

Possible causes:
Bad/corrupted save
Faulty migration script
Incompatible versions

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Tue Nov 18, 2014 8:47 pm
by overabuncdance
i am runnning 11.1

Code: Select all

{
    "mods": [
        {
            "name": "base",
            "enabled": "true"
        },
        {
            "name": "BeltBlocker",
            "enabled": "true"
        },
        {
            "name": "BeltStorage",
            "enabled": "true"
        },
        {
            "name": "DyTech-Automation",
            "enabled": "true"
        },
        {
            "name": "DyTech-Core",
            "enabled": "true"
        },
        {
            "name": "DyTech-Energy",
            "enabled": "true"
        },
        {
            "name": "DyTech-Inserters",
            "enabled": "true"
        },
        {
            "name": "DyTech-Logistic",
            "enabled": "true"
        },
        {
            "name": "DyTech-Metallurgy",
            "enabled": "true"
        },
        {
            "name": "DyTech-Modules",
            "enabled": "true"
        },
        {
            "name": "DyTech-Storage",
            "enabled": "true"
        },
        {
            "name": "DyTech-Tools",
            "enabled": "false"
        },
        {
            "name": "DyTech-Transportation",
            "enabled": "true"
        },
        {
            "name": "DyTech-Warfare",
            "enabled": "true"
        },
        {
            "name": "Item-Stack-Limit-Breaker",
            "enabled": "true"
        },
        {
            "name": "Larger Inventory",
            "enabled": "true"
        },
        {
            "name": "TimeButtons",
            "enabled": "true"
        },
        {
            "name": "Treefarm-Mod",
            "enabled": "true"
        },
        {
            "name": "alien-science",
            "enabled": "true"
        },
        {
            "name": "building expansion",
            "enabled": "true"
        },
        {
            "name": "endless-resources",
            "enabled": "true"
        },
        {
            "name": "no-evo",
            "enabled": "true"
        },
        {
            "name": "tankmod",
            "enabled": "true"
        },
        {
            "name": "terminalchest",
            "enabled": "true"
        }
    ]
}
and factorio just closes

and i dont know how to reach the log or error message

Re: 2 things; code where beacons "work" & a problem with cod

Posted: Thu Nov 20, 2014 1:07 pm
by cube
Whoa, that's a lot of mods :-)

How to find a log file: https://forums.factorio.com/wiki/inde ... e=Log_File