I am trying the "Hardcorio" Mod. Among other things, I think that the vanilla game didn't originally automatically put ammo back into your guns when you depleted, which given how the mod's weapons were setup, seems to have been taken advantage of.
How might I go about reverting this behavior, if possible?
Disable Auto-reload Ammo
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Disable Auto-reload Ammo
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Disable Auto-reload Ammo
By finding `insert` in the mod code and commenting it?
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Disable Auto-reload Ammo
I meant that it was a vanilla feature I wanted to disable to add on to the mod. Its not part of the mod so far as I can tell.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Re: Disable Auto-reload Ammo
Oh, vanilla when your ammo slot is depleted, if there's more of the same type of ammo in the inventory, then it is automatically inserted into gun.
If you're looking to prevent that, I don't know, any solution I can think of is more trouble than it's worth.
If you're looking to prevent that, I don't know, any solution I can think of is more trouble than it's worth.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: Disable Auto-reload Ammo
Adil wrote:Oh, vanilla when your ammo slot is depleted, if there's more of the same type of ammo in the inventory, then it is automatically inserted into gun.
If you're looking to prevent that, I don't know, any solution I can think of is more trouble than it's worth.
Code: Select all
script.on_event(defines.events.on_player_gun_inventory_changed, function (event)
remove_ammo_stack_or_something(game.players[event.player_index]
end)
function remove_ammo_stack_or_something(player)
do some logic to move the stack back to the main inventory
end
- Ranakastrasz
- Smart Inserter
- Posts: 2174
- Joined: Thu Jun 12, 2014 3:05 am
- Contact:
Re: Disable Auto-reload Ammo
How do I distinguish between player and automatic action?
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Disable Auto-reload Ammo
See if you get this event beforehand, also I don't think robots can place ammo in the ammo slots, only main inventory slots.
http://lua-api.factorio.com/latest/even ... ck_changed
http://lua-api.factorio.com/latest/even ... ck_changed
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Disable Auto-reload Ammo
You could watch for cursor stack changed and only stop the filling if the item wasn't in the cursor
Re: Disable Auto-reload Ammo
shift-click doesn't count as cursor stack change
yet it can be used for reloading.
yet it can be used for reloading.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.