Page 1 of 1

Spring.GetTerrainTypeData

Posted: 23 Feb 2010, 11:19
by Google_Frog
A function that takes a terrain type ID and outputs all the speedboost info and hardness would be very useful.

Spring.GetGroundInfo(number x, number z) means the entire has to be searched, it's messy.

Re: Spring.GetTerrainTypeData

Posted: 23 Feb 2010, 13:11
by Argh
You can read it from the map's file. You only need GetGroundInfo for realtime operations.

Re: Spring.GetTerrainTypeData

Posted: 23 Feb 2010, 13:20
by jK
Yeah, I already told you that you just need to VFS.Include the same file the engine does (forgot which one but I assume it's something like MapOptions.lua) and you will get a full list.

Re: Spring.GetTerrainTypeData

Posted: 23 Feb 2010, 14:24
by Google_Frog
jK wrote:Yeah, I already told you that you just need to VFS.Include the same file the engine does (forgot which one but I assume it's something like MapOptions.lua) and you will get a full list.
I remember SirMaverick looking at it and telling me that it wasn't possible. Anyway I will have a look later.

Re: Spring.GetTerrainTypeData

Posted: 23 Feb 2010, 16:24
by SirMaverick
Google_Frog wrote:
jK wrote:Yeah, I already told you that you just need to VFS.Include the same file the engine does (forgot which one but I assume it's something like MapOptions.lua) and you will get a full list.
I remember SirMaverick looking at it and telling me that it wasn't possible. Anyway I will have a look later.
I only told you that there is no other Lua function than GetGroundInfo to read the typemap.