So I have this mod: viewtopic.php?f=93&t=47506
And I want my armor to use the power armor mk2 sprite, which I achieved by way of modifying demo-entities.lua, the problem is I essentially copied the whole file and applied my changes that way, which apparently breaks any mod that alters the base character stats, or at least inventory size.
Specifically I modified line 612 too look like this:
611 -- modular armors are not in the demo
612 armors = data.is_demo and {} or {"modular-armor", "power-armor", "power-armor-mk2", "power-armor-mk3"},
I'm a novice at best and am basically fumbling in the dark here, any help would be greatly appreciated.
Problem adding player sprite
-
- Long Handed Inserter
- Posts: 77
- Joined: Mon Oct 17, 2016 12:55 pm
- Contact:
Re: Problem adding player sprite
Wait you're replacing complete base game files? I recommend a simple modding tutorial on the basics on how to add stuff in general: https://wiki.factorio.com/Tutorial:Modd ... al/Gangsir.
-
- Long Handed Inserter
- Posts: 77
- Joined: Mon Oct 17, 2016 12:55 pm
- Contact:
Re: Problem adding player sprite
I've been over every resource I can find and still no luck, that tutorial was no help either, as it doesn't even begin to cover what I need to do.kikker450 wrote:Wait you're replacing complete base game files? I recommend a simple modding tutorial on the basics on how to add stuff in general: https://wiki.factorio.com/Tutorial:Modd ... al/Gangsir.
If anyone could point me in the right direction I'd appreciate it, at the moment I have to choose between having the player sprite show the armor or allow other mods to change the players inventory size.
Re: Problem adding player sprite
Found it for you: there is a piece of code on how the devs do it in Factorio\data\base\prototypes\entity\entities.luajimmy_1283 wrote: I've been over every resource I can find and still no luck, that tutorial was no help either, as it doesn't even begin to cover what I need to do.
If anyone could point me in the right direction I'd appreciate it, at the moment I have to choose between having the player sprite show the armor or allow other mods to change the players inventory size.
Code: Select all
for _, animation in ipairs(data.raw["player"]["player"]["animations"]) do
if animation.armors then
for _, armor in ipairs(animation.armors) do
if armor == "light-armor" then
animation.armors[#animation.armors + 1] = "heavy-armor"
break
end
end
end
end
Code: Select all
for _, animation in ipairs(data.raw["player"]["player"]["animations"]) do
if animation.armors then
for _, armor in ipairs(animation.armors) do
if armor == "power-armor-mk2" then
animation.armors[#animation.armors + 1] = "power-armor-mk3"
break
end
end
end
end
-
- Long Handed Inserter
- Posts: 77
- Joined: Mon Oct 17, 2016 12:55 pm
- Contact:
Re: Problem adding player sprite
Oh thank you so much for this, I knew there was a deep copy method, but couldn't for the life of me figure out how to apply it here, many mod authors will be happy to have this info I reckon, lol.