Search found 311 matches

by devilwarriors
Wed Aug 31, 2016 12:06 am
Forum: Not a bug
Topic: entity.minable not changeable?
Replies: 2
Views: 977

Re: entity.minable not changeable?

Rseding91 wrote:

Code: Select all

player.selected.minable = "false"
The string "false" is incorrect. It should be:

Code: Select all

player.selected.minable = false
oh weird I had problem in some place with passing false directly and setting it as a string helped.

But yeah that worked, thanks!
by devilwarriors
Tue Aug 30, 2016 11:43 pm
Forum: Not a bug
Topic: entity.minable not changeable?
Replies: 2
Views: 977

entity.minable not changeable?

hi, trying to use entity.minable with player.selected to disable an entity from being mined. The api say its a read/write variable, but I can only read, changing it does nothing. here a simplified version of my code, that you can paste in a control.lua to test it should turn any entity that you're p...
by devilwarriors
Tue Aug 30, 2016 10:33 pm
Forum: Mods
Topic: [MOD 0.13+] Liftoff_0.1.10 (12.02.17) Aircraft extension
Replies: 36
Views: 18245

Re: [MOD 0.13+] Liftoff_0.1.3 (30.08.16) Aircraft extension

Adil wrote:(you'll see its shadow on the ground (actually, you'll see it over the plane itself, but that cannot be helped.).
The raven mod doesn't have this problem with the shadow, can't you do it the same way?
by devilwarriors
Tue Aug 30, 2016 1:28 pm
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

turn out the hardness won't do it, since I would have to reduce the speed of the mining tool to close to nothing for this to work and that would defeat the purpose of my mod.
by devilwarriors
Tue Aug 30, 2016 1:26 pm
Forum: Modding help
Topic: on_preplayer_mined_item is not fired at right time.
Replies: 8
Views: 1686

Re: on_preplayer_mined_item is not fired at right time.

Fixed the documentation for 0.14.2. Any entity can have "minable" property, which is table that can contain: mining_time, result/results, mining_particle, mining_trigger and hardness Mining tool has property speed. As I understand it, mining progress is multiplied by (speed - hardness), a...
by devilwarriors
Tue Aug 30, 2016 12:47 pm
Forum: Modding help
Topic: on_preplayer_mined_item is not fired at right time.
Replies: 8
Views: 1686

Re: on_preplayer_mined_item is not fired at right time.

it's not the damage, and there really nothing else in the doc about hardness or how it work beside setting a ressources hardness.. so what am I looking for??
by devilwarriors
Tue Aug 30, 2016 3:31 am
Forum: Modding help
Topic: on_preplayer_mined_item is not fired at right time.
Replies: 8
Views: 1686

Re: on_preplayer_mined_item is not fired at right time.

so it's the damage that the mining-tool deal that decide what hardness it can mine?? how does the math work?
by devilwarriors
Tue Aug 30, 2016 3:19 am
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

Or you could check the `player.selected` entity only, store its reference and make it minable again once player removes cursor from it. Still would be weird in multiplayer, where one person could prevent the other from mining stuff by looking at the same thing. That might actually work really well ...
by devilwarriors
Tue Aug 30, 2016 3:16 am
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

How do to set what the max hardness a mining-tool can mine? Can't seem to find anything on that in the doc.

also building are like 0.2 hardness so that wouldn't really work either way..
by devilwarriors
Tue Aug 30, 2016 3:04 am
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

Another option would be the ability to define which categories/groups of things a mining tool can mine. I don't know if there's already some way to do this? There's `hardness` property of the resources, if tool is not hard enough, then it can't mine that resource. Trees and other default entities h...
by devilwarriors
Tue Aug 30, 2016 3:03 am
Forum: Modding help
Topic: on_preplayer_mined_item is not fired at right time.
Replies: 8
Views: 1686

Re: on_preplayer_mined_item is not fired at right time.

oh nice, completely missed that, thanks!
by devilwarriors
Tue Aug 30, 2016 2:36 am
Forum: Modding help
Topic: on_preplayer_mined_item is not fired at right time.
Replies: 8
Views: 1686

Re: on_preplayer_mined_item is not fired at right time.

Rseding91 wrote:The docs are just wrong.

As for your other comments: just set the entity to not minable to begin with if the player shouldn't be able to mine it.
But I wan't those entity to be mineable, just not by that particular mining-tool :(
by devilwarriors
Tue Aug 30, 2016 2:31 am
Forum: Modding help
Topic: on_preplayer_mined_item is not fired at right time.
Replies: 8
Views: 1686

on_preplayer_mined_item is not fired at right time.

Hi, The api clearly say that on_preplayer_mined_item fire when the player start mining something "Called when the player starts mining something" http://lua-api.factorio.com/latest/events.html#on_preplayer_mined_item Yet it actually fire on the same tick # as on_preplayer_mined_item, right...
by devilwarriors
Tue Aug 30, 2016 1:19 am
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

Use on_put_item if you are holding an item, but chances are you have it set as a mining-tool and if thats the cause then you could try to change the cursor_stack portion to get the weapon inventory. Not sure if on put item triggers in this case though script.on_event(defines.events.on_put_item, fun...
by devilwarriors
Tue Aug 30, 2016 12:20 am
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

aubergine18 wrote:Another option would be the ability to define which categories/groups of things a mining tool can mine. I don't know if there's already some way to do this?
nope haven't found anything like that
by devilwarriors
Tue Aug 30, 2016 12:01 am
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

I don't know if it's working as intended or bugged but I remember trying to use it to set mineable to false and it wasn't working. Just tryed again and yeah it's not working, the entity is mined regardless. And I logged the tick id and it's the same for both call, so they are executed one after the...
by devilwarriors
Mon Aug 29, 2016 11:50 pm
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

on_preplayer_mined_item is actually the whole problem, it's not what everyone thing it is.. It's not triggered when you start mining something, it's triggered when you finish mining right before the entity is pulled from the ground, so it's triggered probably in the same tick as on_preplayer_mined_i...
by devilwarriors
Mon Aug 29, 2016 11:18 pm
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

But I thought of something while writhing this.. maybe I could make the entity that are not tree, around the player (in it's data.raw.player.player.reach_distance), temporarely non minable .. entity.mineable is a write/read so that should work. It won't work well with multiplayer and the true-long-r...
by devilwarriors
Mon Aug 29, 2016 11:10 pm
Forum: Modding help
Topic: modify LuaItemStack in on_player_mined_item?
Replies: 17
Views: 3385

Re: modify LuaItemStack in on_player_mined_item?

I've not tried this, but can't you just set the 'result' property of the 'minable' table in the entity / resource prototype? https://forums.factorio.com/viewtopic.php?f=25&t=31277 It's that I don't want to change the result for every entity of that kind, just for that one time when you mine som...
by devilwarriors
Mon Aug 29, 2016 10:53 pm
Forum: Modding help
Topic: Entity Prototype error
Replies: 3
Views: 1400

Re: Entity Prototype error

data:extend( { { type = "item", name = "advanced-chemical-plant", icon = "__base__/graphics/icons/chemical-plant.png", flags = {"goes-to-quickbar"}, subgroup = "production-machine", order = "e[advanced-chemical-plant]", place_result = &quo...

Go to advanced search