Im making a new mod to test some stuff ("player animations")
But the mod doesnt seem to work (seems to be ignored by the game)
http://www.mediafire.com/download/lk61j ... wimmod.zip
The download.
Im sure im forgetting something really basic but that I have only done once so I dont remember...
Am I forgetting something?
Re: Am I forgetting something?
The folder is called 'swimmod' the "name" field in the info is 'Swim mod', you've switched the name and title info. also Factorio complains about a character-clothes-run-mask.png and from looking at the code the player might 'glitch' back and forth from player to player-swimming when in water (though I couldn't test). This will also lead to the player losing their inventory...ficolas wrote:Im sure im forgetting something really basic
I used this function to swap inventory with the illness prototype mod I did recently
Code: Select all
function transferPlayerItems(old, new)
if new==nil then game.player.print("new is nil!") return end
local inv = {}
inv[1] = old.getinventory(defines.inventory.playerquickbar).getcontents()
inv[2] = old.getinventory(defines.inventory.playermain).getcontents()
inv[3] = old.getinventory(defines.inventory.playerguns).getcontents()
inv[4] = old.getinventory(defines.inventory.playertools).getcontents()
inv[5] = old.getinventory(defines.inventory.playerammo).getcontents()
inv[6] = old.getinventory(defines.inventory.playerarmor).getcontents()
for _,table in ipairs (inv) do
for name, count in pairs(table) do
new.insert{name=name,count=count}
end
end
game.player.character=new
old.destroy()
end
Re: Am I forgetting something?
Just remembered, second time I post the same question... but the first time was months ago... or maybe almost a year ago.
Yea I know the player looses his inventory and health, I was just testing with this code
Also water is still "solid" and why would character switch between one and the other when in water?
Yea I know the player looses his inventory and health, I was just testing with this code
Also water is still "solid" and why would character switch between one and the other when in water?
Re: Am I forgetting something?
It's an easy thing to forget...hm I believe I entirely forgot about player health when doing that illness mod, shame on me I also just realized it'd be quite easy to tweak that function to loop from 1 to 10 (arbitrary number) and get all possible inventories so it could be used with more than just the player (and if the player got additional inventories in the future).
Re: Am I forgetting something?
Also does that function work with the toolbar?
Re: Am I forgetting something?
The toolbar is defines.inventory.playerquickbar, so yes.ficolas wrote:Also does that function work with the toolbar?
edit: ah, hm, not sure if that works with the secondary quickbar due to how it's coded in C++ (simply switching secondary quickbar to be the primary). Would have to test to find out but if it doesn't you'd have to talk to the devs about changing how the source implements it.
edit: Also water is still "solid" and why would character switch between one and the other when in water?, hm took another look at the code and it seems I read it wrong there ignore that comment lol
Re: Am I forgetting something?
The mod works really derpy xD
sometimes the player walks on water (jesus! D:), biters can also walk on water (quite ob) and when the player goes in water, biters stop following him, and will never ever moar follow him.
sometimes the player walks on water (jesus! D:), biters can also walk on water (quite ob) and when the player goes in water, biters stop following him, and will never ever moar follow him.
Re: Am I forgetting something?
Well, now just give me the power to throw fireballs and cause earthquakes by clicking and I'll be a happy player