Page 1 of 1

Changing a player prototype value in control.lua

Posted: Fri Mar 20, 2015 6:26 pm
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.

Re: Changing a player prototype value in control.lua

Posted: Fri Mar 20, 2015 7:26 pm
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

Re: Changing a player prototype value in control.lua

Posted: Fri Mar 20, 2015 10:40 pm
by MrP123
That sounds like a good idea. I'm looking into that tomorrow.
Thanks!