Thanks for the help regarding this. It took me a while, but I finally have something that works.
script.on_event({defines.events.on_tick},
function (e)
for _,player in pairs(game.connected_players) do
local guns = player.get_inventory(defines.inventory.player_guns)
local mags = player.get ...
Search found 10 matches
- Mon Apr 09, 2018 9:28 pm
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
- Sun Feb 11, 2018 8:30 am
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
Re: I really need help with my mod
I apologize for my noobishness in advance, This works, but it still only checks in ammo slot 1 it seems... I have tried to use the #inventory stuff, but it just throws up errors, It would be nice to know where the inventory cycling piece of code actually goes in the structure of the script. as for ...
- Sun Feb 11, 2018 4:34 am
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
Re: I really need help with my mod
hmm, with this piece of code
script.on_event({defines.events.on_tick},
function (e)
for index,player in pairs(game.players) do
for slot=1,,3 do
local gun = global[index].guns[slot]
local mag = global[index].ammo[slot]
it says that its indexing "?" a nil value... crash
what exactly is global ...
script.on_event({defines.events.on_tick},
function (e)
for index,player in pairs(game.players) do
for slot=1,,3 do
local gun = global[index].guns[slot]
local mag = global[index].ammo[slot]
it says that its indexing "?" a nil value... crash
what exactly is global ...
- Sun Feb 11, 2018 3:36 am
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
Re: I really need help with my mod
thanks for the help. I generally don't do models on request, but if it's something simple that i could knock off in an hour or two, I don't see why I cant.. what did you have in mind?
- Sun Feb 11, 2018 12:26 am
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
Re: I really need help with my mod
thanks for the suggestions,
try script.on_event({defines.on_player_ammo_inventory_changed} doesn't seem to register when ammo is drained from a magazine, and thus only triggers when the amount on magazines in the inventory has changed. Since the scrip im using "preemptively" checks how many bullets ...
try script.on_event({defines.on_player_ammo_inventory_changed} doesn't seem to register when ammo is drained from a magazine, and thus only triggers when the amount on magazines in the inventory has changed. Since the scrip im using "preemptively" checks how many bullets ...
- Sat Feb 10, 2018 11:10 pm
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
Re: I really need help with my mod
alright, thanks to you I have managed to create a reload script:
script.on_event({defines.events.on_tick},
function (e)
--if e.tick % 60 == 0 then
for index,player in pairs(game.connected_players) do
local inventory = player.get_inventory(defines.inventory.player_ammo)
if player.character and ...
script.on_event({defines.events.on_tick},
function (e)
--if e.tick % 60 == 0 then
for index,player in pairs(game.connected_players) do
local inventory = player.get_inventory(defines.inventory.player_ammo)
if player.character and ...
- Sat Feb 10, 2018 11:08 am
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
Re: I really need help with my mod
thanks for the help... I have found a potential way to implement reloading for factorio weapons, but I am having difficulty coding what I am thinking of.
I now know that .ammo can be used to check ammo remaining in a magazine, but I don't know where to use it in the code.. is it ("firearm-magazine ...
I now know that .ammo can be used to check ammo remaining in a magazine, but I don't know where to use it in the code.. is it ("firearm-magazine ...
- Fri Feb 09, 2018 11:55 am
- Forum: Modding help
- Topic: I really need help with my mod
- Replies: 16
- Views: 5235
I really need help with my mod
I have been creating a mod that overhauls weapons in factorio and I really want to impliment a reload system
the code would go something like this
control.lua
script.on_event({defines.events.on_tick},
function (e)
for index,player in pairs(game.connected_players)
if player.character and [mod ...
the code would go something like this
control.lua
script.on_event({defines.events.on_tick},
function (e)
for index,player in pairs(game.connected_players)
if player.character and [mod ...
- Thu Jun 09, 2016 9:17 pm
- Forum: Mods
- Topic: MOD [0.12.x] Firearms Plus_1.0.0
- Replies: 2
- Views: 2323
Re: MOD [0.12.x] Firearms Plus_1.0.0
Thanks,
I know some of the guns are ridiculously powerful but when I tested the mod i found that because everything is so expensive i balances out (I'm still going to make ammo cheaper though)
I know some of the guns are ridiculously powerful but when I tested the mod i found that because everything is so expensive i balances out (I'm still going to make ammo cheaper though)
- Thu Jun 09, 2016 9:09 am
- Forum: Mods
- Topic: MOD [0.12.x] Firearms Plus_1.0.0
- Replies: 2
- Views: 2323
MOD [0.12.x] Firearms Plus_1.0.0
FA+ Logo.png
Details:
Factorio Version: 0.12x
Current Mod Version: 1.0.0
Released: 09-Jun-2016
Dependencies: None
License: Please ask permission before using anything from my mod for something else
Locale: en
Download Link:
FirearmsPlus_1.0.0.zip
Description:
Adds many new weapons in 4 ...
Details:
Factorio Version: 0.12x
Current Mod Version: 1.0.0
Released: 09-Jun-2016
Dependencies: None
License: Please ask permission before using anything from my mod for something else
Locale: en
Download Link:
FirearmsPlus_1.0.0.zip
Description:
Adds many new weapons in 4 ...