Loading...
  OR  Zero-K Name:    Password:   

What's wrong with this terraform syntax?

10 posts, 458 views
Post comment
Filter:    Player:  
sort
The goal is widgeting terraform raise orders by being able to manually input numbers.

Spring.GiveOrderToUnit(constructor[1], CMD_TERRAFORM_INTERNAL, {terraform_type,team,loop,terraformHeight,points,#constructor,volumeSelection,x1,y1,z1,x2,y2,z2,constructor[1]}, {"shift"})

here is the same thing with manually fed values for a raise order:

spGiveOrderToUnit(
4734,
-432,
{
2,
myTeamID,
false,
60,
0,
1,
2,
100,0,100,
200,0,200,
4734
},
{"shift"}
)

What have I got wrong?

+0 / -0


8 years ago
points=0 ?
+0 / -0
8 years ago
oh yeah, big part of confusion: what is "points"? the number of coord points expected? the number of lasso points?
+0 / -0
See Klon's widget, It has correct terraform implementation.

From the first sight:
1) you should specify "loop" as 0 or 1, not like false/true
2) for terraform type 2, you need to specify only (x,z) pairs, while height is specifiied as 4th parameter
3) #of points should be correct. E.g., for 4 pairs of x,z it will be 8.
+1 / -0
8 years ago
RUrankivand what is "klon's widget"?
+0 / -0

8 years ago
USrankAutoWar, see http://zero-k.info/Forum/Thread/19667
+1 / -0
I think this should obey all the rules. What did I do wrong this time?

http://pastebin.com/aBUDMg9h
+0 / -0
Here's the dump I've just got from a skydust order:
http://hastebin.com/cevunaheku.css

P.S. I was wrong with 3) Correct number should have been 4, not 8
+0 / -0
OK so for future readers the general syntax for rectangle based terraform parameters and orders is:

local terraformParametersArray = {}

terraformParametersArray[1]

(a number) --

terraform_type -- 1

level, 2

raise, 3

smooth, 4

ramp, 5 = restore

terraformParametersArray[2]

(a number) --

team -- teamID of the team doing the terraform

terraformParametersArray[3]

(a number) --

loop -- true

(1), and false

(0) --needs to be true to create closed rectangle, false only terraforms along the lasso line

terraformParametersArray[4]

(a number) --

terraform_command_height = height change value of the terraform order relative to the ground, uses positive numbers or negative numbers.

terraformParametersArray[5]

(a number) --

#coordinates -- how many (x,z) coordinate point there are in the rectangle/linedraw

terraformParametersArray[6]

(a number) --

#selectedconstructorsArray -- how many constructors will recieve this terraform order

terraformParametersArray[7]

(a number) --

volumeSelection -- 0

none, 1

only raise, 2 = only lower -- raise only will block terracommands with negative height input, lower only will block terracommands with positive height input. This parameter should normally be left 0, because it can interfere with restore and interefere with smooth.

terraformParametersArray[8] = (a number) -- rectangle corner 1, x1
terraformParametersArray[9] = (a number) -- rectangle corner 1, z1
terraformParametersArray[10] =(a number) -- rectangle corner 2, x2
terraformParametersArray[11] =(a number) -- rectangle corner 2, z2
terraformParametersArray[12] =(a number) -- rectangle corner 3, x3
terraformParametersArray[13] =(a number) -- rectangle corner 3, z3
terraformParametersArray[14] =(a number) -- rectangle corner 4, x4
terraformParametersArray[15] =(a number) -- rectangle corner 4, z4

--every additional param after parameter[15] must always be another constructor's unitid that will inherit the order to assisting the terraunits created by the commandid.
terraformParametersArray[16] =(a number) -- unitID == selectedconstructorsArray[a number index]

spGiveOrderToUnit(unitID, CMD_TERRAFORM_INTERNAL, terraformParametersArray, {"shift"})
+0 / -0

8 years ago
quote:
height change value of the terraform order relative to the ground, uses positive numbers or negative numbers

for level this is not relative to the ground, but absolute
for ramps this is the width

quote:
how many (x,z) coordinate point there are in the rectangle/linedraw

exception: for ramps this is (x,y,z)

quote:
raise only will block terracommands with negative height input, lower only will block terracommands with positive height input.

does not block commands based on height input: blocks height changes based on their direction

quote:
rectangle corner 1, x1

note it supports arbitrary shapes (remember to adjust the 5th variable)

quote:
terraformParametersArray[16] =(a number) -- unitID

ditto, won't always be 16 (based on many points you added and whether it's a ramp)
+1 / -0