Regarding Scripting and automation

Hey ! New World Machine user here.

We’ve started working with World Machine and are very impress so far.

We are about to start a project and I would like to know if it possible with automation to generated a “sequence of height field” ?

We would like to build a basic world and then with automation create 200 versions of the same terrain with a slightlydifferent erosion setting.
Something like that:

-Open my world machine file -Add 1 to a value in erosion -save the height field withe de name: MyHeight.1.tiff

-Open my world machine file
-Add 2 to a value in erosion
-save the height field withe de name: MyHeight.2.tiff

-Open my world machine file
-Add 3 to a value in erosion
-save the height field withe de name: MyHeight.3.tiff

Is it possible with automation ? If so, is there script exemples somewhere that could guide me to achieve that.

Thanks, hope to be of some help someday in this comunity.

Ok… I found a solution.
I’ve made a vbscript that generate a long automation script that change the value of my variablea for every frame.
It then render out my images with the automation file that was created by the vb script.

Juste copy the code below in a notepad and rename it to Script_maker.vbs and double click it

I use Filejuggler to move and rename my output images so World Machine wont overwrite the previous frame. File Juggler is king of sloppy so in order to make sure it wont skip any frame I’ve copy the same rule 3 times.

'The worl Machine file MyWorldMachineFile = "E:\Projet\World Machine Documents\Terrain_02.tmd"

'Where the automation script will be outputed
Myscriptfile = “E:\Projet\World Machine Documents\Terrain_02.tms”

'You ccan put as many variable you want between the quotation marks… Put the name of the variable, the value at start, and the value at the end of the animation
'Myvariables = “MyVariable,0,1,MyVariable02,5,10,MyVariable04,25,50,MyVariable05,4,5”
Myvariables = “MyVariable,0,1”

'The number of frames you want generated
Mynumberofframe = 500

mysplit = split (Myvariables,“,”)
monnbrvariable = (ubound (mysplit)+1) /3

Set fs = CreateObject(“Scripting.FileSystemObject”)
Set a = fs.CreateTextFile(Myscriptfile, True)

a.writeline ( “<?xml version="&chr(34)&"1.0"&chr(34)&" encoding="&chr(34)&"UTF-8"&chr(34)&" standalone="&chr(34)&"no"&chr(34)&"?>” )
a.writeline ( “<automation version=”&chr(34)&“WMP2.0A”&chr(34)&“>” )
a.writeline ( " " )
a.writeline ( " " )

for i = 1 to Mynumberofframe
a.writeline (“<echo text=”&chr(34)&" Frame"&i&chr(34)&“/>”)
a.writeline ( " <section name=“&chr(34)&“Normal Build”&chr(34)&”>" )
a.writeline ( " " )
a.writeline ( " ")

	for ii = 0 to monnbrvariable -1
	increment = ( mysplit(ii*3+2) - mysplit(ii*3+1) ) / ( Mynumberofframe - 1 )
	myvalue = mysplit(ii*3+1)+ ( increment*( i-1) )
		a.writeline ("			<var name="&mysplit(ii*3)&" value="&chr(34)&myvalue&chr(34)&"/>" )

	next	
	
a.writeline ( "		</variables>")       
a.writeline ( "		<build mode="&chr(34)&"normal"&chr(34)&"/>")
a.writeline ( "	</section>" )
a.writeline ( " " )

next

a.writeline (“<echo text=”&chr(34)&" Script termine"&chr(34)&“/>”)
a.writeline ( “” )