Enegry requierement and info layer

Place to get help with not working mods / modding interface.
Post Reply
Kexík
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Dec 01, 2014 12:52 pm
Contact:

Enegry requierement and info layer

Post by Kexík »

Hi i have question about info layer (i hope thats name for ALT layer where are arrows for inserters etc.)
Is posible change this layer for entity?

Two examples i wanna achieve.
1. I wanna add arrow (like inserter one) to my entity (one way pipe), is there any option of doing that besides creating item that is inserter type with invisible textures that creates my entity
2. If not can i disable Energy requierement notification for that inserter? Like that he is not connected to electric network or have no fuel.

Thanks for answer i am new to modding, i tried to search it but without mayor succes.

Degraine
Filter Inserter
Filter Inserter
Posts: 281
Joined: Wed Aug 13, 2014 10:49 am
Contact:

Re: Enegry requierement and info layer

Post by Degraine »

Just a guess, but have you tried the burner inserter instead? I never use them, but they don't require power so they probably shouldn't make the power catchment areas appear.

LordFedora
Filter Inserter
Filter Inserter
Posts: 310
Joined: Fri Nov 07, 2014 3:46 am
Contact:

Re: Enegry requierement and info layer

Post by LordFedora »

but they require fuel

Degraine
Filter Inserter
Filter Inserter
Posts: 281
Joined: Wed Aug 13, 2014 10:49 am
Contact:

Re: Enegry requierement and info layer

Post by Degraine »

Not the point - they're asking about something that won't cause the power grid overlay to appear when placing the item (AFAICT), while retaining the direction arrow thingy you get when placing inserters. I'm about to do something similar for my mod.

Kexík
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Dec 01, 2014 12:52 pm
Contact:

Re: Enegry requierement and info layer

Post by Kexík »

I will try them but they have power requirement icon too, but maybe i would be able to add them one wood at create. Thanks

Kexík
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Dec 01, 2014 12:52 pm
Contact:

Re: Enegry requierement and info layer

Post by Kexík »

So burning type working with this energy_source i dont get no fuel icon THX very much

Code: Select all

        energy_source =
        {
          type = "burner",
          effectivity = 100,
          fuel_inventory_size = 0,
        },
EDIT: Its not without any more modifications i had left some code that set inserter variable active to false after creation without it factorio will crash!

User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Enegry requierement and info layer

Post by L0771 »

Kexík wrote:1. I wanna add arrow (like inserter one) to my entity (one way pipe), is there any option of doing that besides creating item that is inserter type with invisible textures that creates my entity
If your entity manipule fluids you need a pipe, can see here. If manipule items is like a sppliter, see here (I only know he use sppliters with arrows)
Kexík wrote:2. If not can i disable Energy requierement notification for that inserter? Like that he is not connected to electric network or have no fuel.
I think no. If you know a way, please tell me :)

Kexík
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Dec 01, 2014 12:52 pm
Contact:

Re: Enegry requierement and info layer

Post by Kexík »

L0771 wrote:
Kexík wrote:1. I wanna add arrow (like inserter one) to my entity (one way pipe), is there any option of doing that besides creating item that is inserter type with invisible textures that creates my entity
If your entity manipule fluids you need a pipe, can see here. If manipule items is like a sppliter, see here (I only know he use sppliters with arrows)
Kexík wrote:2. If not can i disable Energy requierement notification for that inserter? Like that he is not connected to electric network or have no fuel.
I think no. If you know a way, please tell me :)
I wanna use inserter arrow because pump arrow is visible only with mouse over, i dont wanna use pump as pipe because it would 1] need energy 2] pump liquid so i am using underground pipes and arrows are different entity

If you wanna use entity that need energy source as dummy entity (for example like me, inserter only for arrows) and suppres energy/fuel requirement icon you can do this:

When creating entity you will set energy source as this:

Code: Select all

        energy_source =
        {
          type = "burner",
          effectivity = 100,
          fuel_inventory_size = 0,
        },
In script:

Code: Select all

game.onevent(defines.events.onbuiltentity, function(event)
    if (event ~= nil) and (event.createdentity ~= nil) and (event.createdentity.name == "your-dummy-inserter") then
        event.createdentity.active = false
    end
end)
Entity will do nothing, but will not show you nofuel icon and will show you arrows :]

User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Enegry requierement and info layer

Post by L0771 »

Kexík wrote:

Code: Select all

        energy_source =
        {
          type = "burner",
          effectivity = 100,
          fuel_inventory_size = 0,
        },
I think if for some reason, this entity is clicked, the game will crash.
Try with "electric" and active = "false".
but this item don't work :( I want this for a mine without energy (work with pollution :P)

Kexík
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Dec 01, 2014 12:52 pm
Contact:

Re: Enegry requierement and info layer

Post by Kexík »

As i said it work only if you dont wanna entity do anything, i tried electric, but there is problem that electric have icon when its not connected to grid that doesnt disapear, i will more tests and soon release my io-pipe to the mod if it will not crash in any situation i try, maybe i missed something that i should tell you, you will see

User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Enegry requierement and info layer

Post by L0771 »

Kexík wrote:As i said it work only if you dont wanna entity do anything, i tried electric, but there is problem that electric have icon when its not connected to grid that doesnt disapear, i will more tests and soon release my io-pipe to the mod if it will not crash in any situation i try, maybe i missed something that i should tell you, you will see
if you have any problem, post here, if have a code is easier helps you ;)

Kexík
Long Handed Inserter
Long Handed Inserter
Posts: 71
Joined: Mon Dec 01, 2014 12:52 pm
Contact:

Re: Enegry requierement and info layer

Post by Kexík »

So i finnished I/O pipe for my mod pipe is added in this commit Its created with "burning inserter". For anyone who wanna use inserter arrow for his own indication. I had some crash during development, but i was able every crash i got fix.

Post Reply

Return to “Modding help”