Game Development Community

Script River control

by DINF CLL · in Torque 3D Public Discussion · 11/19/2009 (8:48 pm) · 2 replies

Two simple question, how can I modify the river behavior (overallWaveMagnitude for exemple)within my srcipt.

1- For de moment I have to delete the river that I create in the World Editor and create a new one with the new overallWaveMagnitude that I want.

function LakeCreation(%NewWavHigh)
{
LacGilles.delete();
new River(LacGilles) {
SegmentLength = "10";
SubdivideLength = "2.5";
FlowMagnitude = "1";
LowLODDistance = "50";
density = "1";
viscosity = "1";
liquidType = "Water";
BaseColor = "45 108 171 255";
fresnelBias = "0.3";
fresnelPower = "6";
waveDir[0] = "0 1";
waveDir[1] = "0.707 0.707";
waveDir[2] = "0.5 0.86";
waveSpeed[0] = "1";
waveSpeed[1] = "1";
waveSpeed[2] = "1";
waveMagnitude[0] = "0.2";
waveMagnitude[1] = "0.2";
waveMagnitude[2] = "0.2";
overallWaveMagnitude = %NewWavHigh;//"1";
rippleTex = "core/art/water/noise02";
rippleDir[0] = "0 1";
rippleDir[1] = "0.707 0.707";
rippleDir[2] = "0.5 0.86";
rippleSpeed[0] = "-0.065";
rippleSpeed[1] = "0.09";
rippleSpeed[2] = "0.04";
rippleTexScale[0] = "7.14 7.14";
rippleTexScale[1] = "6.25 12.5";
rippleTexScale[2] = "50 50";
rippleMagnitude[0] = "1";
rippleMagnitude[1] = "1";
rippleMagnitude[2] = "0.3";
overallRippleMagnitude = "1";
cubemap = "DefaultSkyCubemap";
fullReflect = "1";
reflectPriority = "1";
reflectMaxRateMs = "15";
reflectDetailAdjust = "1";
reflectNormalUp = "0";
useOcclusionQuery = "1";
reflectTexSize = "256";
waterFogDensity = "0.1";
waterFogDensityOffset = "1";
wetDepth = "1.5";
wetDarkening = "0.2";
foamTex = "core/art/water/foam";
foamScale = "1";
foamMaxDepth = "2";
foamColorModulate = "0.5 0.5 0.5";
distortStartDist = "0.1";
distortEndDist = "20";
distortFullDepth = "3.5";
clarity = "0.5";
underwaterColor = "41 141 99 63";
position = "14.1227 46.6617 242.362";
rotation = "1 0 0 0";
scale = "1 1 1";
canSaveDynamicFields = "1";

Node = "14.122680 46.661713 242.361557 26.783728 5.000000 0.000000 0.000000 1.000000";
Node = "-19.669544 25.388739 240.283936 23.681145 5.000000 0.000000 0.000000 1.000000";
};
}


2- In the same way, is it possible to modify individual node of that river ????

#1
11/20/2009 (5:21 am)
@DINF

The river object has C++ methods that are used to manipluate it. You could expose some of these to script so that you can change the nodes from there.
#2
11/26/2009 (12:10 am)
OK thank's