Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function widget:GetInfo()
- return {
- name = "Terraform Test",
- desc = "understanding terraform commands",
- author = "AutoWar",
- date = "2015",
- license = "GNU GPL, v2 or later",
- layer = 9999,
- enabled = true
- }
- end
- -----------------------------------------------------------------
- local spEcho = Spring.Echo
- local spGiveOrderToUnit = Spring.GiveOrderToUnit
- local myTeamID = Spring.GetMyTeamID()
- -----------------------------------------------------------------
- local CMD_RAMP = 39734
- local CMD_LEVEL = 39736
- local CMD_RAISE = 39737
- local CMD_SMOOTH = 39738
- local CMD_RESTORE = 39739
- local CMD_BUMPY = 39740
- local CMD_TERRAFORM_INTERNAL = 39801
- --Spring.GiveOrderToUnit(constructor[1], CMD_TERRAFORM_INTERNAL, {terraform_type,team,loop,terraformHeight,points,#constructor,volumeSelection,x1,z1,x2,z2,constructor[1]}, {"shift"})
- function widget:UnitCreated(unitID, unitDefID, unitTeam, builderID)
- local terraformParametersArray = {}
- if unitTeam==myTeamID then
- terraformParametersArray[1] = (2) -- = terraform_type -- 1 = level, 2 = raise, 3 = smooth, 4 = ramp, 5 = restore
- terraformParametersArray[2] = myTeamID -- = team -- teamID of the team doing the terraform
- terraformParametersArray[3] = (1) -- = loop -- true (1) or false (0) --need to be closed
- terraformParametersArray[4] = (100) --height (of the terraform order???)
- terraformParametersArray[5] = (4) -- how many points there are in the rectangle/lasso
- terraformParametersArray[6] = (1) -- how many constructors are working on it
- terraformParametersArray[7] = (0) -- = volumeSelection -- 0 = none, 1 = only raise, 2 = only lower
- terraformParametersArray[8] = (100) -- first coordinate point x
- terraformParametersArray[9] = (100) -- first coordinate point z
- terraformParametersArray[10] =(200) -- second coordinate point x
- terraformParametersArray[11] =(200) -- second coordinate point z
- terraformParametersArray[12] =(builderID) -- constructor unitID
- spGiveOrderToUnit(builderID, CMD_TERRAFORM_INTERNAL, terraformParametersArray, {"shift"})
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement