Creating new entity that has 0kw consumption
-
- Long Handed Inserter
- Posts: 92
- Joined: Sun Jun 18, 2017 2:21 pm
- Contact:
Creating new entity that has 0kw consumption
Hi, I want to create a radar that works without power grid, however when I place it with 0kw consumption setting the game crashes. I tried making it "solar" with 1w consumption but that didnt work- didn't crash the game tho. Is there a way to modify the energy source to allow it to function without power? I need it to scan only nearby sectors and only for a short duration (implementing charting will be more problematic)
Re: Creating new entity that has 0kw consumption
Probably no. The game have things like this hardcoded to the very depth of it.
This might have been uncalled for, but the following statement
This might have been uncalled for, but the following statement
caught my thought and I've spent fifteen minutes to prove the opposite:robertpaulson wrote:(implementing charting will be more problematic)
code
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: Creating new entity that has 0kw consumption
Creative mode mod has entities (including radar) that run without power, with power flashing icon still present.
-
- Long Handed Inserter
- Posts: 92
- Joined: Sun Jun 18, 2017 2:21 pm
- Contact:
Re: Creating new entity that has 0kw consumption
Well then, maybe I don't belong here or I'm really slow because it took me more than 15 to understand the code lol.... Much thanks for the work! btw, the variable e is never used, why is it there? to verify the r.next is there to simulate the radar scanning sector by sector? that's elegant!Adil wrote:Probably no. The game have things like this hardcoded to the very depth of it.
This might have been uncalled for, but the following statementcaught my thought and I've spent fifteen minutes to prove the opposite:robertpaulson wrote:(implementing charting will be more problematic)code
those can be removed with render_no_power_icon =false, but if its there the entity doesn't work on 0 power and the work is done by scripts (like the one provided by Adil, above)impetus maximus wrote:Creative mode mod has entities (including radar) that run without power, with power flashing icon still present.
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: Creating new entity that has 0kw consumption
ok, i'm not a coder/modder. just trying to help.
-
- Long Handed Inserter
- Posts: 92
- Joined: Sun Jun 18, 2017 2:21 pm
- Contact:
Re: Creating new entity that has 0kw consumption
no worries, I will probably take a look at the mod you mentioned. Thank you for info, and sorry if I came on rude, wasn't my intention. cheers.impetus maximus wrote:ok, i'm not a coder/modder. just trying to help.
- impetus maximus
- Smart Inserter
- Posts: 1299
- Joined: Sat Aug 20, 2016 10:07 pm
- Contact:
Re: Creating new entity that has 0kw consumption
not at all. cheers 

Re: Creating new entity that has 0kw consumption
You are welcome. Unused e is a typo, I've intended to read position, force and surface from it, not from r:robertpaulson wrote:Much thanks for the work! btw, the variable e is never used, why is it there? to verify the r.next is there to simulate the radar scanning sector by sector? that's elegant!
Code: Select all
local e=r.entity
local p,s,f=e.position,e.surface,e.force
Yes. r.next_x and r.next_y are there to keep track of the next chunk to scan.
Also, I'm lagging behind somewhat. We didn't have the `render_no_power_icon ` field back then. With that, who knows, maybe adding a buffer to the entity's power source (like roboport has) and using scripts to refill it, will suffice.
something like this
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.