How to create the base script file?

134 views
Skip to first unread message

Antony James

unread,
Apr 25, 2021, 1:08:01 PM4/25/21
to OpenVSP
I know we can change the parameters in the script file for optimization, 
but how do I create the base script file?
Should I create the base script file by typing letters(certainly I can cope functions from other script files)? 
Is there any better way to create the base script file? 
For example, can i write the content text of one function in the base script file automatically by calling some functions of one programming language such as C#?

Brandon Litherland

unread,
May 6, 2021, 1:54:04 PM5/6/21
to OpenVSP
If I understand your question correctly, there isn't a way to automate the scripting of a certain process in similar way to recording a macro or recording the steps.  There used to be a Record Script or Generate Script feature that may have been completely separate and only available back in VSP 2.  No such feature or process is distributed at present.  
Generally, the best way to begin scripting is to look at the examples in the "scripts" directory of your OpenVSP storage location.  Quite a lot of what you need to get started can be learned by reading through the files there.  For more specific applications, the OpenVSP Python API documentation has an _extensive_ library of functions available which generally have a one-to-one relationship with the AngelScript version, barring some syntax differences.

Technically, you could build VSP yourself with the connection to some program that reads all of the function calls and records them in a "script" but to be honest it likely wouldn't write in AngelScript which means VSP can't execute it outright.  Furthermore, this process produces lots of unnecessary steps which makes the script inefficient.  For example, each time you move the camera view is recorded as an action; or if you perform a step in the process that you need to back out of.

It is generally best practice to script specific processes that are repeated and robust to change.  For more complex automation, we recommend using the Python API.

Cheers.
Reply all
Reply to author
Forward
0 new messages