Hey guys,
I'm writing a lot of Kontakt Script Processor code and was thinking about a way to make my job easier. Here's an example of what I have in mind:
To create a button on the UI, resize it and reposition it in KSP, you would write something like this:
Now, wouldn't it be much easier to just write something like this ...
... and let UltraEdit convert that to the code that I mentioned above?
Basically something like the template feature, but it needs to happen on the push of a button and the text needs to be written to a new file. So I would have my file "Script.txt" open in UltraEdit, execute the mentioned functionality and then UltraEdit would create or overwrite a new file in the same directory called "Script_final.txt", copy each line of code from the first file to the second one but if it should stumble upon something like "create switch", it would replace that line with something else.
If this something that could be achieved with UE's scripting feature or is there any other function in UE that's better suited for the job?
What I want is that the inserted code goes into a new file. So that file A (the one that I'm working with) looks like this:
and file B that is interpreted by KSP will look like this:
Any help is highly appreciated. Thanks in advance.
Best,
Glaciac
I'm writing a lot of Kontakt Script Processor code and was thinking about a way to make my job easier. Here's an example of what I have in mind:
To create a button on the UI, resize it and reposition it in KSP, you would write something like this:
Code: Select all
declare ui_switch $Switch
$TempID := get_ui_id($Switch)
set_control_par($TempID,$CONTROL_PAR_POS_X,200)
set_control_par($TempID,$CONTROL_PAR_POS_Y,100)
set_control_par($TempID,$CONTROL_PAR_WIDTH,80)
set_control_par($TempID,$CONTROL_PAR_HEIGHT,20)
Code: Select all
create switch $Switch(200,100,80,20)
Basically something like the template feature, but it needs to happen on the push of a button and the text needs to be written to a new file. So I would have my file "Script.txt" open in UltraEdit, execute the mentioned functionality and then UltraEdit would create or overwrite a new file in the same directory called "Script_final.txt", copy each line of code from the first file to the second one but if it should stumble upon something like "create switch", it would replace that line with something else.
If this something that could be achieved with UE's scripting feature or is there any other function in UE that's better suited for the job?
What I want is that the inserted code goes into a new file. So that file A (the one that I'm working with) looks like this:
Code: Select all
create switch $Switch1(200,100,80,20)
create switch $Switch2(200,100,80,20)
create switch $Switch3(200,100,80,20)
Code: Select all
declare ui_switch $Switch1
$TempID := get_ui_id($Switch1)
set_control_par($TempID,$CONTROL_PAR_POS_X,200)
set_control_par($TempID,$CONTROL_PAR_POS_Y,100)
set_control_par($TempID,$CONTROL_PAR_WIDTH,80)
set_control_par($TempID,$CONTROL_PAR_HEIGHT,20)
declare ui_switch $Switch2
$TempID := get_ui_id($Switch2)
set_control_par($TempID,$CONTROL_PAR_POS_X,200)
set_control_par($TempID,$CONTROL_PAR_POS_Y,100)
set_control_par($TempID,$CONTROL_PAR_WIDTH,80)
set_control_par($TempID,$CONTROL_PAR_HEIGHT,20)
declare ui_switch $Switch3
$TempID := get_ui_id($Switch3)
set_control_par($TempID,$CONTROL_PAR_POS_X,200)
set_control_par($TempID,$CONTROL_PAR_POS_Y,100)
set_control_par($TempID,$CONTROL_PAR_WIDTH,80)
set_control_par($TempID,$CONTROL_PAR_HEIGHT,20)
Best,
Glaciac