Changes:Everything from
C03222008 plus...
- Fixed bug involving ships with animated textures
- On Warpin and On Warpout now On Warp In and On Warp Out to standardize things
- transpose and interpolate matrix functions now getTranspose and getInterpolated to standardize with vector
- Added model.BoundingBoxMin and model.BoundingBoxMax
- Added ship:giveOrder(), with 18+ orders. Docking and waypoints do work.
- Added gr.getVectorFromCoords, which returns a vector in 3D space from screen coordinates and a depth
- Added $On Mission Start and $On Mission End hooks
- Optional handle arguments in functions can be skipped with "nil"
- Fixed WaypointList handles
A few words:The focus for this build was pretty much all of the RTS requests.
ship:giveOrders works using the goals system, which is a more specific way of saying that it does the same thing as the player menu, but adding some of the capability of SEXP goals. You can't do anything with wings right now; at the point that it becomes an issue, I'm going to consider upgrading the scripting system so that you can just specify the wing in place of the target ship, rather than have an extra variable for wings.
Player priority is 1.0, while player orders to wings are .95, and initial orders taper out at .85 or so. I'm using floating point numbers to try and standardize things in Lua, since factors require one less calculation than percentages.
See orders_test-sct.tbm for an example script. When Mo warps in, Mo attacks Curly, Larry tries to dock with Mo, and Curly tries to evade Mo, while the Guide follows the waypoint list called Path.
getVectorFromCoords also has a lot of potential. gvfc_test-sct.tbm locks the targeted ship into your mouse cursor, much akin to the Half Life 2 gravity gun. :D Left-click and hold to increase the lock distance, right-click to decrease it.
Links:The buildScripting.html[attachment deleted by ninja]