In many programming languages such as C and Java, if you have a 3-component vector called 'thing' and want to change its X component, you usually use an assignment statement. Something like:
thing.x = 0.5
As I'm sure you know. But in functional programming languages you don't tend to use assignment statements like this. Instead, you use a function that returns a new vector, and with this you can construct a new vector with some of the old components and some of the new, e.g.
newThing = vector(0.5, oldThing.y, oldThing.z)
or another example might be:
newThing = vector(oldThing, 0.5, null, null)
Terragen's function nodes (blue nodes) work quite like a functional programming language.
"Build Vector" node constructs a vector but it's quite flexible. It works like the last example above. If the main input is another vector, it uses the values from that vector as a starting point. Then you can assign new values to some, all, or none of the X Y Z components. This means that if you have a vector but you want to change the X value, you feed your vector into a Build Vector's main input and then feed another node into the 'X' input, leaving Y and Z empty.
If you want to get the X, Y or Z components from a vector, you can use the "X to scalar", "Y to scalar" or "Z to scalar" nodes. So if you want to do something like this:
x = thing.x
y = thing.y
z = thing.z
then you would plug 'thing' into the main input of "X to scalar", "Y to scalar" and "Z to scalar".
I hope this helps.
Matt
https://planetside.co.uk/wiki/index.php?title=Build_Vectorhttps://planetside.co.uk/wiki/index.php?title=X_to_Scalar