Page 1 of 1

Get watercolour from map

Posted: 07 May 2013, 14:48
by Jools
Maybe a simple question:

Water colour is defined in map.smd as WaterBaseColor= r g b;. Is it possible to read those values into a gadget in a mod, and if so how? Is there a similar callin as getModInfo for maps that maybe works?

Re: Get watercolour from map

Posted: 07 May 2013, 15:36
by Cheesecan
http://springrts.com/wiki/Mapdev:mapinfo.lua

Check if mapinfo.water.planeColor != null to see if old smd map configs are also available in lua.

Re: Get watercolour from map

Posted: 07 May 2013, 16:10
by Jools
Yes, that's what I want. Only, for me the mapinfo variable was nil, and I could not get it with getModInfo or getMapInfo.

But I found that you can get it from engine like this:

color Game.waterBaseColor as table(r,g b)

Re: Get watercolour from map

Posted: 07 May 2013, 16:26
by Cheesecan
Would have been nice if it had worked in the same way instead of two separate paths. Future improvement fit for a student project?..