[MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Topics and discussion about specific mods
thegroundbelowme
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Nov 26, 2017 4:03 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by thegroundbelowme »

I'm having an issue with the CM GUI button (the main button that opens the GUI) not showing up after starting a NG+ with the New Game+ mod. Is there a command to force the menu to show?
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by impetus maximus »

thegroundbelowme wrote:Is there a command to force the menu to show?

Code: Select all

/c remote.call("creative-mode", "enable")
if it says it's already enabled, change it to "disable" then back to "enable"
thegroundbelowme
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Nov 26, 2017 4:03 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by thegroundbelowme »

I had to disable it first, but that did the trick, thanks!
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by impetus maximus »

thegroundbelowme wrote:I had to disable it first, but that did the trick, thanks!
you are welcome. glad it worked. :)
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by Mooncat »

Holy.... I didn't expect 0.16 can be released so soon. I'm still busy, so I can't guaranteer when I can release updates of my mods.
Feel free to takeover it if anyone can't wait. :(

Edit: I meant create a new mod based on this one, so I can come back at anytime. :P


Therax wrote:Creative Mode instant-deconstruction breaks my mod, leaving behind orphan entities.

My mod (viewtopic.php?f=93&t=54343) creates invisible partner inserter entities, which are removed when the on_player_mined_entity or on_robot_mined_entity events are raised. It's necessary for my mod to use these events because any items held by the inserters need to be returned to the player via the buffer parameter of these two events. Other mods that create partner chest entities would have a similar problem.

Creative Mode currently only raises the on_robot_pre_mined event, which is unfortunately insufficient. I think you probably need to either raise on_entity_died (as you discussed yourself at viewtopic.php?f=34&t=34952&start=60#p218915), or raise both on_robot_pre_mined and on_robot_mined_entity, providing a dummy version of buffer as well.
There should be a reason that I didn't raise on_robot_mined_entity. But I have forgotten. I will implement it if I really can't find the reason. ;)
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by impetus maximus »

Mooncat, take your time friend. ;) we love what you do for us all!

has anyone tried a quick and dirty update of the mod? changing the version to 0.16? :P
craig_g
Manual Inserter
Manual Inserter
Posts: 4
Joined: Tue Jul 18, 2017 11:53 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by craig_g »

looking forward to seeing this mod updated to 0.16?
Slackie
Inserter
Inserter
Posts: 25
Joined: Mon Mar 20, 2017 10:29 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by Slackie »

Mooncat wrote:Holy.... I didn't expect 0.16 can be released so soon. I'm still busy, so I can't guaranteer when I can release updates of my mods.
I tried to send you a few bucks to your Paypal in the first post since I use your mod and wanted to show my appreciation. Unfortunately, I get an error when sending and I'm pretty sure it's not related to my account.
We can’t send your payment right now. If you keep running into this issue, please contact PayPal.
impetus maximus wrote:has anyone tried a quick and dirty update of the mod? changing the version to 0.16? :P
Yes, I tried this, but the fix is not that simple. To start, the function get_circuit_connector_sprites which is used all over entity.lua seems to have been removed in 0.16. I am not familiar enough with the API to know how that same information is to be referenced now, though I do see some potentially useful examples in base\prototypes\entity\demo-entities.lua if anyone else wants to take a look.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by impetus maximus »

figured it wouldn't be that simple with all the changes made. thanks for the reply.
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by chrisgbk »

Mooncat wrote:Holy.... I didn't expect 0.16 can be released so soon. I'm still busy, so I can't guaranteer when I can release updates of my mods.
Feel free to takeover it if anyone can't wait. :(

Edit: I meant create a new mod based on this one, so I can come back at anytime. :P
I made a quick patch to get it sort-of running in 0.16. Pretty much every GUI is broken and crashes the game currently due to changes made internally, but It runs and the main functionality is there.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by Optera »

0.16 added a really nifty chest type: "infinity-container"
By switching all creative, duplicating and void chests to this type you can save a fair bit of lua performance.
For Creative chests for example all control.lua would have to do is set infinity_filters and remove_unfiltered_items=true in on_built_entity.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by impetus maximus »

chrisgbk wrote: I made a quick patch to get it sort-of running in 0.16. Pretty much every GUI is broken and crashes the game currently due to changes made internally, but It runs and the main functionality is there.
as soon as 0.16.6 lands, i'll be giving it a whirl. appreciate it. 8-)
User avatar
Mooncat
Smart Inserter
Smart Inserter
Posts: 1196
Joined: Wed May 18, 2016 4:55 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by Mooncat »

Slackie wrote:
Mooncat wrote:Holy.... I didn't expect 0.16 can be released so soon. I'm still busy, so I can't guaranteer when I can release updates of my mods.
I tried to send you a few bucks to your Paypal in the first post since I use your mod and wanted to show my appreciation. Unfortunately, I get an error when sending and I'm pretty sure it's not related to my account.
hm.... I have checked on the Internet, found some people asking the same issue but no obvious solution. I'm afraid I can't do anything here.
But I'm very happy knowing that you want to support me. :D

chrisgbk wrote:I made a quick patch to get it sort-of running in 0.16. Pretty much every GUI is broken and crashes the game currently due to changes made internally, but It runs and the main functionality is there.
Thanks a lot! I have tried fixing the errors in my mod but there are just too many errors and I don't have enough time. Maybe I will base on your work to update my mod when I come back. :lol:

Optera wrote:0.16 added a really nifty chest type: "infinity-container"
By switching all creative, duplicating and void chests to this type you can save a fair bit of lua performance.
For Creative chests for example all control.lua would have to do is set infinity_filters and remove_unfiltered_items=true in on_built_entity.
Yes, I found that too! And it is amazingly useful! I'm thinking about migrating all the chests from this mod to the infinity chest!
ichVII
Fast Inserter
Fast Inserter
Posts: 104
Joined: Mon Feb 27, 2017 10:16 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by ichVII »

I know there are more pressing issues, like getting this to work on .16, but blueprint data is not copied using the duplicating chest. Is it possible to change this?
Last edited by ichVII on Wed Dec 20, 2017 4:46 pm, edited 1 time in total.
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by chrisgbk »

Mooncat wrote:
Thanks a lot! I have tried fixing the errors in my mod but there are just too many errors and I don't have enough time. Maybe I will base on your work to update my mod when I come back. :lol:
Absolutely; there weren't actually a significant number of errors, it's just a tad bit tedious constantly launching the game, fixing the errors that appear, then repeat 40 times. I was also teaching myself all the lua modding as I was going, because I don't have experience with factorio modding (but I do have programming experience) so it made for slow going, as opposed to someone more experienced.

I think the only things broken but disabled instead of patched currently are magic wand smoke (entity smoke is a hard error, needs to be migrated to the new Trivial Smoke), and custom styles (only the ones that inherit from "flow" are broken), seems "flow" now has a direction when instanced, so styles have to inherit from the specialized style and be either "vertical_flow_style" or "horizontal_flow_style" and it was easier to just patch out the styles than fix all of them. But I don't fully understand the GUI system so it's possible this isn't actually the case and there is some other error at play.

The rest of the fixes were dealing with changed property names (ie: column_count instead of colspan) and more strict enforcement of creation order (ie: if a style is parented, the parent style has to exist before the child style gets created) and other such things.
User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by impetus maximus »

chrisgbk, so far so good with 'Creative Mode (Fix for 0.16)' in 0.16.6
haven't tried everything, but the cheats, matter/random item source, void/duplicating chests, and active power supplies are all working.

many thanks for assisting Mooncat. :)
chrisgbk
Long Handed Inserter
Long Handed Inserter
Posts: 93
Joined: Mon Jan 02, 2017 4:31 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by chrisgbk »

Okay, essentially everything should be working now in my branch. Migrated to trivial smoke and fixed styles. It's possible there may be some issues with the replacement for get_circuit_connector_sprites since I guessed how the new way was supposed to work, and in one case just used an existing circuit connector sprite definition from the inserters instead (I was being lazy and wanted to get it running, even if graphically wrong). Not sure which way is correct; might be able to use the existing sprites for everything, or might need to change the ones using vanilla definitions. This comes down to my lack of knowledge of how the sprites are defined/used.
spinba11
Long Handed Inserter
Long Handed Inserter
Posts: 63
Joined: Mon Mar 07, 2016 9:07 pm
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by spinba11 »

Any idea when the update will be ready to download (I can’t find it anywhere) this is the last mod I’m waiting for before I can update to 0.16.
quyxkh
Smart Inserter
Smart Inserter
Posts: 1031
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by quyxkh »

Near as I can tell, the iterm-request-proxy dance isn't needed for instant blueprints, just nil out the requests slot after taking your copy. Haven't tested whether this is new for 0.16.

Code: Select all

From cf2d6422145d1e6be20deba5bcba07e473007b42 Mon Sep 17 00:00:00 2001
From: quyxkh <quyxkh@gadabout.dyndns.org>
Date: Wed, 24 Jan 2018 16:49:22 -0800
Subject: [PATCH] Remove item-request-proxy dance when reviving ghosts

---
 scripts/util.lua | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/scripts/util.lua b/scripts/util.lua
index 1934217..6a208af 100644
--- a/scripts/util.lua
+++ b/scripts/util.lua
@@ -191,6 +191,7 @@ end
 function util.revive_entity_ghost_and_raise_event(entity_ghost, reviver_player, is_instant_blueprint)
 	-- Get the items this ghost will request when it is revived, most likely modules.
 	local item_requests = entity_ghost.item_requests
+	if item_requests then entity_ghost.item_requests = nil end
 	
 	-- Revive entity.
 	local _, revived_entity = entity_ghost.revive()
@@ -198,26 +199,6 @@ function util.revive_entity_ghost_and_raise_event(entity_ghost, reviver_player,
 		-- Supply the requested items.
 		if item_requests then
 			util.fulfill_item_requests(revived_entity, item_requests)
-			
-			-- Remove item request because we have already supplied it.
-			-- We can't just set entity_ghost.item_requests to nil because entity_ghost is already invalid.
-			-- We can't set revived_entity.item_requests either because item_requests is only for ghost entity.
-			-- So we have to use the ugly way.
-			local position = revived_entity.position
-			local x = position.x
-			local y = position.y
-			-- surface.find_entity cannot find entities with zero-sized collision box.
-			local item_request_proxies = revived_entity.surface.find_entities_filtered
-			{
-				area = {{x - 0.1, y - 0.1}, {x + 0.1, y + 0.1}},
-				name = "item-request-proxy",
-				force = revived_entity.force,
-				limit = 1
-			}
-			if #item_request_proxies > 0 then
-				local item_request_proxy = item_request_proxies[1]
-				item_request_proxy.destroy()
-			end
 		end
 		
 		-- Raise event.
@@ -336,4 +317,4 @@ function util.kill_entity_and_raise_event(entity, killer_player)
 		return true
 	end
 	return false
-end
\ No newline at end of file
+end
-- 
2.16.1.316.g9a651edd8

works great for me
jamezhall
Inserter
Inserter
Posts: 28
Joined: Fri Jul 21, 2017 11:27 am
Contact:

Re: [MOD 0.15.29+] Creative Mode 0.3.12 - Infinite resources

Post by jamezhall »

Creative Mode (Fix for 0.16) no longer works. It looks like the dependancey was set to <= 0.16.18. Which has now been exceeded. Does this just require a change in version number in the info file? Does this mod get updated regularly? Great work so far love it!
Post Reply

Return to “Mods”