When scripting, what do the numbers within the parenthesis determine?
SetWaveShape( "Simple Vertical", 4.9 );
SetColorMap( "Hero", 0 );
SetFlowField( "Right Turn", 0 );
SetNextFlowField( "Noise", "", 30, 5 );
I've noticed 4.9 is used a lot in examples, but what is that number controlling? And is the number controlling different aspects depending on which type of config it's used in—colormap, flowfield, etc?
Use of numbers
Moderators: BTT, andy55, b.dwall, juxtiphi
- nc_halfpint
- Posts: 8
- Joined: Fri Feb 03, 2006 5:56 pm
This example code came from the ctrl 3 txt in the scripts folder, (This example was extremly helpful for me)
You'll notice the different #'s used for setnextflowfield with an explanation of what each are for. Then down the time line where the change actually takes place that number is used again.
In this example, the 4 stands for the waveshapes duration.
SetSlideShow( CONFIG_WAVESHAPE | CONFIG_COLORMAP | CONFIG_FLOWFIELD, false );
SetFlowField( "Starburst", 0 );
SetWaveShape( "Parkening Power", 0 );
SetColorMap( "DT - November Rain", 0 );
0:01
StartParticle( "Sparkling Table Water" );
// When we're running in real time, we don't want an unsightly jump when we
// want to change to a specific field. We use SetNextFlowField() to schedule
// a field change (giving G-Force the abielily to precompute it). The first
// argument is the field name, the second is the union name, the third
// is how many seconds to wait until the change should occur, and the fourth
// is how many seconds the transition or "morph" should occur over.
SetNextFlowField( "Scattered Flow Out", "", 15, 4 );
0:12
StartParticle( "Sparkling Table Water" );
0:16
SetWaveShape( "Big and Banded", 4 );
// From time 0:01, "Scattered Flow Out" will start now (and morph for 4 secs)
0:25
SetSlideShow( CONFIG_WAVESHAPE | CONFIG_COLORMAP | CONFIG_FLOWFIELD, true );
You'll notice the different #'s used for setnextflowfield with an explanation of what each are for. Then down the time line where the change actually takes place that number is used again.
In this example, the 4 stands for the waveshapes duration.
SetSlideShow( CONFIG_WAVESHAPE | CONFIG_COLORMAP | CONFIG_FLOWFIELD, false );
SetFlowField( "Starburst", 0 );
SetWaveShape( "Parkening Power", 0 );
SetColorMap( "DT - November Rain", 0 );
0:01
StartParticle( "Sparkling Table Water" );
// When we're running in real time, we don't want an unsightly jump when we
// want to change to a specific field. We use SetNextFlowField() to schedule
// a field change (giving G-Force the abielily to precompute it). The first
// argument is the field name, the second is the union name, the third
// is how many seconds to wait until the change should occur, and the fourth
// is how many seconds the transition or "morph" should occur over.
SetNextFlowField( "Scattered Flow Out", "", 15, 4 );
0:12
StartParticle( "Sparkling Table Water" );
0:16
SetWaveShape( "Big and Banded", 4 );
// From time 0:01, "Scattered Flow Out" will start now (and morph for 4 secs)
0:25
SetSlideShow( CONFIG_WAVESHAPE | CONFIG_COLORMAP | CONFIG_FLOWFIELD, true );
Thanks, I had never read the example scripts. Any idea why the union is represented by "" [double quotes]? Is the lack of the name there meant to trigger a random union? Can one choose a union and put it's name there?
Also, if the 4 sands for the waveshape's duration, what does the 15 stand for? The flowfield's duration? And since there is a number field in the colormap configs, I assume that the duration of the color map is also controllable. What isn't clar is how these timings differ from the normal script times. Is it to give G-Force a head start on its computations so they don't happen all at once and produce a jerky effect?
Also, if the 4 sands for the waveshape's duration, what does the 15 stand for? The flowfield's duration? And since there is a number field in the colormap configs, I assume that the duration of the color map is also controllable. What isn't clar is how these timings differ from the normal script times. Is it to give G-Force a head start on its computations so they don't happen all at once and produce a jerky effect?
The empty quotes mean no union. Put one in if you like. Here is some documentation from a file in the scripts folder, Script Command Reference.txt
// Initiates a WaveShape change with the given transition duration.
// Note: config names should not include the file extension
// Returns false if the named WaveShape was not found.
bool SetWaveShape( string inWaveShapeName, float inNumMorphSecs );
// Initiates a ColorMap change with the given transition duration.
// Note: config names should not include the file extension
// Returns false if the named ColorMap was not found.
bool SetColorMap( string inColorMapName, float inNumMorphSecs );
// Switches to the named FlowField immediately.
bool SetFlowField( string inFieldName );
// Switches to the given field (with optional union) after a given delay. Once the switch starts,
// a FlowField transition/morph will occur over the given number of seconds.
// If after inSecsUntilSwitch seconds, the given field (and union) may not be full computed. If
// this occurs and inSwitchOnTime is false, G-Force will not initiate the FlowField transition
// until the new FlowField is computed. Otherwise, G-Force will stop and complete the computation
// before moving on (so that the switch can be initiated at the time index you expect).
bool SetNextFlowField( string inFieldName, string inUnionName, float inSecsUntilSwitch, bool inSwitchOnTime, float inNumMorphSecs );
// Initiates a WaveShape change with the given transition duration.
// Note: config names should not include the file extension
// Returns false if the named WaveShape was not found.
bool SetWaveShape( string inWaveShapeName, float inNumMorphSecs );
// Initiates a ColorMap change with the given transition duration.
// Note: config names should not include the file extension
// Returns false if the named ColorMap was not found.
bool SetColorMap( string inColorMapName, float inNumMorphSecs );
// Switches to the named FlowField immediately.
bool SetFlowField( string inFieldName );
// Switches to the given field (with optional union) after a given delay. Once the switch starts,
// a FlowField transition/morph will occur over the given number of seconds.
// If after inSecsUntilSwitch seconds, the given field (and union) may not be full computed. If
// this occurs and inSwitchOnTime is false, G-Force will not initiate the FlowField transition
// until the new FlowField is computed. Otherwise, G-Force will stop and complete the computation
// before moving on (so that the switch can be initiated at the time index you expect).
bool SetNextFlowField( string inFieldName, string inUnionName, float inSecsUntilSwitch, bool inSwitchOnTime, float inNumMorphSecs );