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

Place to get help with not working mods / modding interface.
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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
Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

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

Post 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.
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

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

Post 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}
    }
  }
}
)
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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",
User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

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

Post 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
  },
}
)
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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?
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

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

Post 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.
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.
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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
Last edited by overabuncdance on Sun Nov 16, 2014 11:55 pm, edited 1 time in total.
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

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

Post 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.
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.
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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
n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

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

Post 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
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.
overabuncdance
Inserter
Inserter
Posts: 21
Joined: Sun Oct 05, 2014 2:39 am
Contact:

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

Post 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
User avatar
cube
Former Staff
Former Staff
Posts: 1111
Joined: Tue Mar 05, 2013 8:14 pm
Contact:

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

Post by cube »

Whoa, that's a lot of mods :-)

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

Return to “Modding help”