Changing a player prototype value in control.lua

Place to get help with not working mods / modding interface.
Post Reply
MrP123
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Jan 31, 2015 1:13 pm
Contact:

Changing a player prototype value in control.lua

Post by MrP123 »

Hi guys!

Just a quick question I hope someone can answer.
For my mod I want to change the "collision_mask" variable in the player prototype at runtime (in the control.lua file) depending on a condition.
My problem is, that I wasn't able to come up with a way to change the prototype at runtime. I also didn't find anything on the wiki.

I hope you can help me.
Time Lapse Mod [0.11.x]
Time Lapse Mod [0.12.x]
enables you to make nice time lapses of your work within the game

Choumiko
Smart Inserter
Smart Inserter
Posts: 1352
Joined: Fri Mar 21, 2014 10:51 pm
Contact:

Re: Changing a player prototype value in control.lua

Post by Choumiko »

I think it's not possible. If you need only one different collision box you could copy the vanilla prototype in data.lua, change the box and swap the character in the control.lua (player.character) Not sure what happens with the inventory though. I know that TestMode and The Fat Controller do something like this

MrP123
Long Handed Inserter
Long Handed Inserter
Posts: 53
Joined: Sat Jan 31, 2015 1:13 pm
Contact:

Re: Changing a player prototype value in control.lua

Post by MrP123 »

That sounds like a good idea. I'm looking into that tomorrow.
Thanks!
Time Lapse Mod [0.11.x]
Time Lapse Mod [0.12.x]
enables you to make nice time lapses of your work within the game

Post Reply

Return to “Modding help”