Page 12 of 35

Re: [MOD 0.14.13+] Creative Mode 0.2.0 - Epic update!!

Posted: Thu Nov 03, 2016 4:12 pm
by Mooncat
aubergine18 wrote:Also, how to clear/reset alt-mode actions? Maybe allow clicking the labels in that section at the bottom to remove them?
Forgot to answer this. :P
The actions are cleared automatically when you open another modification dialog and perform any action. Yes, I will think about adding a remove button besides each stored action.
alfonsomatador wrote:EDIT: I found it. It's hidden in the one of the menus and is disabled by default. :/
If you choose "Yes with cheats" in the initial popup, the recipes will be automatically enabled. :mrgreen:

Re: [MOD 0.14.13+] Creative Mode 0.2.0 - Epic update!!

Posted: Thu Nov 03, 2016 6:57 pm
by Mooncat
Found the cause of bug that Creator cannot create ore patches.
It was broken when I set conrete as the default selection.

If you need such feature urgently, please go to scripts/magic-wand-creator.lua:
1) find function magic_wand_creator.set_selected_tile_prototype(player, tile_prototype)

2) whenever you see these

Code: Select all

tile_name = nil
resource_name = nil
replace the nil by "", so they become

Code: Select all

tile_name = ""
resource_name = ""
3) repeat step 2 for function magic_wand_creator.set_selected_resource_prototype(player, resource_prototype)

I want to add some improvements in v0.2.1. It will be ready tmr. ;)
(No time for updating the OP yet)

Re: [MOD 0.14.13+] Creative Mode 0.2.0 - Epic update!!

Posted: Fri Nov 04, 2016 9:53 pm
by atlas1205
can barely wait for 0.21 and the ability to create ore patches :P

Re: [MOD 0.14.13+] Creative Mode 0.2.0 - Epic update!!

Posted: Sat Nov 05, 2016 4:12 pm
by Choumiko
When printing on_train_changed events i got an error:

Code: Select all

194.677 Error MainLoop.cpp:788: Exception at tick 77660: Error while running event on_train_changed_state (ID 23)
LuaTrain doesn't contain key type.
stack traceback:
	__creative-mode__/scripts/events.lua:458: in function <__creative-mode__/scripts/events.lua:457>
	(...tail calls...)
	__creative-mode__/scripts/events.lua:667: in function <__creative-mode__/scripts/events.lua:643>
The event only has train as an interesting parameter, i added an additional function for the event (and changed it in the param_message_look_up table):

Code: Select all

local function getStateKey(state)
  for key, id in pairs(defines.train_state) do
    if id == state then return key end
  end
end

local function get_train_param_message(log_prefix, param_name, param)
  local name = "CargoWagons"
  if #param.locomotives.front_movers > 0 then
    name = param.locomotives.front_movers[1].backer_name
  elseif #param.locomotives.back_movers > 0 then
    name = param.locomotives.back_movers[1].backer_name
  end
  return (log_prefix .. "\"" .. param_name .. "\" :: LuaTrain: {state = " .. getStateKey(param.state) .. " (" ..param.state .."), " .. "backer_name = \"" .. name .. "\"}")
end
Edit: An option to have the events being logged via log() would be nice, this writes to factorio-current.log and also adds a timestamp (plus it shows up in the terminal/console if Factorio is started there)

Re: [MOD 0.14.13+] Creative Mode 0.2.0 - Epic update!!

Posted: Sat Nov 05, 2016 5:55 pm
by Mooncat
Choumiko wrote:When printing on_train_changed events i got an error:

Code: Select all

194.677 Error MainLoop.cpp:788: Exception at tick 77660: Error while running event on_train_changed_state (ID 23)
LuaTrain doesn't contain key type.
stack traceback:
	__creative-mode__/scripts/events.lua:458: in function <__creative-mode__/scripts/events.lua:457>
	(...tail calls...)
	__creative-mode__/scripts/events.lua:667: in function <__creative-mode__/scripts/events.lua:643>
The event only has train as an interesting parameter, i added an additional function for the event (and changed it in the param_message_look_up table):

Code: Select all

local function getStateKey(state)
  for key, id in pairs(defines.train_state) do
    if id == state then return key end
  end
end

local function get_train_param_message(log_prefix, param_name, param)
  local name = "CargoWagons"
  if #param.locomotives.front_movers > 0 then
    name = param.locomotives.front_movers[1].backer_name
  elseif #param.locomotives.back_movers > 0 then
    name = param.locomotives.back_movers[1].backer_name
  end
  return (log_prefix .. "\"" .. param_name .. "\" :: LuaTrain: {state = " .. getStateKey(param.state) .. " (" ..param.state .."), " .. "backer_name = \"" .. name .. "\"}")
end
Edit: An option to have the events being logged via log() would be nice, this writes to factorio-current.log and also adds a timestamp (plus it shows up in the terminal/console if Factorio is started there)
Just wanted to press the submit button and then saw this. So close. :lol:
Thanks for the report and fix, I will check on it. :D

About log(), I think I have checked it before implementing the event log and decided to not use it, but I forgot the reason. I will check it again for the next version. ;)

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sat Nov 05, 2016 6:41 pm
by Mooncat
Done. Released v0.2.1 to the mod portal! :D
Originally it was just a hotfix, then I decided to add some improvements on the UX. Then, some more features, then more and more. :lol:
So, a little bit delayed, but more features than expected. :mrgreen:

And thanks Choumiko, you inspired me to add backer name to the entity event message. :D

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sat Nov 05, 2016 8:24 pm
by atlas1205
Yaaaay ore patch creation works! NICE WORK.

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sat Nov 05, 2016 9:01 pm
by Mooncat
atlas1205 wrote:Yaaaay ore patch creation works! NICE WORK.
Yeah~ it's great to hear that. :D

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 3:50 am
by atlas1205
Eh... but the ore patches it created are poor... especially the crude oil patches (yield 13%/0.6 unit/s with bob's MK5 pumpjack)
how can i increase the richness?

Suggestion: maybe you can add a slider to adjust the richness of created resource patches? I know it could be a lot of work, but definitely makes the mod shine brighter.

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 2:13 pm
by Mooncat
atlas1205 wrote:Eh... but the ore patches it created are poor... especially the crude oil patches (yield 13%/0.6 unit/s with bob's MK5 pumpjack)
how can i increase the richness?

Suggestion: maybe you can add a slider to adjust the richness of created resource patches? I know it could be a lot of work, but definitely makes the mod shine brighter.
Yes, I think it should be doable. I can just grab the slider from the Color Picker mod and paste to here. :lol:
But before that, please allow me to spend some time on updating the document first. :mrgreen:

Right now I am working on the wikia: http://factorio-creative-mode.wikia.com ... _Mode_Wiki
I am tied of managing the large post in this forum without having real time preview. :roll:
Furthermore, I can separate different topics into pages. It should be easier to read. ;)

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 3:19 pm
by aubergine18
Have you ever considered using the github wiki - I've found it particularly productive for creating docs.

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 4:37 pm
by Mooncat
aubergine18 wrote:Have you ever considered using the github wiki - I've found it particularly productive for creating docs.
One disadvantage about github is that it does not allow me to upload images to it. I have to upload to another website and copy-and-paste the image URL. Quite troublesome.
But wikia allows me to upload images to it directly.
While github wiki is good for programmers, because example code is usually more important than images, when delivering information about a game or a mod, I believe images are more important. That's why I used wikia.
For example, you can see the gifs and jpgs here: http://factorio-creative-mode.wikia.com ... enu/Cheats. I feel no hesitate to add more, because it is simple and quick. But I am not sure if it will be the same if I was using github. :mrgreen:

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 5:06 pm
by aubergine18
You can upload images to github wiki - install github desktop (or use command line if preferred) then sync the wiki to local drive (git url shown in wiki sidebar), drop the images in, commit the changes back to wiki :)

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 5:42 pm
by Mooncat
aubergine18 wrote:You can upload images to github wiki - install github desktop (or use command line if preferred) then sync the wiki to local drive (git url shown in wiki sidebar), drop the images in, commit the changes back to wiki :)
hm.. haven't used github desktop (using SourceTree instead). I will check about it tomorrow. Just finished the wiki about cheats, but I can still change it if github is really good. ;)

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 9:56 pm
by aubergine18
I've not tried doing it with source tree - I tend to only use source tree when rebasing, etc.

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Sun Nov 06, 2016 10:30 pm
by Zulan
Just wanted to say thank you! The new version is awsome. Love it, so useful!

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Mon Nov 07, 2016 1:32 am
by Mooncat
Zulan wrote:Just wanted to say thank you! The new version is awsome. Love it, so useful!
You're welcome! :D

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Mon Nov 07, 2016 8:27 pm
by UlyssesSword
I found a bug when using the Magic Wand - Creator to place water (water, deep water, green water, or deep green water) onto some tiles (Dirt, dark dirt, sand, dark sand). It occasionally misses placing some of the water when "correct tiles" mode is selected.

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Tue Nov 08, 2016 1:48 am
by Mooncat
UlyssesSword wrote:I found a bug when using the Magic Wand - Creator to place water (water, deep water, green water, or deep green water) onto some tiles (Dirt, dark dirt, sand, dark sand). It occasionally misses placing some of the water when "correct tiles" mode is selected.
Yes, I noticed that too. But I am not sure whether it is a bug or not, as I don't know the algorithm behind tile correction, because it is done by the game, not me. :)
I just know that it can correct the edges between tiles, making them blend nicely. Maybe it computed dirt cannot fit into those tiles so it just ignored them. :mrgreen:

Re: [MOD 0.14.13+] Creative Mode 0.2.1 - Epic update!!

Posted: Tue Nov 08, 2016 5:32 am
by aubergine18
Tile correction, especially for water tiles adjacent to land tiles, is a bit unreliable as I found out while developing my bridges mod: viewtopic.php?f=25&t=34428

There's not much that can be done about it from a modding perspective, I found that regardless of tile correction state, some tile correction still occurs, and the results are often a bit weird.