Get watercolour from map

Get watercolour from map

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Get watercolour from map

Post 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?
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Get watercolour from map

Post 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.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Get watercolour from map

Post 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)
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: Get watercolour from map

Post 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?..
Post Reply

Return to “Lua Scripts”