[MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Topics and discussion about specific mods
Post Reply
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

[MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by Mooncat »

Type: Mod
Name: Creative Mode
Description: Adds entities that can generate unlimited items or fluid, or nullify them.
License: GNU LGPLv3
Version: 0.3.12
Release: 2017-09-05
Tested-With-Factorio-Version: 0.15.34
Category: (Helper, Item, Convenience, Cheats)
Tags: creative mode, cheat, always day, research all tech
Download-Url: https://mods.factorio.com/mods/Mooncat/creative-mode
Website: viewtopic.php?f=97&t=28005
License
Long description
For Factorio 0.14
For Factorio 0.13
Version history
Known issues
Future development
For modders
Support
Last edited by Mooncat on Fri Jan 05, 2018 2:33 am, edited 126 times in total.

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by siggboy »

Thanks a lot for this :mrgreen:

I needed something like TestMode for 0.13 so I can start developing my stuff on my sandbox.

Highly appreciated that you took the effort to make this for 0.13!
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Mooncat »

siggboy wrote:Thanks a lot for this :mrgreen:

I needed something like TestMode for 0.13 so I can start developing my stuff on my sandbox.

Highly appreciated that you took the effort to make this for 0.13!
My pleasure! Remember to report bug if there is any. :D
(I am making something new that can make testing more convenient.)

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by siggboy »

Well TestMode is updated, too, now, but Creative Mode complements it really nicely (most things that it adds are missing from TestMode).

Can you maybe add a requester like in TestMode that will ask you if you want to enable it when you load into a game? You can probably steal that code from TestMode.

Then we don't have to remember a console command (that you helpfully put into the mod description, a good idea.)
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

Nexela
Smart Inserter
Smart Inserter
Posts: 1828
Joined: Wed May 25, 2016 11:09 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Nexela »

.13.3 Single Player

Put the big super range electric pole in your hand. start placing them at max distance from each other. (i was making a big grid). after a few poles FPS/UPS drops drasticly. Only happens while placing the poles and the blue electric area marker is moving around. That is the only problem I have run in to

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Mooncat »

siggboy wrote:Well TestMode is updated, too, now, but Creative Mode complements it really nicely (most things that it adds are missing from TestMode).

Can you maybe add a requester like in TestMode that will ask you if you want to enable it when you load into a game? You can probably steal that code from TestMode.

Then we don't have to remember a console command (that you helpfully put into the mod description, a good idea.)
Oh, I didn't make that because I found it quite annoying when starting a new game and keep refreshing the map. But I understand console command isn't very user-friendly (that's why I included other commands when enabling creative mode).
So I will add a config option for that. ;)

Nexela wrote:.13.3 Single Player

Put the big super range electric pole in your hand. start placing them at max distance from each other. (i was making a big grid). after a few poles FPS/UPS drops drasticly. Only happens while placing the poles and the blue electric area marker is moving around. That is the only problem I have run in to
Confirmed. But it sounds like a bug in the game itself because the electric pole is just a big electric pole with adjusted values. No code is involved.
Interestingly, it is not the big area marker, but the long wires causing the lag. I may fire a bug report after isolating the issue.
Last edited by Mooncat on Sun Jul 03, 2016 6:00 pm, edited 2 times in total.

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Zeblote »

The item source isn't able to create a compressed blue belt, so it's hard to test setups with them :D


I've found you can fix it by replacing

Code: Select all

						if transport_line.can_insert_at_back() then
							transport_line.insert_at_back(output_stack)
						end
with

Code: Select all

						if transport_line.can_insert_at(0.9) then
							transport_line.insert_at(0.9, output_stack)
						end
Or well, any other number.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Mooncat »

Zeblote wrote:The item source isn't able to create a compressed blue belt, so it's hard to test setups with them :D


I've found you can fix it by replacing

Code: Select all

						if transport_line.can_insert_at_back() then
							transport_line.insert_at_back(output_stack)
						end
with

Code: Select all

						if transport_line.can_insert_at(0.9) then
							transport_line.insert_at(0.9, output_stack)
						end
Or well, any other number.
Thanks for pointing that out! I noticed the items on belt are more separated then usual, but I thought it is a change in 0.13. Now I can confirm it is my fault. Fixed in the next version. ;)

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Zeblote »

So I'm not sure if it's caused by this mod or not, but ever since I installed it the game sometimes freezes up. Seems to have something to do with the item void, because it only ever happens when I'm close to one of them.

Is there any way these can get stuck in an infinite loop? Maybe the while loop in your remove_first_item_on_transport_line function?








It also seems that even with my change it still doesn't create a 100% compressed belt, only about 95.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Mooncat »

Zeblote wrote:So I'm not sure if it's caused by this mod or not, but ever since I installed it the game sometimes freezes up. Seems to have something to do with the item void, because it only ever happens when I'm close to one of them.

Is there any way these can get stuck in an infinite loop? Maybe the while loop in your remove_first_item_on_transport_line function?
hm... I haven't seen this issue. Mind to tell which mods you have installed? Maybe it is incompatible with any of them.
For instance, you can try to turn off can_remove_from_player in the config file so that item void will not do anything when you are in front of it.

Edit: Confirmed as a bug caused by the Item void. Yes, you are right, the remove_first_item_on_transport_line was somehow causing infinite loop. It is fixed in the next version. (not 100% sure tho...)

Zeblote wrote:It also seems that even with my change it still doesn't create a 100% compressed belt, only about 95.
Oh! That's bad. I will try another value (like 0.5?) or even search for another way to insert the item. But, I am not sure, it sounds like a bug on the API. As you can see in my script, insert_in_back is executed in every tick. There is no way to have any gap in between. Maybe a bug report later.

Edit: after some thought, I may understand that it is not a bug. Maybe the express belt is just too fast that simply inserting one item in every tick cannot compress it. In that case, I will try inserting 2 items at different positions. From the changelog of 0.13.3:
...Increased the distance between items on the belt from 0.28 to 0.28125...
This value may help. If it doesn't solve the problem, I will need to implement an even faster belt. :roll:

Edit2: maybe I was wrong, partially wrong. Item source cannot even compress the slowest belt. It seems the problem isn't that express belt is too fast, but their speed is just too tricky.
In the first tick, item is inserted.
Next tick, the item is moved forward, but the space is not enough for inserting the next item because the speed is not dividable by the min distance between items.
Third tick, the item is moved further, now the second item can be inserted, but there is already a gap in between.
I am still not at home, so I can't really test the solution mentioned above. But I have great hope on it. :lol:
For now, please use 2 item sources and 2 output transport belts, then combine the belts with a splitter to a single line of belt. The splitter will do the compress job.


Meanwhile...
Nexela wrote:.13.3 Single Player

Put the big super range electric pole in your hand. start placing them at max distance from each other. (i was making a big grid). after a few poles FPS/UPS drops drasticly. Only happens while placing the poles and the blue electric area marker is moving around. That is the only problem I have run in to
The devs have responded my bug report on this and explained the reason why it causes lag.
viewtopic.php?f=23&t=28095
It is not fixable (or at least will not be fixed in the near future), so I will reduce the max wire distance of Super Electric Pole. Maybe 100-150 should be enough (current is 1000, and supply area radius is 50).
Last edited by Mooncat on Mon Jul 04, 2016 6:55 pm, edited 9 times in total.

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Mooncat »

Confirmed features in 0.0.2:
- Creative provider chest: Provides all (non-hidden) items in the game and can auto refill them. Acts as a passive provider chest. (Inspired by Klonan's Creative mode - Unlimited chests) [90% done]
- Popup to ask for enabling Creative Mode when starting a new game or loading existing save that is not in Creative Mode. [0%, but should be easy]
- Command (or UI) to disable Creative Mode. [0%, medium]
- Fix the bug that Item source cannot create a compressed belt. (Not sure if it is fixable. Maybe I will have to create a faster belt for that.) [?]
- Reduce the max wire distance of Super Electric Pole as it is causing lag now. [0%, very easy]
- New sprites and icons for Item source and Item void to indicate the fact that they are not chests! [done]

I will try to release it tonight.



Planned for 0.0.3:
In case there is some hidden items that Item source and Creative provider chest cannot provide infinitely, the following item will be helpful for that:
Item duplicating chest - Duplicates the item inside it.
(Get one of the wanted item and put it inside, the chest will fill itself with the item.)
(If possible, it will support copy-and-paste for its contents.)

For fluid, we will have:
Fluid duplicating tank - Duplicates the fluid inside it.
(If possible, it will support copy-and-paste for its contents.)

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Zeblote »

The blueprint preview doesn't work if it contains parts from this mod, do you get that too?

Image

User avatar
y.petremann
Filter Inserter
Filter Inserter
Posts: 410
Joined: Mon Mar 17, 2014 4:24 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by y.petremann »

Just some thought about the mod, I've not tested it, only seen images, but I've found that all items are graphicaly balanced except the energy source and the power pole (I would prefer to use the substation graphics) that are a bit too purple and so don't looks integrated in the game

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.1

Post by Mooncat »

Zeblote wrote:The blueprint preview doesn't work if it contains parts from this mod, do you get that too?
I think I have seen this problem before, but was on Factorio 0.13.0. I don't have this problem now with 0.13.4.
Image

y.petremann wrote:Just some thought about the mod, I've not tested it, only seen images, but I've found that all items are graphicaly balanced except the energy source and the power pole (I would prefer to use the substation graphics) that are a bit too purple and so don't looks integrated in the game
I made the objects as ugly as possible because they are not supposed to be used in normal way. 8-)
Anyway, I may update the graphics of those energy related entities to make them to have 1x1 footprint for consistency. And I may make them more polish if requested. But for now, I will improve the functionality first. I have some ideas that I don't even know whether they are possible. :lol:



Edit: and I am happy to announce that 0.0.2 has been released. But the problem of not compressed belt has to be postponed to 0.0.3. And I am too tired to update the info and screenshots. Will update them tomorrow.
Highly recommend to play around the new provider chest. :D

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.2

Post by Mooncat »

Just edited the first post for better format. Also added descriptions about the new Creative Provider Chest. Check it out if you don't know how it works!
But still missing images for the chest. And the images seem to be too large. I may take some time to downscale them.

(Still don't get how font size works. The headers are 150px and item names are 200px. With font style, the item names are displayed with greatly reduced font size. :| ... But it is still better than the mod portal. The mod portal is supposed to support markdown, but in fact it only supports some of the styles, and no preview button.)

Zeblote
Filter Inserter
Filter Inserter
Posts: 973
Joined: Fri Oct 31, 2014 11:55 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.2

Post by Zeblote »

Image

huh?

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.2

Post by Mooncat »

Zeblote wrote:Image

huh?
0.13.5!? :shock:
I have checked it but no error.... :?
Edit: aw... loading a map with Creative Mode 0.0.1 and update to 0.0.2 can cause error.... let me see if I can fix this.

Version 0.0.3 has to delay to tomorrow anyway. So this fix will be included.

And Zeblote, would you mind to test something for me? Simply use transport_line.insert_at(0.9, output_stack) without the if checking seems to be able to create compressed belt. :shock:

User avatar
siggboy
Filter Inserter
Filter Inserter
Posts: 988
Joined: Tue Mar 29, 2016 11:47 am
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.2

Post by siggboy »

Mooncat wrote:Edit: aw... loading a map with Creative Mode 0.0.1 and update to 0.0.2 can cause error.... let me see if I can fix this.
Change notes for 0.13.5:
Attempting to mutate the 'global' table of a mod in the 'on_load' event handler will result in an error. The 'on_load' event handler is *only* meant for re-registering conditional event handlers and setting up meta-tables. Use 'on_configuration_changed', 'on_init', and migration scripts in all other instances.
So this is causing the problem.
Is your railroad worrying you? Doctor T-Junction recommends: Smart, dynamic train deliveries with combinator Magick

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.2

Post by Mooncat »

siggboy wrote:
Mooncat wrote:Edit: aw... loading a map with Creative Mode 0.0.1 and update to 0.0.2 can cause error.... let me see if I can fix this.
Change notes for 0.13.5:
Attempting to mutate the 'global' table of a mod in the 'on_load' event handler will result in an error. The 'on_load' event handler is *only* meant for re-registering conditional event handlers and setting up meta-tables. Use 'on_configuration_changed', 'on_init', and migration scripts in all other instances.
So this is causing the problem.
Yes I know. Thanks anyway. :D

User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.13.3+] Creative Mode 0.0.3

Post by Mooncat »

Version 0.0.3 is released!

This time is mainly for improving UX. Added "Yes for all" buttons and also the ability to preserve config settings.
Also some compatibility fixes.
For details, please check the first post. :lol:

Due to time limit, the Item duplicating chest and Fluid duplicating tank, the fix for Item source to splitters, as well as the new images are all postponed to v0.0.4.

Also planned for 0.0.4:
- a way to permanently disable Creative Mode for the current game. Maybe reuse the disable command, add an optional parameter behind it?
- Item source and Item void would cooperate with circuit signal and different circuit operation modes. (They are inserters)

Edit: forgot to add - passive electric void, which is the identical electric void from the original mod.
I overlooked original electric void and used another entity type to implement it, which made it actively drains all energy from the network, i.e. other entities in the same network cannot function normally. But with the original electric void, other entities can function normally, so it can be used for testing generator setup.

Please report any bugs and also write about what you want to see in this mod. :D

Post Reply

Return to “Mods”