Page 1 of 1

Possible to change values of Spring/Mod globals?

Posted: 25 Nov 2010, 22:25
by Pithikos
I was wondering what role the engine's/mods' constants and variables play. Are they only readable or is it possible to change the value?

I tryied changing the Game.Gravity to 0.1 in a gadget and it seems like it changed although in the game I didn't see any visual difference..

Re: Possible to change values of Spring/Mod globals?

Posted: 26 Nov 2010, 09:20
by knorke
according to wiki Game.gravity is a constant, so you can not change it.
i am pretty sure units & projectiles have a mygravity or something you could try changing that.

Re: Possible to change values of Spring/Mod globals?

Posted: 26 Nov 2010, 09:52
by zwzsg
If you change the values of all those constant in Lua, they will be changed for when other Lua gadgets read them, but not for the C++ simulation.

At the start of the game, all those constant are copied into Lua variables. The Lua copy is read/write, because there is no read-only in the Lua language. However, they are not meant to be overwritten, and overwritting them will achieve nothing except you losing the ability to know the original value.

Re: Possible to change values of Spring/Mod globals?

Posted: 26 Nov 2010, 13:51
by aegis
zwzsg wrote:no read-only in the Lua language
not true but otherwise yes