Two units to be displayed as when you choose "build". Example of the picture. needed: - Simultaneously display two units - Display the grid - Align to grid - Display the availability of construction for each cell
Looking for code samples, commands, lua, widgets or other assistance ...Please help.
Thank you for your help! Unfortunately I have not found answers to their questions. In the subject being discussed tech tree, but I'm only interested in place to build. I need to display identical image, but so that I could manage it himself. Maybe I did not understand your example? If so tell me where to find the flow.
how to check whether it is possible to construct an arbitrary unit (UnitID) at an arbitrary position (x, y, z) (with details like the image)?
this function "ClosestBuildSite" not accesible from Lua Widget? Where can I find a complete list of features available in LUA? Here "http://springrts.com/wiki/Lua_Scripting" does not list all the functions ... For example there is no "Pos2BuildPos"
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
ah i understand. You want something like "can not build here because at 500:450 the terrain slope is too steep and there is a tree at 510:455" There are 4 things that can block building: 1) features (rocks, trees) -> you can test for those yourself 2) other units -> you can test for those yourself, too 3) water is too deep or too shallow -> possible to read terrain height 4) terrain is too steep -> possible to read terrain slope, too 5) is there a geovent? (for geo powerplant) -> can that for that too (maybe forgott something)
So you could test everything yourself using GetFeatures and GetUnits functions. If there is something easier, I dont know.
knorke, thank you very much for your patience and responsiveness!
knorke wrote:
1) not interested 2) not interested 3) not interested 4) terrain is too steep -> possible to read terrain slope, too How? 5) not interested
I decided to do without until the detail - it is difficult and the result is not worth it. If I find an affordable solution append script. Otherwise, the result is achieved.
Added In the picture example of mode "ShowPathMap" (F2) and the team "build." You can get similar data from Lua Widget?
Joined: 22 Feb 2006, 01:02 Location: cheap kitchen
Tanatos wrote:
4) terrain is too steep -> possible to read terrain slope, too How?
Spring.GetGroundNormal ( number x, number z ) -> number x, number y, number z A groundnormal is a vector that sits orthogonal on the terrain. (imagine the S shaped curve is terrain) On flat ground it will point straight to the sky (0, 1, 0) You have to compare it to the maxSlope of the unitDef you are trying to build. (needs some math to convert etc)
Yes, combining all this it would be possible to get something similiar like the F2 map. Just wondering what you need it for? Are you making a game or a widget or something else?
Thank you very much for your answers! Special thanks for "maxSlope of the unitDef", sure it is key information for solving the problem.
I do not have a specific goal. Programming, a hobby of mine. Now I'm curious to deal with Lua scripts in the Spring. Learn what is already written. In the course of the study come to mind that can be done. I try to do it. Put questions and seeking answers. Something like this:)
Users browsing this forum: No registered users and 2 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum