Taurondir wrote:I don't know if what I am about to ask is easy or hard to do, but I'm pretty sure you would know instantly, based on the amount of work in the Mod and the Magic Wand tools.
I'm adding custom "enemy bases" to a map so players that expand that far have to fight and kill all the defenses to use the area. Dropping an "Active Energy Source" next to a bunch of turrets and an indestructible "Super Energy Pole" or a "Duplicating Chest" full of ammo and then turrets, gives me the instant ability to put down a base full of guns to shoot players.
Now, when accessed by a player (on a force set as enemy), the Duplicating Chest will return "Can't Open Enemy Structures", meaning that a player that takes over the base does not have access to Infinite ammo or other infinite resources, but they CAN drop a power pole next to an Active Energy Source and have infinite electricity.
Can a flag be set or a condition be set so that when an "enemy" connects to a power source no connection is made or no energy is transmitted to stop them doing this?
That is not something that can not be done currently. What you can do as a work around is in on entity died, check for existing enemies in the area and if none are present destroy() the power source.
Fair enough.
I'm currently looking through the code of your Creative mod - because it already creates totally unbalanced units for testing anyway - to see if I can make a separate mini-Mod just for my game where I can just place "Super Structures" in the form of turrets that don't need either ammo or Energy, and things that can repair themselves over time without a need for setting up Roboports and feeding them with bots from a Creative Chest like I was trying to do before.
Same steps from above but with CM's event-logging (on_robot_built) checked (with default settings)
Found the issue. Should have checked entity.valid before printing its position. The bug is caused when I'm getting the position of my invalid robot from instant blueprint.
But I have some works to do. Will release the fix within these 2 days.
Nexela wrote:Also in your on_robot event the valid=false is not needed. for the same reason as above. the lack of valid is false
Because the "robot" parameter of on_robot_built_entity is not optional, people may not expect it to be nil. Even though it will still cause error if they try accessing the other entity properties, at least I can say "please check valid before accessing the properties!"
Nexela wrote:Just need creative mode to add (or point me to if they exsist) a way to bypass the popup and enable all cheats.
Mooncat wrote:Because the "robot" parameter of on_robot_built_entity is not optional, people may not expect it to be nil. Even though it will still cause error if they try accessing the other entity properties, at least I can say "please check valid before accessing the properties!"
It doesn't hurt to have it but it is not needed.
local valid
if valid then
if valid == true then
Would both return false (not valid)
checking if valid==false is just bad practice IMO since nil and false are false
oh, you are talking the valid=false inside {}. I thought you are talking about the whole {valid=false}
I would keep it. Shouldn't expect everyone has the same standard.
And technically nil and false are not the same. valid == nil will return true only if it is nil but not false. Even tho it doesn't matter here due to the limited possible values and consequences of valid, it is a good practice to keep things that are supposed to be "not nil" not nil.
Fixed error when instant blueprint is performed while logging is enabled for the on_robot_built_entity event.
Ghost tile revival caused by Healer magic wand now invokes on_robot_built_tile instead of on_player_built_tile, for being consistent as instant blueprint.
the "robot" parameter will be a small table: {valid = false, type = "player", name = "player"}
the index of player who triggered the revival will still be stored in the "player_index" parameter
additional parameter "revived" whose value is true
- Improvements:
For the alternate mode of Modifier magic wand, the default values of "Don't select healthless entities" and "Don't select indestructible entities" are changed from true to false, making them different from the standard mode.
Event logging now checks the "valid" property of parameters of following types before showing some advanced properties like position, train backer name. "valid = false" will be shown if valid is false.
LuaEntity
LuaEquipment
LuaEquipmentGrid
LuaForce
LuaGuiElement
LuaSurface
LuaTechnology
LuaTrain
The on_robot_built_entity and on_robot_built_tile events invoked by this mod due to instant blueprint now have an additional parameter: "instant_blueprint". Its value is always true.
Similar to above, the on_entity_died and on_player_mined_tile events invoked by this mod due to instant deconstruction now have an additional parameter: "instant_deconstruction". Its value is always true.
@Nexela: I have tried implementing a remote API for setting the default action on the initial popup. But the existing scripts were not designed for that. It requires too much work. So I cancelled it.
But a much more powerful remote interface will come in the future.
If nothing goes wrong, this will be last version for 0.14 Factorio. Looking forward to 0.15 on next Tuesday.
For Creative Mode, here is the plan:
v0.3.0 = a quick ugly port for 0.15. Also change the on_player_mined_tile event caused by instant deconstruction to on_robot_mined_tile.
Maybe on_entity_died should be changed to on_robot_pre_mined? Let me know what do you think about this.
v0.3.1 = graphics update, base on the new 0.15 icons. Also use the new mod GUI API if possible. But no big change on the layout. (May need a few weeks)
v0.4.0 = Huge overhaul. Use a proper IDE for scripting. Better layout (e.g. group the cheats into foldouts). More powerful remote interface. I'm planning an interface to let other mods to set the states of cheats, or even add more cheats. (2-3 months)
Ohhhh the modifier changes are in!!! And they don't do what I thought they did. I wasn't aware it was a history thing
I will wait patiently for the better remote api
Alternatively .15 config settings will work too, I just hate having to remember to update config.lua when you release new goodies
Mooncat, don't know where you are with 0.15 compatibility.... but i ran 0.15.0 and trying to install your mod i get "Selected mod has no release version."
impetus maximus wrote:Mooncat, don't know where you are with 0.15 compatibility.... but i ran 0.15.0 and trying to install your mod i get "Selected mod has no release version."
cheers
It was mid night here when 0.15 was released, and it is 10am now.... please wait until I get home. ^^"
impetus maximus wrote:Mooncat, don't know where you are with 0.15 compatibility.... but i ran 0.15.0 and trying to install your mod i get "Selected mod has no release version."
cheers
It was mid night here when 0.15 was released, and it is 10am now.... please wait until I get home. ^^"
There's a fair bit to adjust to.
Energy is the first one.
Unfortunately stripping out all energy features doesn't do it.
Re: [MOD 0.15.1+] Creative Mode 0.3.0 - Update for 0.15!
Posted: Tue Apr 25, 2017 7:55 pm
by Mooncat
Released v0.3.0 for Factorio 0.15!
Changelog
Version 0.3.0 (Apr 26, 2017):
- New:
Belt Immmunity Equipment is now included inside the creative chests.
- Fixes:
Fixed the tooltip of build distance personal cheat displaying wrong default cheat value.
- Changes:
Updated for Factorio 0.15.
Factorio version is now required to be equal or higher than 0.15.1 (from 0.14.13)
Super boiler, super cooler and super configurable boiler are now directional and have only 2 connection points in maximum.
Evolution factor is moved from Game Settings to Team Cheats.
Updated event logging system:
it can now recognize the new event parameters.
added the following events to the entity-related events category:
on_biter_base_built
on_entity_renamed
on_market_item_purhcased
on_player_dropped_item
on_player_mined_entity
on_robot_mined_entity
on_selected_entity_changed
on_train_created
added the following events to the player-related events category:
on_gui_elem_changed
on_gui_selection_state_changed
on_market_item_purhcased
on_player_changed_force
on_player_dropped_item
on_player_mined_entity
on_pre_entity_settings_pasted
on_selected_entity_changed
added the following events to the force-related events category:
on_player_changed_force
added the following events to the surface-related events category:
on_pre_surface_deleted
on_surface_created
on_surface_deleted
added the following events to the GUI-related events category:
on_gui_elem_changed
on_gui_selection_state_changed
added a new category: settings-related events, with the following events:
on_difficulty_settings_changed
on_runtime_mod_setting_changed
Modding: the event for entity removal caused by instant deconstruction or the magic wands is changed from on_entity_died to on_robot_pre_mined.
the "robot" parameter will be a small table: {valid = false, type = "player", name = "player"}
the index of player who triggered the removal will be stored in the "player_index" parameter
removed the "force" parameter
"instant_deconstruction" is true if it is caused by instant deconstruction. Otherwise, it is nil.
Modding: the event for tile removal caused by instant deconstruction or the magic wands is changed from on_player_mined_tile to on_robot_mined_tile.
the "robot" parameter will be a small table: {valid = false, type = "player", name = "player"}
the index of player who triggered the removal will still be stored in the "player_index" parameter
"instant_deconstruction" is true if it is caused by instant deconstruction. Otherwise, it is nil.
- Known issues:
Super boiler, super cooler and super configurable boiler are broken.
It is just a quick, ugly update, to let people use the mod in 0.15 ASAP. Please expect bug, and report if you encounter one.
Don't print log for the on_train_created event or error will be thrown due to this bug: viewtopic.php?f=7&t=44883
Re: [MOD 0.15.1+] Creative Mode 0.3.0 - Update for 0.15!
Posted: Tue Apr 25, 2017 8:33 pm
by impetus maximus
you rock! thank you
Re: [MOD 0.15.1+] Creative Mode 0.3.0 - Update for 0.15!
Posted: Wed Apr 26, 2017 3:43 am
by mavzor
Error while running event creative-mode::on_tick (ID 0)
__creative-mode__/scripts/util.lua:177: attempt to index local 'item' (a number value)
When enabling instant construction/blueprint laying and applying a blueprint
Re: [MOD 0.15.1+] Creative Mode 0.3.0 - Update for 0.15!
Posted: Wed Apr 26, 2017 12:32 pm
by impetus maximus
mavzor wrote:Error while running event creative-mode::on_tick (ID 0)
__creative-mode__/scripts/util.lua:177: attempt to index local 'item' (a number value)
When enabling instant construction/blueprint laying and applying a blueprint
0.15.2?
Re: [MOD 0.15.1+] Creative Mode 0.3.0 - Update for 0.15!
Posted: Wed Apr 26, 2017 3:19 pm
by HiddenWolf
impetus maximus wrote:
mavzor wrote:Error while running event creative-mode::on_tick (ID 0)
__creative-mode__/scripts/util.lua:177: attempt to index local 'item' (a number value)
When enabling instant construction/blueprint laying and applying a blueprint
0.15.2?
I have the same error when I load my design/cheat save started in 0.14.
In a quick test, enabling cheat mode on a new save and copy-pasting fresh blueprints around does not result in the crash.