a week ago
Hi,
I have a calculation that checks the current scale for the 2D Script. It calculates a max height based on the current scale.
2D Script:
MaxHeight = Val_A + VAL_B
The height needs to limit the movement of a Hotspot using VALUES RANGE command. The VALUES RANGE command is placed in the Masterscript, but not in the 2D Script as far as I know. But when I do this, the MaxHeight doesn't seem to register. I have also tried placing the following VALUE RANGE command in the parameters script without success.
Master Script:
VALUE 'Hotspot_Y' RANGE (0, MaxHeight)
Is there a way to pass a result from the 2D script to the Master Script so I can limit the movement of the hotspot?
Any ideas most welcome, Matt
a week ago
The scale you are requesting, as I understand, is controlled by GLOB_SCALE. This global variable is not allowed in the Parameter Script or the Master Script when it runs as a Parameter Script. Therefore, moving the relevant part of the 2D Script to the Master Script will not work if combined with a VALUES command. The reason is that VALUES is always executed as part of the Parameter Script, even if placed in the Master Script. (You can test it to confirm, but I believe it won’t work.)
The command VALUE 'Hotspot_Y' RANGE (0, MaxHeight) cannot work in the Parameter Script because it must use VALUES.
However, in your case, the VALUES command should work in both the Master Script and the Parameter Script.
a week ago
Hi Jochen,
Thank you for your reply!
Oddly the VALUES command doesn't seem to limit in anyway the hotspot in Master or Parameter script. The 0 value nor the MaxHeight limits are not applied:
Master or Parameter Script
VALUES 'Hotspot_Y' RANGE (0, MaxHeight)
I am wondering if only it is because the Master and Parameter scripts are run before the 2D scripts where the GLOB_SCALE calculation resides. The MaxHeight value doesn't seem to be able to be called from the 2D Script, rendering the VALUES command null?
2D Script
VAL_B = GLOB_SCALE
MaxHeight = Val_A + VAL_B
Is there maybe someway to create a variable to pass the value through from within the 2D script by adding:
VAL_B = GLOB_SCALE
MaxHeight = Val_A + VAL_B
Var_MxHt = MaxHeight
And then calling the variable in the Master or Parameter Script with:
VALUES 'Hotspot_Y' RANGE (0, Var_MxHt)
It is most perplexing for me!
Kind regards, Matt
a week ago
If you want to pm me we could chat over Google or something to solve things for you in real time. I've been doing this for a few others here and there.
a week ago
In Parameter-Script the following works for me:
MaxHeight = B
VALUES 'Hotspot_Y' RANGE [0, MaxHeight]
together with the 2D-Script, the range of the Hotspot is limited to the values given by VALUES.
HOTSPOT2 0, -0.1, htps, Hotspot_Y, 3 : htps = htps + 1
HOTSPOT2 0, 0, htps, Hotspot_Y, 1 + 128: htps = htps + 1
HOTSPOT2 0, Hotspot_Y, htps, Hotspot_Y, 2: htps = htps + 1
RECT2 0, 0, A, Hotspot_Y
But the passing of the Maxheight-Value from 2D to ParamScript does not work and the limitations do not work correctly in 2D, when I declare the Maxheight-Value in Master oder Param.
My idea would be the follwing:
- create an own Library Global object where you set manually a variable for the scale. And use this variable in the object to calculate the Maxheight-Value.
- additional to the Scale, change the MVO-Settings for every view you create.
Maybe Seneca will have a better solution, in which I will be interested as well.
a week ago
Hi Jochen,
Thank you so much for your response and the idea of a Library Global object with a manual variable for scale. That is something I will investigate, a little more complex than I am used to but I have read about a Library Global object for other parameters so I am keen to try this in the New Year.
Wishing you a relaxed and great Christmas and holiday season! From Matt