Accesso rapido:  

Forum: Wishes and new features

Topic: New forum - scripting - Page: 2

Questo argomento è obsoleto e potrebbe contenere informazioni obsolete o errate.

locoDogPRO InfinityModeratorMember since 2013
A lot of truth there, the complicated bit isn't learning the language, it only feels that way, the hard bit is being precise about what you want to happen, even in plain text.

For really long stuff with multiple queries and several variables, I write a logic tree in plain text, then translate to a logic tree in script, then use notepad++ short cuts to copy the tree, remove the tabs and reduce it to one line

The time consumed is saved fault finding, sounds drawn out but nowt worthwhile is easy.
 

Inviato Mon 29 Feb 16 @ 4:34 pm
locodog wrote :
A lot of truth there {Phantom's comments}, the complicated bit isn't learning the language,
it only feels that way, the hard bit is being precise about what you want to happen, even in plain text.

For really long stuff with multiple queries and several variables, I write a logic tree in plain text, then translate
to a logic tree in script, then use notepad++ short cuts to copy the tree, remove the tabs and reduce it to one line.


Phantom and Loco make very good points above. As a tech writer for many years, may I suggest STEP BY STEP EXAMPLES
of different logic trees as discussed above, so that the users can get a better "feel" for how this script logic all fits together.
This reinforces the initial ideas on this thread for a user forum dedicated to scripts. This will allow the users to interact with
each other and bounce ideas off each other in real time.

I don't see any downside to this idea.
 

Inviato Mon 07 Mar 16 @ 6:11 pm
VDJ scripting has a simple structure but that does not make it simple for any script that is lengthy. Basically a single line of conditionals that gets harder to read or explain or remember what it does the longer it gets. VDJ script is the way it is I suppose because it is intended to be 'simple' but I think much easier to write code in most any programming language then any complex script in VDJ. If people need to adapt to VDJ script I think easier to adapt to a restructured language.

When I had to do a scripting language before, I was told to make it simple and have a GUI for it. I am thinking to myself sure sure, lol, this scripting language had to be able to do multimedia titles with lots of logic!

So I did a simple scripting language that was fairly easy to use and fault tolerant, had variables, function calls, and had some structure to it. We did a quite a few titles with it, but knew from day one it would not cut it in the long run. Simple scripting did not compute. It is either simple because you are only doing very simple things or it is more robust because you need to be able to do more. Most people who were doing the scripting always wanted more too. After awhile I started on version2 of the scripting language and modeled it after C and some C++. I looked at several languages though first. C is free form and has a concise block structure to it. But it was not C. It had most of the C operators, same structure to it, but simpler variable and function naming. Also had to be fault tolerant. Parameters to functions etc. was easier etc. Functions were called procedure and you did not have to prototype them.

For VDJ script though, a basic script interface could syntax check, allow for better formatting, have commenting, and have macros. I am not one to say you should have some GUI that tries to do it all for you. That tends to be clumsy. You either know what you are doing or you don't. A GUI that creates some script for you can help but you still need to understand it. Should contain a nice editor, help, and other things. Would be nice I think if VDJ script had macros. I think you can record macros but does not look like you can have script macros. Is that right? I don't script much... as little as possible... and would not want to deal with it as it is anyway.

PhantomDeejay wrote :
For the button:
var_equal 'FilterLoopOut' 1 ? repeat_stop 'AutoFilterLoopOutOff' & filter 50% & loop_exit & set 'FilterLoopOut' 0 : play ? loop 1 & set 'FilterLoopOut' 1 & repeat_start_instant 'AutoFilterLoopOutOff' 150ms & filter +1% & param_smaller filter 99% ? set 'FilterLoopOut' 0 & repeat_stop 'AutoFilterLoopOutOff' & stop & filter 50% & loop_exit : nothing

For the LED:
var 'FilterLoopOut'

Variations:
A) You can change the loop length by adjusting this part of the script:
var_equal 'FilterLoopOut' 1 ? repeat_stop 'AutoFilterLoopOutOff' & filter 50% & loop_exit & set 'FilterLoopOut' 0 : play ? loop 1 & set 'FilterLoopOut' 1 & repeat_start_instant 'AutoFilterLoopOutOff' 150ms & filter +1% & param_smaller filter 99% ? set 'FilterLoopOut' 0 & repeat_stop 'AutoFilterLoopOutOff' & stop & filter 50% & loop_exit : nothing
B) You can perform a low-pass by modifying the script as following:
var_equal 'FilterLoopOut' 1 ? repeat_stop 'AutoFilterLoopOutOff' & filter 50% & loop_exit & set 'FilterLoopOut' 0 : play ? loop 1 & set 'FilterLoopOut' 1 & repeat_start_instant 'AutoFilterLoopOutOff' 150ms & filter -1% & param_bigger filter 1% ? set 'FilterLoopOut' 0 & repeat_stop 'AutoFilterLoopOutOff' & stop & filter 50% & loop_exit : nothing
C) You can alter the filter "speed" by adjusting this part of the script (bigger values makes the effect longer/slower to end)
var_equal 'FilterLoopOut' 1 ? repeat_stop 'AutoFilterLoopOutOff' & filter 50% & loop_exit & set 'FilterLoopOut' 0 : play ? loop 1 & set 'FilterLoopOut' 1 & repeat_start_instant 'AutoFilterLoopOutOff' 200ms & filter +1% & param_smaller filter 99% ? set 'FilterLoopOut' 0 & repeat_stop 'AutoFilterLoopOutOff' & stop & filter 50% & loop_exit : nothing


I retyped Phantom's example script to at least give it a little structure. Dots added since it my spaces were taken away.

var_equal 'FilterLoopOut' 1
.. ? repeat_stop 'AutoFilterLoopOutOff' & filter 50% & loop_exit & set 'FilterLoopOut' 0
.. : play
.......? loop 1 & set 'FilterLoopOut' 1 & repeat_start_instant 'AutoFilterLoopOutOff' 150ms...
.......... ? set 'FilterLoopOut' 0 & repeat_stop 'AutoFilterLoopOutOff' & stop & filter 50% & loop_exit
.......... : nothing



Just a simple indent and comments and some other things could be allowed in script editor. The script editor would produce VDJ script. Phantom goes on with samples A, B, and C, on how to change it to do some other things. But original could be given parameters with macros and take care of A, B, and C.

 

Inviato Thu 17 Mar 16 @ 8:18 pm
A first little step in the right direction would be a seperate window for editing the scripts which allows the use of tab and enter to give the script a better structure. And the posted scripts should include the tabs and enters if I copy these....





 

Inviato Sat 19 Mar 16 @ 11:06 am
locoDogPRO InfinityModeratorMember since 2013
A wee bit down the line and I'll be blogging full step by steps from plain text reasoning logic trees and final scripts, I just need a bit of time.
 

Inviato Sat 19 Mar 16 @ 8:51 pm
Scripts should have a name so you can refer to them and well described as to what they do. A library of such could then be accumulated. As it is now, you have a scattering of script that does something that most don't have clue about. So you need say here is some script that does something somewhere in the forums. Now go to it :) There is now a wiki page that is starting to organize the script, but think it could be even more formal then that.
 

Inviato Sun 20 Mar 16 @ 3:49 pm


(Vecchi argomenti e forum sono automaticamente chiusi)