public void Initialize_AdvanceLight_LightViz4() { Torque_Class_Helper tch = new Torque_Class_Helper("ShaderData", "AL_ShadowVisualizeShader"); tch.PropsAddString("DXVertexShaderFile", "shaders/common/guiMaterialV.hlsl"); tch.PropsAddString("DXPixelShaderFile", "shaders/common/lighting/advanced/dbgShadowVisualizeP.hlsl"); tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/guiMaterialV.glsl"); tch.PropsAddString("OGLPixelShaderFile", "shaders/common/lighting/advanced/gl/dbgShadowVisualizeP.glsl"); tch.Props.Add("pixVersion", "2.0"); tch.Create(); tch = new Torque_Class_Helper("CustomMaterial", "AL_ShadowVisualizeMaterial"); tch.Props.Add("shader", "AL_ShadowVisualizeShader"); tch.Props.Add("stateBlock", "AL_DepthVisualizeState"); tch.PropsAddString(@"sampler[""shadowMap""]", "#AL_ShadowVizTexture"); tch.PropsAddString(@"sampler[""depthViz""]", "depthviz"); tch.Props.Add("pixVersion", "2.0"); tch.Create(); TorqueSingleton ts = new TorqueSingleton("GuiControlProfile", "AL_ShadowLabelTextProfile"); ts.PropsAddString("fontColor", "0 0 0"); ts.Props.Add("autoSizeWidth", "true"); ts.Props.Add("autoSizeHeight", "true"); ts.PropsAddString("justify", "left"); ts.Props.Add("fontSize", "14"); ts.Create(); }
public string StaticShapeDataCreate(string data) { Torque_Class_Helper tch = new Torque_Class_Helper("StaticShape"); tch.Props.Add("dataBlock", data); string obj = tch.Create(m_ts).AsString(); return obj; }
public void initialize_scattersky() { Torque_Class_Helper tch = new Torque_Class_Helper("GFXStateBlockData", "ScatterSkySBData"); tch.Props.Add("cullDefined", "true"); tch.PropsAddString("cullMode", "GFXCullNone"); tch.Props.Add("zDefined", "true"); tch.Props.Add("zEnable", "true"); tch.Props.Add("zWriteEnable", "false"); tch.Props.Add("zFunc", "GFXCmpLessEqual"); tch.Props.Add("samplersDefined", "true"); tch.Props.Add("samplerStates[0]", "SamplerClampLinear"); tch.Props.Add("samplerStates[1]", "SamplerClampLinear"); tch.Props.Add("vertexColorEnable", "true"); tch.Create(); TorqueSingleton ts = new TorqueSingleton("ShaderData", "ScatterSkyShaderData"); ts.PropsAddString("DXVertexShaderFile", "shaders/common/scatterSkyV.hlsl"); ts.PropsAddString("DXPixelShaderFile", "shaders/common/scatterSkyP.hlsl"); ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/scatterSkyV.glsl"); ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/scatterSkyP.glsl"); ts.Props.Add("pixVersion", "2.0"); ts.Create(); }
public string StaticShapeDataCreate(coSimDataBlock data) { Torque_Class_Helper tch = new Torque_Class_Helper("StaticShape"); tch.Props.Add("dataBlock", data); coSimObject obj = tch.Create(); return obj; }
public void DoManualDetonation(coSceneObject obj) { Torque_Class_Helper tch = new Torque_Class_Helper("Item", ""); tch.Props.Add("dataBlock", "Detonade"); coSceneObject nade = tch.Create(); ((coSimSet)"MissionCleanUp").pushToBack(nade); nade.setTransform(obj.getTransform()); nade["sourceObject"] = obj["SourceObject"]; nade.schedule("50", "setDamageState", "Destroyed"); obj.delete(); }
public void HelpFileListonSelect(string thisobj, string row) { string fo = new Torque_Class_Helper("FileObject").Create(m_ts).AsString(); FileObject.openForRead(fo, console.GetVarString(thisobj + ".fileName[" + row + "]")); string text = ""; while (!FileObject.isEOF(fo)) text += FileObject.readLine(fo) + "\n"; FileObject.close(fo); console.Call("HelpText", "setText", new[] {text}); }
public void initializeShadowMaps() { Torque_Class_Helper tch = new Torque_Class_Helper("ShaderData", "BlurDepthShader"); tch.PropsAddString("DXVertexShaderFile", "shaders/common/lighting/shadowMap/boxFilterV.hlsl"); tch.PropsAddString("DXPixelShaderFile", "shaders/common/lighting/shadowMap/boxFilterP.hlsl"); tch.PropsAddString("OGLVertexShaderFile", "shaders/common/lighting/shadowMap/gl/boxFilterV.glsl"); tch.PropsAddString("OGLPixelShaderFile", "shaders/common/lighting/shadowMap/gl/boxFilterP.glsl"); tch.Props.Add("pixVersion", "2.0"); tch.Create(); }
public void DoManualDetonation(string obj) { Torque_Class_Helper tch = new Torque_Class_Helper("Item", ""); tch.Props.Add("dataBlock", "Detonade"); string nade = tch.Create(m_ts).ToString(CultureInfo.InvariantCulture); SimSet.pushToBack("MissionCleanUp", nade); SceneObject.setTransform(nade, SceneObject.getTransform(obj)); console.SetVar("sourceObject", console.GetVarString(string.Format("{0}.sourceObject", obj))); SimObject.schedule(nade, "50", "setDamageState", "Destroyed"); console.deleteVariables(obj); }
public string ProximityMineDataOnThrow(string datablock, string player, string amount) { ShapeBaseShapeBaseDecInventory(player, datablock, "1"); Torque_Class_Helper tch = new Torque_Class_Helper("ProximityMine", ""); tch.Props.Add("datablock", datablock); tch.Props.Add("sourceObject", player); tch.Props.Add("rotation", string.Format("\"0 0 1 {0} \"", new Random().NextDouble()*360)); tch.Props.Add("static", "false"); tch.Props.Add("client", console.GetVarString(string.Format("{0}.client", player))); uint obj = tch.Create(m_ts); SimSet.pushToBack("MissionCleanup", obj.AsString()); return obj.AsString(); }
public void commonMaterialData_Init() { iGlobal["$scroll"] = 1; iGlobal["$rotate"] = 2; iGlobal["$wave"] = 4; iGlobal["$scale"] = 8; iGlobal["$sequence"] = 16; // Common stateblock definitions Torque_Class_Helper tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerClampLinear"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXAddressClamp"); tch.Props.Add("addressModeV", "GFXAddressClamp"); tch.Props.Add("addressModeW", "GFXAddressClamp"); tch.Props.Add("magFilter", "GFXTextureFilterLinear"); tch.Props.Add("minFilter", "GFXTextureFilterLinear"); tch.Props.Add("mipFilter", "GFXTextureFilterLinear"); tch.Create(); tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerClampPoint"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXAddressClamp"); tch.Props.Add("addressModeV", "GFXAddressClamp"); tch.Props.Add("addressModeW", "GFXAddressClamp"); tch.Props.Add("magFilter", "GFXTextureFilterPoint"); tch.Props.Add("minFilter", "GFXTextureFilterPoint"); tch.Props.Add("mipFilter", "GFXTextureFilterPoint"); tch.Create(); tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerWrapLinear"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXTextureAddressWrap"); tch.Props.Add("addressModeV", "GFXTextureAddressWrap"); tch.Props.Add("addressModeW", "GFXTextureAddressWrap"); tch.Props.Add("magFilter", "GFXTextureFilterLinear"); tch.Props.Add("minFilter", "GFXTextureFilterLinear"); tch.Props.Add("mipFilter", "GFXTextureFilterLinear"); tch.Create(); tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerWrapPoint"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXTextureAddressWrap"); tch.Props.Add("addressModeV", "GFXTextureAddressWrap"); tch.Props.Add("addressModeW", "GFXTextureAddressWrap"); tch.Props.Add("magFilter", "GFXTextureFilterPoint"); tch.Props.Add("minFilter", "GFXTextureFilterPoint"); tch.Props.Add("mipFilter", "GFXTextureFilterPoint"); tch.Create(); }
public void Initialize_AdvanceLight_LightViz() { Torque_Class_Helper tch = new Torque_Class_Helper("GFXStateBlockData", "AL_DepthVisualizeState"); tch.Props.Add("zDefined", "true"); tch.Props.Add("zEnable", "false"); tch.Props.Add("zWriteEnable", "false"); tch.Props.Add("samplersDefined", "true"); tch.Props.Add("samplerStates[0]", "SamplerClampPoint"); // depth tch.Props.Add("samplerStates[1]", "SamplerClampLinear"); // viz color lookup tch.Create(m_ts); tch = new Torque_Class_Helper("GFXStateBlockData", "AL_DefaultVisualizeState"); tch.Props.Add("blendDefined", "true"); tch.Props.Add("blendEnable", "true"); tch.Props.Add("blendSrc", "GFXBlendSrcAlpha"); tch.Props.Add("blendDest", "GFXBlendInvSrcAlpha"); tch.Props.Add("zDefined", "true"); tch.Props.Add("zEnable", "false"); tch.Props.Add("zWriteEnable", "false"); tch.Props.Add("samplersDefined", "true"); tch.Props.Add("samplerStates[0]", "SamplerClampPoint"); // #prepass tch.Props.Add("samplerStates[1]", "SamplerClampLinear"); // depthviz tch.Create(m_ts); tch = new Torque_Class_Helper("ShaderData", "AL_DepthVisualizeShader"); tch.PropsAddString("DXVertexShaderFile ", "shaders/common/postFx/postFxV.hlsl"); tch.PropsAddString("DXPixelShaderFile", "shaders/common/lighting/advanced/dbgDepthVisualizeP.hlsl"); tch.PropsAddString("OGLVertexShaderFile", "shaders/common/postFx/postFxV.glsl"); tch.PropsAddString("OGLPixelShaderFile", "shaders/common/lighting/advanced/gl/dbgDepthVisualizeP.glsl"); tch.PropsAddString("samplerNames[0]", "prepassBuffer"); tch.PropsAddString("samplerNames[1]", "depthViz"); tch.Props.Add("pixVersion", "2.0"); tch.Create(m_ts); TorqueSingleton ts = new TorqueSingleton("PostEffect", "AL_DepthVisualize"); ts.Props.Add("shader", "AL_DepthVisualizeShader"); ts.Props.Add("stateBlock", "AL_DefaultVisualizeState"); ts.PropsAddString("texture[0]", "#prepass"); ts.PropsAddString("texture[1]", "depthviz"); ts.PropsAddString("target", "$backBuffer"); ts.Props.Add("renderPriority", "9999"); ts.Create(m_ts); }
public void commonMaterialData_Init() { console.SetVar("$scroll", 1); console.SetVar("$rotate", 2); console.SetVar("$wave", 4); console.SetVar("$scale", 8); console.SetVar("$sequence", 16); // Common stateblock definitions Torque_Class_Helper tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerClampLinear"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXAddressClamp"); tch.Props.Add("addressModeV", "GFXAddressClamp"); tch.Props.Add("addressModeW", "GFXAddressClamp"); tch.Props.Add("magFilter", "GFXTextureFilterLinear"); tch.Props.Add("minFilter", "GFXTextureFilterLinear"); tch.Props.Add("mipFilter", "GFXTextureFilterLinear"); tch.Create(m_ts); tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerClampPoint"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXAddressClamp"); tch.Props.Add("addressModeV", "GFXAddressClamp"); tch.Props.Add("addressModeW", "GFXAddressClamp"); tch.Props.Add("magFilter", "GFXTextureFilterPoint"); tch.Props.Add("minFilter", "GFXTextureFilterPoint"); tch.Props.Add("mipFilter", "GFXTextureFilterPoint"); tch.Create(m_ts); tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerWrapLinear"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXTextureAddressWrap"); tch.Props.Add("addressModeV", "GFXTextureAddressWrap"); tch.Props.Add("addressModeW", "GFXTextureAddressWrap"); tch.Props.Add("magFilter", "GFXTextureFilterLinear"); tch.Props.Add("minFilter", "GFXTextureFilterLinear"); tch.Props.Add("mipFilter", "GFXTextureFilterLinear"); tch.Create(m_ts); tch = new Torque_Class_Helper("GFXSamplerStateData", "SamplerWrapPoint"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXTextureAddressWrap"); tch.Props.Add("addressModeV", "GFXTextureAddressWrap"); tch.Props.Add("addressModeW", "GFXTextureAddressWrap"); tch.Props.Add("magFilter", "GFXTextureFilterPoint"); tch.Props.Add("minFilter", "GFXTextureFilterPoint"); tch.Props.Add("mipFilter", "GFXTextureFilterPoint"); tch.Create(m_ts); }
public string ProximityMineDataOnThrow(coItemData datablock, coPlayer player, int amount) { ShapeBaseShapeBaseDecInventory(player, datablock, 1); Torque_Class_Helper tch = new Torque_Class_Helper("ProximityMine", ""); tch.Props.Add("datablock", datablock); tch.Props.Add("sourceObject", player); tch.Props.Add("rotation", string.Format("\"0 0 1 {0} \"", new Random().NextDouble()*360)); tch.Props.Add("static", "false"); tch.Props.Add("client", player["client"]); coProximityMine pm = (tch.Create()); ((coSimSet) "MissionCleanup").pushToBack(pm); return pm; }
public void Initialize_ArtGuiCursors() { if (console.GetVarString("$platform") == "macos") { Torque_Class_Helper tch = new Torque_Class_Helper("GuiCursor", "DefaultCursor"); tch.PropsAddString("hotSpot", "4 4"); tch.PropsAddString("renderOffset", " 0 0"); tch.PropsAddString("bitmapName", "./core/art/gui/images/macCursor"); tch.CreateDB(); } else { Torque_Class_Helper tch = new Torque_Class_Helper("GuiCursor", "DefaultCursor"); tch.PropsAddString("hotSpot", "1 1"); tch.PropsAddString("renderOffset", " 0 0"); tch.PropsAddString("bitmapName", "./core/art/gui/images/defaultCursor"); tch.CreateDB(); } }
public void WeaponImageonWetFire(string thisobj, string obj, string slot) { if (!console.isObject(thisobj + ".projectile")) { console.error("WeaponImage::onFire() - Invalid projectile datablock"); return; } // Decrement inventory ammo. The image's ammo state is updated // automatically by the ammo inventory hooks. if (!console.GetVarBool(string.Format("{0}.infiniteAmmo", thisobj))) ShapeBaseShapeBaseDecInventory(obj, console.GetVarString(string.Format("{0}.ammo", thisobj)), "1"); // Get the player's velocity, we'll then add it to that of the projectile int numProjectiles = console.GetVarInt(string.Format("{0}.projectileNum", thisobj)); if (numProjectiles == 0) numProjectiles = 1; TransformF muzzleVector = new TransformF(); for (int i = 0; i < numProjectiles; i++) { if (console.GetVarBool(string.Format("{0}.wetProjectileSpread", thisobj))) { // We'll need to "skew" this projectile a little bit. We start by // getting the straight ahead aiming point of the gun Point3F vec = ShapeBase.getMuzzleVector(obj, slot.AsInt()); // Then we'll create a spread matrix by randomly generating x, y, and z // points in a circle Random r = new Random(); TransformF matrix = new TransformF(); matrix.MPosition.x = (float) ((r.NextDouble() - .5)*2*Math.PI*console.GetVarFloat(string.Format("{0}.wetProjectileSpread ", thisobj))); matrix.MPosition.y = (float) ((r.NextDouble() - .5)*2*Math.PI*console.GetVarFloat(string.Format("{0}.wetProjectileSpread ", thisobj))); matrix.MPosition.z = (float) ((r.NextDouble() - .5)*2*Math.PI*console.GetVarFloat(string.Format("{0}.wetProjectileSpread ", thisobj))); TransformF mat = math.MatrixCreateFromEuler(matrix); muzzleVector = math.MatrixMulVector(mat, vec); } else { muzzleVector = new TransformF(ShapeBase.getMuzzleVector(obj, slot.AsInt())); } Point3F objectVelocity = ShapeBase.getVelocity(obj); muzzleVector = muzzleVector.vectorScale(console.GetVarFloat(string.Format("{0}.wetProjectile.muzzleVelocity", thisobj))); objectVelocity = objectVelocity.vectorScale(console.GetVarFloat(string.Format("{0}.wetProjectile.velInheritFactor", thisobj))); Point3F muzzleVelocity = muzzleVector.MPosition + objectVelocity; Torque_Class_Helper tch = new Torque_Class_Helper(console.GetVarString(string.Format("{0}.projectileType", thisobj)), ""); tch.Props.Add("dataBlock", console.GetVarString(string.Format("{0}.wetProjectile", thisobj))); tch.Props.Add("initialVelocity", '"' + muzzleVelocity.ToString() + '"'); tch.Props.Add("initialPosition", '"' + ShapeBase.getMuzzlePoint(obj, slot.AsInt()).ToString() + '"'); tch.Props.Add("sourceObject", obj); tch.Props.Add("sourceSlot", slot); tch.Props.Add("client", console.GetVarString(string.Format("{0}.client", obj))); tch.Props.Add("sourceClass", console.GetClassName(obj)); string project = tch.Create(m_ts).ToString(CultureInfo.InvariantCulture); SimSet.pushToBack("MissionCleanup", project); } }
public void Initialize_Art_Gui_Profiles() { for (int i = 0; i < 2; i++) { if (console.GetVarString("$Gui::fontCacheDirectory") == "") console.SetVar("$Gui::fontCacheDirectory", console.Call("expandFileName", new[] {"core/fonts"})); //--------------------------------------------------------------------------------------------- // GuiDefaultProfile is a special profile that all other profiles inherit defaults from. It // must exist. //--------------------------------------------------------------------------------------------- if (!console.isObject("GuiDefaultProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiDefaultProfile"); tch.Props.Add("tab", "false"); tch.Props.Add("canKeyFocus", "false"); tch.Props.Add("hasBitmapArray", "false"); tch.Props.Add("mouseOverSelected", "false"); //fill colore tch.Props.Add("opaque", "false"); tch.PropsAddString("fillColor", "242 241 240"); tch.PropsAddString("fillColorHL", "228 228 235"); tch.PropsAddString("fillColorSEL", "98 100 137"); tch.PropsAddString("fillColorNA", "255 255 255 "); // border color tch.PropsAddString("border", "0"); tch.PropsAddString("borderColor", "100 100 100"); tch.PropsAddString("borderColorHL", "50 50 50 50"); tch.PropsAddString("borderColorNA", "75 75 75"); // font tch.PropsAddString("fontType", "Arial"); tch.PropsAddString("fontSize", "14"); tch.PropsAddString("fontCharset", "ANSI"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "0 0 0"); tch.PropsAddString("fontColorSEL", "255 255 255"); // bitmap information tch.PropsAddString("bitmap", ""); tch.PropsAddString("bitmapBase", ""); tch.PropsAddString("textOffset", "0 0"); // used by guiTextControl tch.Props.Add("modal", "true"); tch.Props.Add("justify", "left"); tch.Props.Add("autoSizeWidth", "false"); tch.Props.Add("autoSizeHeight", "false"); tch.Props.Add("returnTab", "false"); tch.Props.Add("numbersOnly", "false"); tch.PropsAddString("cursorColor", "0 0 0 255"); tch.CreateDB(); } if (!console.isObject("GuiSolidDefaultProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiSolidDefaultProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "true"); tch.Props.Add("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTransparentProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTransparentProfile"); tch.Props.Add("opaque", "false"); tch.Props.Add("border", "false"); tch.Props.Add("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTransparentwbProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTransparentwbProfile"); tch.Props.Add("opaque", "false"); tch.Props.Add("border", "true"); tch.Props.Add("borderColor", @"""100 100 100"""); tch.Props.Add("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiGroupBorderProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiGroupBorderProfile"); tch.Props.Add("border", "false"); tch.Props.Add("opaque", "false"); tch.Props.Add("hasBitmapArray", "true"); tch.Props.Add("bitmap", @"""./core/art/gui/images/group-border"""); tch.Props.Add("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTabBorderProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTabBorderProfile"); tch.Props.Add("border", "false"); tch.Props.Add("opaque", "false"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/tab-border"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiGroupTitleProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiGroupTitleProfile"); tch.PropsAddString("fillColor", "242 241 240"); tch.PropsAddString("fillColorHL", "242 241 240"); tch.PropsAddString("fillColorNA", "242 241 240"); tch.PropsAddString("fontColor", "0 0 0"); tch.Props.Add("opaque", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiToolTipProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiToolTipProfile"); tch.PropsAddString("fillColor", "239 237 222"); tch.PropsAddString("borderColor", "138 134 122"); tch.PropsAddString("fontType", "Arial"); tch.PropsAddString("fontSize", "14"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiModelessDialogProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiModelessDialogProfile"); tch.Props.Add("modal", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiFrameSetProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiFrameSetProfile"); tch.PropsAddString("fillcolor", "255 255 255"); tch.PropsAddString("borderColor", "246 245 244"); tch.Props.Add("border", "1"); tch.Props.Add("opaque", "true"); tch.Props.Add("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiWindowProfile")) { if (console.GetVarString("$platform") == "macos") { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiWindowProfile"); tch.Props.Add("opaque", "false"); tch.Props.Add("border", "2"); tch.PropsAddString("fillColor", "242 241 240"); tch.PropsAddString("fillColorHL", "221 221 221"); tch.PropsAddString("fillColorNA", "200 200 200"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("bevelColorHL", "255 255 255"); tch.PropsAddString("bevelColorLL", "0 0 0"); tch.PropsAddString("text", "untitled"); tch.PropsAddString("bitmap", "./core/art/gui/images/window"); tch.PropsAddString("textOffset", "8 4"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("justify", "center"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } else { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiWindowProfile"); tch.Props.Add("opaque", "false"); tch.Props.Add("border", "2"); tch.PropsAddString("fillColor", "242 241 240"); tch.PropsAddString("fillColorHL", "221 221 221"); tch.PropsAddString("fillColorNA", "200 200 200"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("bevelColorHL", "255 255 255"); tch.PropsAddString("bevelColorLL", "0 0 0"); tch.PropsAddString("text", "untitled"); tch.PropsAddString("bitmap", "./core/art/gui/images/window"); tch.PropsAddString("textOffset", "8 4"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("justify", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } } if (!console.isObject("GuiToolbarWindowProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiToolbarWindowProfile : GuiWindowProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/toolbar-window"); tch.PropsAddString("text", ""); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiToolbarWindowProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiToolbarWindowProfile : GuiWindowProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/toolbar-window"); tch.PropsAddString("text", ""); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiHToolbarWindowProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiHToolbarWindowProfile : GuiWindowProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/htoolbar-window"); tch.PropsAddString("text", ""); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiMenubarWindowProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiMenubarWindowProfile : GuiWindowProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/menubar-window"); tch.PropsAddString("text", ""); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiWindowCollapseProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiWindowCollapseProfile : GuiWindowProfile"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiContentProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiContentProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "255 255 255"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiBlackContentProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiBlackContentProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "0 0 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiInputCtrlProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiInputCtrlProfile"); tch.Props.Add("tab", "True"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextProfile"); tch.PropsAddString("justify", "left"); tch.PropsAddString("fontColor", "20 20 20"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextBoldProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextBoldProfile : GuiTextProfile"); tch.PropsAddString("fontType", "Arial Bold"); tch.Props.Add("fontSize", "16"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextBoldCenterProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextBoldCenterProfile : GuiTextProfile"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontType", "Arial Bold"); tch.Props.Add("fontSize", "16"); tch.PropsAddString("justify", "center"); tch.PropsAddString("category", "core"); tch.CreateDB(); } if (!console.isObject("GuiTextRightProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextRightProfile : GuiTextProfile"); tch.PropsAddString("justify", "right"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextCenterProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextCenterProfile : GuiTextProfile"); tch.PropsAddString("justify", "center"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextSolidProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextSolidProfile : GuiTextProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "5"); tch.PropsAddString("borderColor", "GuiDefaultProfile.fillColor"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("InspectorTitleTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "InspectorTitleTextProfile"); tch.PropsAddString("fontColor", "100 100 100"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextProfileLight")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextProfileLight"); tch.PropsAddString("fontColor", "220 220 220"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiAutoSizeTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiAutoSizeTextProfile"); tch.PropsAddString("fontColor", "0 0 0"); tch.Props.Add("autoSizeWidth", "true"); tch.Props.Add("autoSizeHeight", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextRightProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextRightProfile : GuiTextProfile"); tch.PropsAddString("justify", "right"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiMediumTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiMediumTextProfile : GuiTextProfile"); tch.Props.Add("fontSize", "24"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiBigTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiBigTextProfile : GuiTextProfile"); tch.Props.Add("fontSize", "36"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiMLTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiMLTextProfile"); tch.PropsAddString("fontColorLink", "100 100 100"); tch.PropsAddString("fontColorLinkHL", "255 255 255"); tch.Props.Add("autoSizeWidth", "true"); tch.Props.Add("autoSizeHeight", "true"); tch.Props.Add("border", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextArrayProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextArrayProfile : GuiTextProfile"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", " 0 0 0"); tch.PropsAddString("fontColorSEL", "0 0 0"); tch.PropsAddString("fillColor", "200 200 200"); tch.PropsAddString("fillColorHL", "228 228 235"); tch.PropsAddString("fillColorSEL", "200 200 200"); tch.Props.Add("border", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextListProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextListProfile : GuiTextProfile"); tch.Props.Add("tab", "true"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextEditProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextEditProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/textEdit"); tch.Props.Add("hasBitmapArray", "true"); tch.Props.Add("border", "-2"); tch.PropsAddString("fillColor", "242 241 240 0"); tch.PropsAddString("fillColorHL", "255 255 255"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "255 255 255"); tch.PropsAddString("fontColorSEL", "98 100 137"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.PropsAddString("textOffset", "4 2"); tch.Props.Add("autoSizeWidth", "false"); tch.Props.Add("autoSizeHeight", "true"); tch.PropsAddString("justify", "left"); tch.Props.Add("tab", "true"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTreeViewRenameCtrlProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTreeViewRenameCtrlProfile : GuiTextEditProfile"); tch.Props.Add("returnTab", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextEditProfileNumbersOnly")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextEditProfileNumbersOnly : GuiTextEditProfile"); tch.Props.Add("numbersOnly", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextEditNumericProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextEditNumericProfile : GuiTextEditProfile"); tch.Props.Add("numbersOnly", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiNumericDropSliderTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiNumericDropSliderTextProfile : GuiTextEditProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/textEditSliderBox"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextEditDropSliderNumbersOnly")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextEditDropSliderNumbersOnly : GuiTextEditProfile"); tch.Props.Add("numbersOnly", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/textEditSliderBox"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiProgressProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiProgressProfile"); tch.Props.Add("opaque", "false"); tch.PropsAddString("fillColor", "0 162 255 200"); tch.Props.Add("border", "true"); tch.PropsAddString("borderColor", "50 50 50 200"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiProgressBitmapProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiProgressBitmapProfile"); tch.Props.Add("border", "false"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/loadingbar"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiRLProgressBitmapProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiRLProgressBitmapProfile"); tch.Props.Add("border", "false"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/rl-loadingbar"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiProgressTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiProgressTextProfile"); tch.Props.Add("fontSize", "14"); tch.PropsAddString("fontType", "Arial"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("justify", "center"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiButtonProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiButtonProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "true"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.Props.Add("fixedExtent", "false"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/button"); tch.Props.Add("hasBitmapArray", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiThumbHighlightButtonProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiThumbHighlightButtonProfile : GuiButtonProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/thumbHightlightButton"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("InspectorDynamicFieldButton")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "InspectorDynamicFieldButton : GuiButtonProfile"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiMenuButtonProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiMenuButtonProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "false"); tch.Props.Add("fontSize", "18"); tch.PropsAddString("fontType", "Arial Bold"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.Props.Add("fixedExtent", "false"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "false"); tch.PropsAddString("bitmap", "./core/art/gui/images/selector-button"); tch.Props.Add("hasBitmapArray", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiIconButtonProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiIconButtonProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "true"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.Props.Add("fixedExtent", "false"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "false"); tch.PropsAddString("bitmap", "./core/art/gui/images/iconbutton"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiIconButtonSolidProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiIconButtonSolidProfile : GuiIconButtonProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/iconbuttonsolid"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiIconButtonSmallProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiIconButtonSmallProfile : GuiIconButtonProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/iconbuttonsmall"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiButtonTabProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiButtonTabProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "true"); tch.PropsAddString("fontColor", "50 50 50"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "0 0 0"); tch.Props.Add("fixedExtent", "false"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "false"); tch.PropsAddString("bitmap", "./core/art/gui/images/buttontab"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("EditorTabPage")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "EditorTabPage"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "false"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.Props.Add("fixedExtent", "false"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "false"); tch.PropsAddString("bitmap", "./core/art/gui/images/tab"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiCheckBoxProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiCheckBoxProfile"); tch.Props.Add("opaque", "false"); tch.PropsAddString("fillColor", "232 232 232"); tch.Props.Add("border", "false"); tch.PropsAddString("borderColor", "100 100 100"); tch.Props.Add("fontSize", "14"); tch.PropsAddString("fontColor", "20 20 20"); tch.PropsAddString("fontColorHL", "80 80 80"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.Props.Add("fixedExtent", "true"); tch.PropsAddString("justify", "left"); tch.PropsAddString("bitmap", "./core/art/gui/images/checkbox"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiCheckBoxListProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiCheckBoxListProfile : GuiCheckBoxProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/checkbox-list"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiCheckBoxListFlipedProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiCheckBoxListFlipedProfile : GuiCheckBoxProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/checkbox-list_fliped"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("InspectorCheckBoxTitleProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "InspectorCheckBoxTitleProfile : GuiCheckBoxProfile"); tch.PropsAddString("fontColor", "100 100 100"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiRadioProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiRadioProfile"); tch.Props.Add("fontSize", "14"); tch.PropsAddString("fillColor", "232 232 232"); tch.PropsAddString("fontColor", "20 20 20"); tch.PropsAddString("fontColorHL", "80 80 80"); tch.Props.Add("fixedExtent", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/radioButton"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiScrollProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiScrollProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillcolor", "255 255 255"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "150 150 150"); tch.Props.Add("border", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/scrollBar"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiOverlayProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiOverlayProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillcolor", "255 255 255"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "255 255 255"); tch.PropsAddString("fillColor", "0 0 0 100"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTransparentScrollProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTransparentScrollProfile"); tch.Props.Add("opaque", "false"); tch.PropsAddString("fillColor", "255 255 255"); tch.PropsAddString("fontColor", "0 0 0"); tch.Props.Add("border", "false"); tch.Props.Add("borderThickness", "2"); tch.PropsAddString("borderColor", "100 100 100"); tch.PropsAddString("bitmap", "./core/art/gui/images/scrollBar"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiSliderProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiSliderProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/slider"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiSliderBoxProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiSliderBoxProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/slider-w-box"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPaneProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPaneProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/popupMenu"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPopupMenuItemBorder")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPopupMenuItemBorder : GuiButtonProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "true"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "255 255 255"); tch.Props.Add("fixedExtent", "false"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "false"); tch.PropsAddString("bitmap", "./core/art/gui/images/button"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPopUpMenuDefault")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPopUpMenuDefault : GuiDefaultProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("mouseOverSelected", "true"); tch.PropsAddString("textOffset", "3 3"); tch.Props.Add("border", "0"); tch.Props.Add("borderThickness", "0"); tch.Props.Add("fixedExtent", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/scrollbar"); tch.Props.Add("hasBitmapArray", "true"); tch.Props.Add("profileForChildren", "GuiPopupMenuItemBorder"); tch.PropsAddString("fillColor", "242 241 240 "); tch.PropsAddString("fillColorHL", "228 228 235"); tch.PropsAddString("fillColorSEL", "98 100 137"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorSEL", "255 255 255"); tch.PropsAddString("borderColor", "100 100 100"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPopupBackgroundProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPopupBackgroundProfile"); tch.Props.Add("modal", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPopUpMenuProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPopUpMenuProfile : GuiPopUpMenuDefault"); tch.PropsAddString("textOffset", "6 4"); tch.PropsAddString("bitmap", "./core/art/gui/images/dropDown"); tch.Props.Add("hasBitmapArray", "true"); tch.Props.Add("border", "1"); tch.Props.Add("profileForChildren", "GuiPopUpMenuDefault"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPopUpMenuTabProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPopUpMenuTabProfile : GuiPopUpMenuDefault"); tch.PropsAddString("bitmap", "./core/art/gui/images/dropDown-tab"); tch.PropsAddString("textOffset", "6 4"); tch.Props.Add("canKeyFocus", "true"); tch.Props.Add("hasBitmapArray", "true"); tch.Props.Add("border", "1"); tch.Props.Add("profileForChildren", "GuiPopUpMenuDefault"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiPopUpMenuEditProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiPopUpMenuEditProfile : GuiPopUpMenuDefault"); tch.PropsAddString("textOffset", "6 4"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/dropDown"); tch.Props.Add("hasBitmapArray", "true"); tch.Props.Add("border", "1"); tch.Props.Add("profileForChildren", "GuiPopUpMenuDefault"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiListBoxProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiListBoxProfile"); tch.Props.Add("tab", "true"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTabBookProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTabBookProfile"); tch.PropsAddString("fillColorHL", "100 100 100"); tch.PropsAddString("fillColorNA", "150 150 150"); tch.PropsAddString("fontColor", "30 30 30"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "50 50 50"); tch.PropsAddString("fontType", "Arial"); tch.Props.Add("fontSize", "14"); tch.PropsAddString("justify", "center"); tch.PropsAddString("bitmap", "./core/art/gui/images/tab"); tch.Props.Add("tabWidth", "64"); tch.Props.Add("tabHeight", "24"); tch.PropsAddString("tabPosition", "Top"); tch.PropsAddString("tabRotation", "Horizontal"); tch.PropsAddString("textOffset", "0 -3"); tch.Props.Add("tab", "true"); tch.Props.Add("cankeyfocus", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTabBookNoBitmapProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTabBookNoBitmapProfile : GuiTabBookProfile"); tch.PropsAddString("bitmap", ""); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTabPageProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTabPageProfile : GuiDefaultProfile"); tch.PropsAddString("fontType", "Arial"); tch.Props.Add("fontSize", "10"); tch.PropsAddString("justify", "center"); tch.PropsAddString("bitmap", "./core/art/gui/images/tab"); tch.Props.Add("opaque", "false"); tch.PropsAddString("fillColor", "240 239 238"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiMenuBarProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiMenuBarProfile"); tch.PropsAddString("fontType", "Arial"); tch.Props.Add("fontSize", "14"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "240 239 238"); tch.PropsAddString("fillColorHL", "202 201 200"); tch.PropsAddString("fillColorSEL", "202 0 0"); tch.PropsAddString("borderColorNA", "202 201 200"); tch.PropsAddString("borderColorHL", "50 50 50"); tch.Props.Add("border", "0"); tch.PropsAddString("fontColor", "20 20 20"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorNA", "255 255 255"); tch.PropsAddString("justify", "center"); tch.Props.Add("canKeyFocus", "false"); tch.Props.Add("mouseOverSelected", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/menu"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiConsoleProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiConsoleProfile"); tch.Props.Add("fontType", @"($platform $= ""macos"") ? ""Monaco"" : ""Lucida Console"""); tch.Props.Add("fontSize", @"($platform $= ""macos"") ? 13 : 12"); tch.PropsAddString("fontColor", "255 255 255"); tch.PropsAddString("fontColorHL", "0 255 255"); tch.PropsAddString("fontColorNA", "255 0 0"); tch.PropsAddString("fontColors[6]", "100 100 100"); tch.PropsAddString("fontColors[7]", "100 100 0"); tch.PropsAddString("fontColors[8]", "0 0 100"); tch.PropsAddString("fontColors[9]", "0 100 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiConsoleTextEditProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiConsoleTextEditProfile : GuiTextEditProfile"); tch.Props.Add("fontType", @"($platform $= ""macos"") ? ""Monaco"" : ""Lucida Console"""); tch.Props.Add("fontSize", @"($platform $= ""macos"") ? 13 : 12"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiConsoleTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiConsoleTextProfile"); tch.PropsAddString("fontColor", "0 0 0"); tch.Props.Add("autoSizeWidth", "true"); tch.Props.Add("autoSizeHeight", "true"); tch.PropsAddString("textOffset", "2 2"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "255 255 255"); tch.Props.Add("border", "true"); tch.Props.Add("borderThickness", "1"); tch.PropsAddString("borderColor", "0 0 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTreeViewProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTreeViewProfile"); tch.PropsAddString("bitmap", "./core/art/gui/images/treeView"); tch.Props.Add("autoSizeHeight", "true"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("fillColor", "255 255 255"); tch.PropsAddString("fillColorHL", "228 228 235"); tch.PropsAddString("fillColorSEL", "98 100 137"); tch.PropsAddString("fillColorNA", "255 255 255 "); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "0 0 0"); tch.PropsAddString("fontColorSEL", "255 255 255"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.PropsAddString("borderColor", "128 000 000"); tch.PropsAddString("borderColorHL", "255 228 235"); tch.Props.Add("fontSize", "14"); tch.Props.Add("opaque", "false"); tch.Props.Add("border", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiSimpleTreeProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiSimpleTreeProfile : GuiTreeViewProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "255 255 255 255"); tch.Props.Add("border", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiText24Profile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiText24Profile : GuiTextProfile"); tch.Props.Add("fontSize", "24"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiRSSFeedMLTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiRSSFeedMLTextProfile"); tch.PropsAddString("fontColorLink", "55 55 255"); tch.PropsAddString("fontColorLinkHL", "255 55 55"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } console.SetVar("$ConsoleDefaultFillColor", "0 0 0 175"); if (!console.isObject("ConsoleScrollProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "ConsoleScrollProfile : GuiScrollProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("fillColor", "$ConsoleDefaultFillColor"); tch.Props.Add("border", "1"); tch.PropsAddString("borderColor", "0 0 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("ConsoleTextEditProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "ConsoleTextEditProfile : GuiTextEditProfile"); tch.PropsAddString("fillColor", "242 241 240 255"); tch.PropsAddString("fillColorHL", "255 255 255"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTextPadProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTextPadProfile"); tch.Props.Add("fontType", @"($platform $= ""macos"") ? ""Monaco"" : ""Lucida Console"""); tch.Props.Add("fontSize", @"($platform $= ""macos"") ? 13 : 12"); tch.Props.Add("tab", "true"); tch.Props.Add("canKeyFocus", "true"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "255 255 255"); tch.Props.Add("Border", "0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiTransparentProfileModeless")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiTransparentProfileModeless : GuiTransparentProfile"); tch.Props.Add("modal", "false"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiFormProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiFormProfile : GuiTextProfile"); // tch.Props.Add("opaque", "false"); tch.Props.Add("border", "5"); //tch.PropsAddString("bitmap", "./core/art/gui/images/form"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("justify", "center"); tch.Props.Add("profileForChildren", "GuiButtonProfile"); tch.Props.Add("opaque", "false"); tch.PropsAddString("bitmap", "./core/art/gui/images/button"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiNumericTextEditSliderProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiNumericTextEditSliderProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "0 0 0 0"); tch.PropsAddString("fillColorHL", "255 255 255"); tch.Props.Add("border", "true"); tch.Props.Add("tab", "false"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("fontType", "Arial"); tch.Props.Add("fontSize", "14"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorSEL", "43 107 206"); tch.PropsAddString("fontColorHL", "244 244 244"); tch.PropsAddString("fontColorNA", "100 100 100"); tch.Props.Add("numbersOnly", "true"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiNumericTextEditSliderBitmapProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiNumericTextEditSliderBitmapProfile"); tch.Props.Add("opaque", "true"); tch.Props.Add("border", "true"); tch.PropsAddString("borderColor", "100 100 100"); tch.Props.Add("tab", "false"); tch.Props.Add("canKeyFocus", "true"); tch.PropsAddString("fontType", "Arial"); tch.Props.Add("fontSize", "14"); tch.PropsAddString("fillColor", "242 241 240"); tch.PropsAddString("fillColorHL", "255 255 255"); tch.PropsAddString("fontColor", "0 0 0"); tch.PropsAddString("fontColorHL", "255 255 255"); tch.PropsAddString("fontColorSEL", "98 100 137"); tch.PropsAddString("fontColorNA", "200 200 200"); tch.Props.Add("numbersOnly", "true"); tch.Props.Add("hasBitmapArray", "true"); tch.PropsAddString("bitmap", "./core/art/gui/images/numericslider"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiMultiFieldTextEditProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiMultiFieldTextEditProfile : GuiTextEditProfile"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("GuiModalDialogBackgroundProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "GuiModalDialogBackgroundProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "221 221 221 150"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("CenterPrintProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "CenterPrintProfile"); tch.Props.Add("opaque", "true"); tch.PropsAddString("fillColor", "128 128 128"); tch.PropsAddString("fontColor", "0 255 0"); tch.Props.Add("border", "true"); tch.PropsAddString("borderColor", "0 255 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } if (!console.isObject("CenterPrintTextProfile")) { Torque_Class_Helper tch = new Torque_Class_Helper("GuiControlProfile", "CenterPrintTextProfile"); tch.Props.Add("opaque", "false"); tch.PropsAddString("fontType", "Arial"); tch.Props.Add("fontSize", "12"); tch.PropsAddString("fontColor", "0 255 0"); tch.PropsAddString("category", "Core"); tch.CreateDB(); } } }
public void connect(string server) { iGlobal["$pref::Net::PacketRateToServer"] = 32; iGlobal["$pref::Net::PacketSize"] = 200; iGlobal["$platform::timeManagerProcessInterval"] = 1; coGameConnection conn = new Torque_Class_Helper("GameConnection", "ServerConnection").Create().AsString(); ((coSimSet)"rootgroup").pushToBack(conn); conn.setConnectArgs(sGlobal["$pref::Player::Name"]); conn.setJoinPassword(sGlobal["$Client::Password"]); conn.connect(server); }
public void CheetahCarOnAdd(string thisobj, string obj, string nameSpaceDepth) { int nsd = (nameSpaceDepth.AsInt() + 1); console.ParentExecute(thisobj, "onAdd", nsd, new[] {thisobj, obj}); WheeledVehicle.setWheelTire(obj, 0, "CheetahCarTire"); WheeledVehicle.setWheelTire(obj, 1, "CheetahCarTire"); WheeledVehicle.setWheelTire(obj, 2, "CheetahCarTireRear"); WheeledVehicle.setWheelTire(obj, 3, "CheetahCarTireRear"); // Setup the car with some tires & springs for (int i = WheeledVehicle.getWheelCount(obj) - 1; i >= 0; i--) { WheeledVehicle.setWheelPowered(obj, i, true); WheeledVehicle.setWheelSpring(obj, i, "CheetahCarSpring"); } // Steer with the front tires WheeledVehicle.setWheelSteering(obj, 0, 1); WheeledVehicle.setWheelSteering(obj, 1, 1); // Add tail lights Torque_Class_Helper tc = new Torque_Class_Helper("PointLight", ""); tc.Props.Add("radius", "1"); tc.Props.Add("isEnabled", "0"); tc.Props.Add("color", @"""1 0 0.141176 1"""); tc.Props.Add("brightness", "2"); tc.Props.Add("castShadows", "1"); tc.Props.Add("priority", "1"); tc.Props.Add("animate", "0"); tc.Props.Add("animationPeriod", "1"); tc.Props.Add("animationPhase", "1"); tc.Props.Add("flareScale", "1"); tc.Props.Add("attenuationRatio", @"""0 1 1"""); tc.Props.Add("shadowType", @"""DualParaboloidSinglePass"""); tc.Props.Add("texSize", "512"); tc.Props.Add("overDarkFactor", @"""2000 1000 500 100"""); tc.Props.Add("shadowDistance", "400"); tc.Props.Add("shadowSoftness", "0.15"); tc.Props.Add("numSplits", "1"); tc.Props.Add("logWeight", "0.91"); tc.Props.Add("fadeStartDistance", "0"); tc.Props.Add("lastSplitTerrainOnly", "0"); tc.Props.Add("representedInLightmap", "0"); tc.Props.Add("shadowDarkenColor", @"""0 0 0 -1"""); tc.Props.Add("includeLightmappedGeometryInShadow", "0"); tc.Props.Add("rotation", @"""1 0 0 0 """); tc.Props.Add("canSave", "1"); tc.Props.Add("canSaveDynamicFields", "1"); tc.Props.Add("splitFadeDistances", @"""10 20 30 40"""); string rightbrakelight = tc.Create(m_ts).ToString(CultureInfo.InvariantCulture); console.SetVar(string.Format("{0}.rightBrakeLight", obj), rightbrakelight); string leftbrakelight = tc.Create(m_ts).ToString(CultureInfo.InvariantCulture); console.SetVar(string.Format("{0}.leftBrakeLight", obj), leftbrakelight); console.SetVar(string.Format("{0}.inv[BulletAmmo]", obj), 1000); // Mount a ShapeBaseImageData //Current T3d Turrets are broken in dedicated mode. ShapeBase.mountImage(obj, "TurretImage", console.GetVarInt(thisobj + ".turretSlot"), true, ""); // Mount the brake lights SceneObject.mountObject(obj, rightbrakelight, console.GetVarInt(string.Format("{0}.rightBrakeSlot", thisobj)), new TransformF(true)); SceneObject.mountObject(obj, leftbrakelight, console.GetVarInt(string.Format("{0}.leftBrakeSlot", thisobj)), new TransformF(true)); }
public string ItemDataOnThrow(string datablock, string player, string amount) { if (amount == "") amount = "1"; if (console.GetVarString(datablock + ".maxInventory") != "") if (amount.AsInt() > console.GetVarInt(datablock + ".maxInventory")) amount = console.GetVarString(datablock + ".maxInventory"); if (!amount.AsBool()) return "0"; ShapeBaseShapeBaseDecInventory(player, datablock, amount); // Construct the actual object in the world, and add it to // the mission group so it's cleaned up when the mission is // done. The object is given a random z rotation. Torque_Class_Helper tch = new Torque_Class_Helper("Item", ""); tch.Props.Add("datablock", datablock); tch.Props.Add("rotation", @"""0 0 1 " + (new Random().Next(0, 360)) + @""""); tch.Props.Add("count", amount); string item = tch.Create(m_ts).AsString(); SimSet.pushToBack("MissionGroup", item); ItemschedulePop(item); return item; }
public void water_init() { TorqueSingleton ts = new TorqueSingleton("ShaderData", "WaterShader"); ts.PropsAddString("DXVertexShaderFile", "shaders/common/water/waterV.hlsl"); ts.PropsAddString("DXPixelShaderFile", "shaders/common/water/waterP.hlsl"); ts.PropsAddString("OGLVertexShaderFile", "shaders/common/water/gl/waterV.glsl"); ts.PropsAddString("OGLPixelShaderFile", "shaders/common/water/gl/waterP.glsl"); ts.Props.Add("pixVersion", "3.0"); ts.Create(); Torque_Class_Helper tch = new Torque_Class_Helper("GFXSamplerStateData", "WaterSampler"); tch.Props.Add("textureColorOp", "GFXTOPModulate"); tch.Props.Add("addressModeU", "GFXAddressWrap"); tch.Props.Add("addressModeV", "GFXAddressWrap"); tch.Props.Add("addressModeW", "GFXAddressWrap"); tch.Props.Add("magFilter", "GFXTextureFilterLinear"); tch.Props.Add("minFilter", "GFXTextureFilterAnisotropic"); tch.Props.Add("mipFilter", "GFXTextureFilterLinear"); tch.Props.Add("maxAnisotropy", "4"); tch.Create(); ts = new TorqueSingleton("GFXStateBlockData", "WaterStateBlock"); ts.Props.Add("samplersDefined", "true"); ts.Props.Add("samplerStates[0]", "WaterSampler"); // noise ts.Props.Add("samplerStates[1]", "SamplerClampPoint"); // #prepass ts.Props.Add("samplerStates[2]", "SamplerClampLinear"); // $reflectbuff ts.Props.Add("samplerStates[3]", "SamplerClampPoint"); // $backbuff ts.Props.Add("samplerStates[4]", "SamplerWrapLinear"); // $cubemap ts.Props.Add("samplerStates[5]", "SamplerWrapLinear"); // foam ts.Props.Add("samplerStates[6]", "SamplerClampLinear"); // depthMap ( color gradient ) ts.Props.Add("cullDefined", "true"); ts.PropsAddString("cullMode", "GFXCullCCW"); ts.Create(); ts = new TorqueSingleton("GFXStateBlockData", "UnderWaterStateBlock : WaterStateBlock"); ts.PropsAddString("cullMode", "GFXCullCW"); ts.Create(); ts = new TorqueSingleton("CustomMaterial", "WaterMat"); ts.PropsAddString(@"sampler[""prepassTex""]", "#prepass"); ts.PropsAddString(@"sampler[""reflectMap""]", "$reflectbuff"); ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff"); ts.Props.Add("shader", "WaterShader"); ts.Props.Add("stateBlock", "WaterStateBlock"); ts.Props.Add("version", "3.0"); ts.Props.Add("useAnisotropic[0]", "true"); ts.Create(); //----------------------------------------------------------------------------- // Underwater //----------------------------------------------------------------------------- ts = new TorqueSingleton("ShaderData", "UnderWaterShader"); ts.PropsAddString(@"DXVertexShaderFile", "shaders/common/water/waterV.hlsl"); ts.PropsAddString(@"DXPixelShaderFile", "shaders/common/water/waterP.hlsl"); ts.PropsAddString(@"OGLVertexShaderFile", "shaders/common/water/gl/waterV.glsl"); ts.PropsAddString(@"OGLPixelShaderFile", "shaders/common/water/gl/waterP.glsl"); ts.PropsAddString(@"defines", "UNDERWATER"); ts.Props.Add("pixVersion", "3.0"); ts.Create(); ts = new TorqueSingleton("CustomMaterial", "UnderwaterMat"); // These samplers are set in code not here. // This is to allow different WaterObject instances // to use this same material but override these textures // per instance. //sampler["bumpMap"] = "core/art/water/noise02"; //sampler["foamMap"] = "core/art/water/foam"; ts.PropsAddString(@"sampler[""prepassTex""]", "#prepass"); ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff"); ts.PropsAddString(@"shader", "UnderWaterShader"); ts.PropsAddString(@"stateBlock", "UnderWaterStateBlock"); ts.PropsAddString(@"specular", "0.75 0.75 0.75 1.0"); ts.Props.Add(@"specularPower", "48.0"); ts.Props.Add(@"version", "3.0"); ts.Create(); //----------------------------------------------------------------------------- // Basic Water //----------------------------------------------------------------------------- ts = new TorqueSingleton("ShaderData", "WaterBasicShader"); ts.PropsAddString("DXVertexShaderFile", "shaders/common/water/waterBasicV.hlsl"); ts.PropsAddString("DXPixelShaderFile", "shaders/common/water/waterBasicP.hlsl"); ts.PropsAddString("OGLVertexShaderFile", "shaders/common/water/gl/waterBasicV.glsl"); ts.PropsAddString("OGLPixelShaderFile", "shaders/common/water/gl/waterBasicP.glsl"); ts.Props.Add("pixVersion", "2.0"); ts.Create(); ts = new TorqueSingleton("GFXStateBlockData", "WaterBasicStateBlock"); ts.Props.Add("samplersDefined", "true"); ts.Props.Add("samplerStates[0]", "WaterSampler"); // noise ts.Props.Add("samplerStates[2]", "SamplerClampLinear"); // $reflectbuff ts.Props.Add("samplerStates[3]", "SamplerClampPoint"); // $backbuff ts.Props.Add("samplerStates[4]", "SamplerWrapLinear"); // $cubemap ts.Props.Add("cullDefined", "true"); ts.PropsAddString("cullMode", "GFXCullCCW"); ts.Create(); ts = new TorqueSingleton("GFXStateBlockData", "UnderWaterBasicStateBlock : WaterBasicStateBlock"); ts.PropsAddString("cullMode", "GFXCullCW"); ts.Create(); ts = new TorqueSingleton("CustomMaterial", "WaterBasicMat"); // These samplers are set in code not here. // This is to allow different WaterObject instances // to use this same material but override these textures // per instance. //sampler["bumpMap"] = "core/art/water/noise02"; //sampler["skyMap"] = "$cubemap"; //sampler["prepassTex"] = "#prepass"; ts.PropsAddString(@"sampler[""reflectMap""]", "$reflectbuff"); ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff"); ts.Props.Add("cubemap", "NewLevelSkyCubemap"); ts.Props.Add("shader", "WaterBasicShader"); ts.Props.Add("stateBlockZ", "WaterBasicStateBlock"); ts.Props.Add("version", "2.0"); ts.Create(); //----------------------------------------------------------------------------- // Basic UnderWater //----------------------------------------------------------------------------- ts = new TorqueSingleton("ShaderData", "UnderWaterBasicShader"); ts.PropsAddString(@"DXVertexShaderFile", "shaders/common/water/waterBasicV.hlsl"); ts.PropsAddString(@"DXPixelShaderFile", "shaders/common/water/waterBasicP.hlsl"); ts.PropsAddString(@"OGLVertexShaderFile", "shaders/common/water/gl/waterBasicV.glsl"); ts.PropsAddString(@"OGLPixelShaderFile", "shaders/common/water/gl/waterBasicP.glsl"); ts.PropsAddString(@"defines", "UNDERWATER"); ts.Props.Add("pixVersion", "2.0"); ts.Create(); ts = new TorqueSingleton("CustomMaterial", "UnderwaterBasicMat"); // These samplers are set in code not here. // This is to allow different WaterObject instances // to use this same material but override these textures // per instance. //sampler["bumpMap"] = "core/art/water/noise02"; //samplers["skyMap"] = "$cubemap"; //sampler["prepassTex"] = "#prepass"; ts.PropsAddString(@"sampler[""refractBuff""]", "$backbuff"); ts.Props.Add("shader", "UnderWaterBasicShader"); ts.Props.Add("stateBlock", "UnderWaterBasicStateBlock"); ts.Props.Add("version", "2.0"); ts.Create(); }
public void ResetMission() { console.print("*** MISSION RESET"); // Remove any temporary mission objects if (((coSimSet)"MissionCleanup").isObject()) ((coSimSet)"MissionCleanup").delete(); sGlobal["$instantGroup"] = sGlobal["ServerGroup"]; coSimSet MissionCleanup = new Torque_Class_Helper("SimGroup", "MissionCleanup").Create(); MissionCleanup["$instantGroup"] = MissionCleanup; console.clearServerPaths(); console.error("-------------> Client Group Count = " + ClientGroup.Count); }
public void LoadMissionStage2() { console.print("*** Stage 2 load CSHARP"); // Create the mission group off the ServerGroup sGlobal["$instantGroup"] = "ServerGroup"; // Make sure the mission exists string file = sGlobal["$Server::MissionFile"]; if (!Util.isFile(file)) Server__LoadFailMsg = "Could not find mission " + file; else { // Calculate the mission CRC. The CRC is used by the clients // to caching mission lighting. int missioncrc = Util.getFileCRC(file); iGlobal["$missionCRC"] = missioncrc; //Looked at making this one a dll direct call, doesn't appear //it can be easily converted. // Exec the mission. The MissionGroup (loaded components) is added to the ServerGroup Util.exec(console.GetVarString("$Server::MissionFile"), false, false); if (!"MissionGroup".isObject()) Server__LoadFailMsg = "No 'MissionGroup' found in mission " + file; } if (Server__LoadFailMsg != "") { // Inform clients that are already connected foreach (coGameConnection client in ClientGroup) MessageClient(client, "MsgLoadFailed", Server__LoadFailMsg); return; } // Set mission name. if (((coLevelInfo)"theLevelInfo").isObject()) sGlobal["$Server::MissionName"] = ((coLevelInfo)"theLevelInfo")["levelName"]; // Mission cleanup group. This is where run time components will reside. The MissionCleanup // group will be added to the ServerGroup. coSimSet missioncleanup = new Torque_Class_Helper("SimGroup", "MissionCleanup").Create(); // Make the MissionCleanup group the place where all new objects will automatically be added. sGlobal["$instantGroup"] = missioncleanup; console.pathOnMissionLoadDone(); // Mission loading done... console.warn("*** Mission loaded"); missionRunning = true; //Even though we track this in the CSharp, the tools use it as a flag. bGlobal["$missionRunning"] = true; // Start all the clients in the mission foreach (coGameConnection client in ClientGroup) GameConnectionLoadMission(client); onMissionLoaded(); }
public bool sfxAutodetect() { // Get all the available devices. string devices = Util.sfxGetAvailableDevices(); // Collect and sort the devices by preferentiality. int count = Util.getRecordCount(devices); coArrayObject deviceTrySequence = new Torque_Class_Helper("ArrayObject").Create().AsString(); for (int i = 0; i < count; i++) { string info = Util.getRecord(devices, i); string provider = Util.getField(info, 0); deviceTrySequence.push_back(provider, info); } deviceTrySequence.sortfk("sfxCompareProvider"); // Try the devices in order. count = deviceTrySequence.count(); for (int i = 0; i < count; i++) { string provider = deviceTrySequence.getKey(i); string info = deviceTrySequence.getValue(i); sGlobal["$pref::SFX::provider"] = provider; sGlobal["$pref::SFX::device"] = Util.getField(info, 1); sGlobal["$pref::SFX::useHardware"] = Util.getField(info, 2); // By default we've decided to avoid hardware devices as // they are buggy and prone to problems. bGlobal["$pref::SFX::useHardware"] = false; if (!sfxInit()) continue; bGlobal["$pref::SFX::autoDetect"] = false; deviceTrySequence.delete(); return true; } // Found no suitable device. console.error("sfxAutodetect - Could not initialize a valid SFX device."); sGlobal["$pref::SFX::provider"] = ""; sGlobal["$pref::SFX::device"] = ""; sGlobal["$pref::SFX::useHardware"] = ""; deviceTrySequence.delete(); return false; }
public string RocketLauncherImageOnAltFire(coItem thisobj, coPlayer obj, string slot) { int currentAmmo = ShapeBaseShapeBaseGetInventory(obj, (thisobj["ammo"])); if (currentAmmo < thisobj["loadCount"].AsInt()) thisobj["loadCount"] = currentAmmo.AsString(); coProjectile projectile = null; for (int shotCount = 0; shotCount < thisobj["loadCount"].AsInt(); shotCount++) { // Decrement inventory ammo. The image's ammo state is updated // automatically by the ammo inventory hooks. ShapeBaseShapeBaseDecInventory(obj, (thisobj["ammo"]), 1); // We fire our weapon using the straight ahead aiming point of the gun // We'll need to "skew" the projectile a little bit. We start by getting // the straight ahead aiming point of the gun Point3F vec = obj.getMuzzleVector(slot.AsInt()); Random r = new Random(); TransformF matrix = new TransformF(); matrix.MPosition.x = (float) ((r.NextDouble() - .5)*2*Math.PI*0.008); matrix.MPosition.y = (float) ((r.NextDouble() - .5)*2*Math.PI*0.008); matrix.MPosition.z = (float) ((r.NextDouble() - .5)*2*Math.PI*0.008); TransformF mat = math.MatrixCreateFromEuler(matrix); // Which we'll use to alter the projectile's initial vector with TransformF muzzleVector = math.MatrixMulVector(mat, vec); // Get the player's velocity, we'll then add it to that of the projectile TransformF objectVelocity = new TransformF(obj.getVelocity()); muzzleVector = muzzleVector.vectorScale(thisobj["projectile.muzzleVelocity"].AsFloat()); objectVelocity = objectVelocity.vectorScale(thisobj["projectile.velInheritFactor"].AsFloat()); TransformF muzzleVelocity = muzzleVector + objectVelocity; Torque_Class_Helper tch = new Torque_Class_Helper(thisobj["projectileType"], ""); tch.Props.Add("dataBlock", thisobj["projectile"]); tch.Props.Add("initialVelocity", '"' + muzzleVelocity.ToString() + '"'); tch.Props.Add("initialPosition", '"' + obj.getMuzzlePoint(slot.AsInt()).AsString() + '"'); tch.Props.Add("sourceObject", obj); tch.Props.Add("sourceSlot", slot); tch.Props.Add("client", obj["client"]); projectile = tch.Create(); ((coSimSet) "MissionCleanup").pushToBack(projectile); } return projectile; }
public void shaders_Init() { TorqueSingleton ts = new TorqueSingleton("ShaderData", "_DebugInterior_"); ts.PropsAddString("DXVertexShaderFile", "shaders/common/debugInteriorsV.hlsl"); ts.PropsAddString("DXPixelShaderFile", "shaders/common/debugInteriorsP.hlsl"); ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/debugInteriorsV.glsl"); ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/debugInteriorsP.glsl"); ts.Props.Add("pixVersion", "1.1"); ts.Create(); ts = new TorqueSingleton("ShaderData", "ParticlesShaderData"); ts.PropsAddString("DXVertexShaderFile", "shaders/common/particlesV.hlsl"); ts.PropsAddString("DXPixelShaderFile", "shaders/common/particlesP.hlsl"); ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/particlesV.glsl"); ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/particlesP.glsl"); ts.Props.Add("pixVersion", "2.0"); ts.Create(); ts = new TorqueSingleton("ShaderData", "OffscreenParticleCompositeShaderData"); ts.PropsAddString("DXVertexShaderFile", "shaders/common/particleCompositeV.hlsl"); ts.PropsAddString("DXPixelShaderFile", "shaders/common/particleCompositeP.hlsl"); ts.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/particleCompositeV.glsl"); ts.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/particleCompositeP.glsl"); ts.Props.Add("pixVersion", "2.0"); ts.Create(); //----------------------------------------------------------------------------- // Planar Reflection //----------------------------------------------------------------------------- Torque_Class_Helper tch = new Torque_Class_Helper("ShaderData", "ReflectBump"); tch.PropsAddString("DXVertexShaderFile", "shaders/common/planarReflectBumpV.hlsl"); tch.PropsAddString("DXPixelShaderFile", "shaders/common/planarReflectBumpP.hlsl"); tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/planarReflectBumpV.glsl"); tch.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/planarReflectBumpP.glsl"); tch.PropsAddString("samplerNames[0]", "$diffuseMap"); tch.PropsAddString("samplerNames[1]", "$refractMap"); tch.PropsAddString("samplerNames[2]", "$bumpMap"); tch.Props.Add("pixVersion", "2.0"); tch.Create(); tch = new Torque_Class_Helper("ShaderData", "Reflect"); tch.PropsAddString("DXVertexShaderFile", "shaders/common/planarReflectV.hlsl"); tch.PropsAddString("DXPixelShaderFile", "shaders/common/planarReflectP.hlsl"); tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/planarReflectV.glsl"); tch.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/planarReflectP.glsl"); tch.PropsAddString("samplerNames[0]", "$diffuseMap"); tch.PropsAddString("samplerNames[1]", "$refractMap"); tch.Props.Add("pixVersion", "1.4"); tch.Create(); tch = new Torque_Class_Helper("ShaderData", "fxFoliageReplicatorShader"); tch.PropsAddString("DXVertexShaderFile", "shaders/common/fxFoliageReplicatorV.hlsl"); tch.PropsAddString("DXPixelShaderFile", "shaders/common/fxFoliageReplicatorP.hlsl"); tch.PropsAddString("OGLVertexShaderFile", "shaders/common/gl/fxFoliageReplicatorV.glsl"); tch.PropsAddString("OGLPixelShaderFile", "shaders/common/gl/fxFoliageReplicatorP.glsl"); tch.PropsAddString("samplerNames[0]", "$diffuseMap"); tch.PropsAddString("samplerNames[1]", "$alphaMap"); tch.Props.Add("pixVersion", "1.4"); tch.Create(); }
public string ItemDataCreateItem(string datablock) { Torque_Class_Helper tch = new Torque_Class_Helper("Item"); tch.Props.Add("dataBlock", datablock); tch.Props.Add("static", "true"); tch.Props.Add("rotate", "true"); string obj = tch.Create(m_ts).AsString(); return obj; }
public void initRenderManager() { //con.error("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!RENDOR_MANAGER_INITIALIZED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); console.Eval(@"assert(!isObject(""DiffuseRenderPassManager""), ""initRenderManager() - DiffuseRenderPassManager already initialized!"")"); new Torque_Class_Helper("RenderPassManager", "DiffuseRenderPassManager").Create(m_ts); // This token, and the associated render managers, ensure that driver MSAA // does not get used for Advanced Lighting renders. The 'AL_FormatResolve' // PostEffect copies the result to the backbuffer. #region new RenderFormatToken(AL_FormatToken) Torque_Class_Helper tch = new Torque_Class_Helper("RenderFormatToken", "AL_FormatToken"); tch.PropsAddString("enabled", "false"); tch.PropsAddString("format", "GFXFormatR8G8B8A8"); tch.PropsAddString("depthFormat", "GFXFormatD24S8"); tch.Props.Add("aaLevel", "0"); // -1 = match backbuffer // The contents of the back buffer before this format token is executed // is provided in $inTex tch.PropsAddString("copyEffect", "AL_FormatCopy"); // The contents of the render target created by this format token is // provided in $inTex tch.PropsAddString("resolveEffect", "AL_FormatCopy"); tch.Create(m_ts); #endregion #region DiffuseRenderPassManager.addManager( new RenderPassStateBin() { renderOrder = 0.001; stateToken = AL_FormatToken; } ); Torque_Class_Helper tchb = new Torque_Class_Helper("RenderPassStateBin"); tchb.Props.Add("renderOrder", "0.001"); tchb.Props.Add("stateToken", "AL_FormatToken"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion // We really need to fix the sky to render after all the // meshes... but that causes issues in reflections. #region DiffuseRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Sky"; renderOrder = 0.1; processAddOrder = 0.1; } ); tchb = new Torque_Class_Helper("RenderObjectMgr"); tchb.PropsAddString("bintype", "Sky"); tchb.Props.Add("renderOrder", "0.1"); tchb.Props.Add("processAddOrder", "0.1"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Begin"; renderOrder = 0.2; processAddOrder = 0.2; } ); tchb = new Torque_Class_Helper("RenderObjectMgr"); tchb.PropsAddString("bintype", "Begin"); tchb.Props.Add("renderOrder", "0.2"); tchb.Props.Add("processAddOrder", "0.2"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion // Normal mesh rendering. #region DiffuseRenderPassManager.addManager( new RenderMeshMgr() { bintype = "Interior"; renderOrder = 0.3; processAddOrder = 0.3; } ); tchb = new Torque_Class_Helper("RenderMeshMgr"); tchb.PropsAddString("bintype", "Interior"); tchb.Props.Add("renderOrder", "0.3"); tchb.Props.Add("processAddOrder", "0.3"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderTerrainMgr() { renderOrder = 0.4; processAddOrder = 0.4; } ); tchb = new Torque_Class_Helper("RenderTerrainMgr"); tchb.Props.Add("renderOrder", "0.4"); tchb.Props.Add("processAddOrder", "0.4"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderMeshMgr() { bintype = "Mesh"; renderOrder = 0.5; processAddOrder = 0.5; } ); tchb = new Torque_Class_Helper("RenderMeshMgr"); tchb.PropsAddString("bintype", "Mesh"); tchb.Props.Add("renderOrder", "0.5"); tchb.Props.Add("processAddOrder", "0.5"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderImposterMgr() { renderOrder = 0.56; processAddOrder = 0.56; } ); tchb = new Torque_Class_Helper("RenderImposterMgr"); tchb.Props.Add("renderOrder", "0.56"); tchb.Props.Add("processAddOrder", "0.56"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Object"; renderOrder = 0.6; processAddOrder = 0.6; } ); tchb = new Torque_Class_Helper("RenderObjectMgr"); tchb.PropsAddString("bintype", "Object"); tchb.Props.Add("renderOrder", "0.6"); tchb.Props.Add("processAddOrder", "0.6"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Shadow"; renderOrder = 0.7; processAddOrder = 0.7; } ); tchb = new Torque_Class_Helper("RenderObjectMgr"); tchb.PropsAddString("bintype", "Shadow"); tchb.Props.Add("renderOrder", "0.7"); tchb.Props.Add("processAddOrder", "0.7"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderMeshMgr() { bintype = "Decal"; renderOrder = 0.8; processAddOrder = 0.8; } ); tchb = new Torque_Class_Helper("RenderMeshMgr"); tchb.PropsAddString("bintype", "Decal"); tchb.Props.Add("renderOrder", "0.8"); tchb.Props.Add("processAddOrder", "0.8"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderOcclusionMgr() { bintype = "Occluder"; renderOrder = 0.9; processAddOrder = 0.9; } ); tchb = new Torque_Class_Helper("RenderOcclusionMgr"); tchb.PropsAddString("bintype", "Occluder"); tchb.Props.Add("renderOrder", "0.9"); tchb.Props.Add("processAddOrder", "0.9"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion // We now render translucent objects that should handle // their own fogging and lighting. // Note that the fog effect is triggered before this bin. #region DiffuseRenderPassManager.addManager( new RenderObjectMgr(ObjTranslucentBin) { bintype = "ObjectTranslucent"; renderOrder = 1.0; processAddOrder = 1.0; } ); tchb = new Torque_Class_Helper("RenderObjectMgr", "ObjTranslucentBin"); tchb.PropsAddString("bintype", "ObjectTranslucent"); tchb.Props.Add("renderOrder", "1"); tchb.Props.Add("processAddOrder", "1"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Water"; renderOrder = 1.2; processAddOrder = 1.2; } ); tchb = new Torque_Class_Helper("RenderObjectMgr"); tchb.PropsAddString("bintype", "Water"); tchb.Props.Add("renderOrder", "1.2"); tchb.Props.Add("processAddOrder", "1.2"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Foliage"; renderOrder = 1.3; processAddOrder = 1.3; } ); tchb = new Torque_Class_Helper("RenderObjectMgr"); tchb.PropsAddString("bintype", "Foliage"); tchb.Props.Add("renderOrder", "1.3"); tchb.Props.Add("processAddOrder", "1.3"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderParticleMgr() { renderOrder = 1.35; processAddOrder = 1.35; } ); tchb = new Torque_Class_Helper("RenderParticleMgr"); tchb.Props.Add("renderOrder", "1.35"); tchb.Props.Add("processAddOrder", "1.35"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion #region DiffuseRenderPassManager.addManager( new RenderTranslucentMgr() { renderOrder = 1.4; processAddOrder = 1.4; } ); tchb = new Torque_Class_Helper("RenderTranslucentMgr"); tchb.Props.Add("renderOrder", "1.4"); tchb.Props.Add("processAddOrder", "1.4"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion // Note that the GlowPostFx is triggered after this bin. #region DiffuseRenderPassManager.addManager( new RenderGlowMgr(GlowBin) { renderOrder = 1.5; processAddOrder = 1.5; } ); tchb = new Torque_Class_Helper("RenderGlowMgr", "GlowBin"); tchb.Props.Add("renderOrder", "1.5"); tchb.Props.Add("processAddOrder", "1.5"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion // We render any editor stuff from this bin. Note that the HDR is // completed before this bin to keep editor elements from tone mapping. #region DiffuseRenderPassManager.addManager( new RenderObjectMgr(EditorBin) { bintype = "Editor"; renderOrder = 1.6; processAddOrder = 1.6; } ); tchb = new Torque_Class_Helper("RenderObjectMgr", "EditorBin"); tchb.PropsAddString("bintype", "Editor"); tchb.Props.Add("renderOrder", "1.6"); tchb.Props.Add("processAddOrder", "1.6"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion // Resolve format change token last. #region DiffuseRenderPassManager.addManager( new RenderPassStateBin() { renderOrder = 1.7; stateToken = AL_FormatToken; } ); tchb = new Torque_Class_Helper("RenderPassStateBin"); tchb.Props.Add("renderOrder", "1.7"); tchb.Props.Add("stateToken", "AL_FormatToken"); RenderPassManager.addManager("DiffuseRenderPassManager", tchb.Create(m_ts).AsString()); #endregion }
public void ResetMission() { console.print("*** MISSION RESET"); // Remove any temporary mission objects console.Call("MissionCleanup", "delete"); console.SetVar("$instantGroup", console.GetVarString("ServerGroup")); Torque_Class_Helper tcg = new Torque_Class_Helper("SimGroup", "MissionCleanup"); string sMissionCleanup = tcg.Create(m_ts).AsString(); console.SetVar("$instantGroup", sMissionCleanup); console.clearServerPaths(); console.error("-------------> Client Group Count = " + ClientGroup.Count); }
public void WeaponImageonWetFire(coScriptObject thisobj, coPlayer obj, int slot) { if (!thisobj["projectile"].isObject()) { console.error("WeaponImage::onFire() - Invalid projectile datablock"); return; } // Decrement inventory ammo. The image's ammo state is updated // automatically by the ammo inventory hooks. if (!thisobj["infiniteAmmo"].AsBool()) ShapeBaseShapeBaseDecInventory(obj, thisobj["ammo"], 1); // Get the player's velocity, we'll then add it to that of the projectile int numProjectiles = thisobj["projectileNum"].AsInt(); if (numProjectiles == 0) numProjectiles = 1; TransformF muzzleVector = new TransformF(); for (int i = 0; i < numProjectiles; i++) { if (thisobj["wetProjectileSpread"].AsBool()) { // We'll need to "skew" this projectile a little bit. We start by // getting the straight ahead aiming point of the gun Point3F vec = obj.getMuzzleVector(slot); // Then we'll create a spread matrix by randomly generating x, y, and z // points in a circle Random r = new Random(); TransformF matrix = new TransformF(); matrix.MPosition.x = (float)((r.NextDouble() - .5) * 2 * Math.PI * thisobj["wetProjectileSpread"].AsFloat()); matrix.MPosition.y = (float)((r.NextDouble() - .5) * 2 * Math.PI * thisobj["wetProjectileSpread"].AsFloat()); matrix.MPosition.z = (float)((r.NextDouble() - .5) * 2 * Math.PI * thisobj["wetProjectileSpread"].AsFloat()); TransformF mat = math.MatrixCreateFromEuler(matrix); muzzleVector = math.MatrixMulVector(mat, vec); } else { muzzleVector = new TransformF(obj.getMuzzleVector(slot)); } Point3F objectVelocity = obj.getVelocity(); muzzleVector = muzzleVector.vectorScale(thisobj["wetProjectile.muzzleVelocity"].AsFloat()); objectVelocity = objectVelocity.vectorScale(thisobj["wetProjectile.velInheritFactor"].AsFloat()); Point3F muzzleVelocity = muzzleVector.MPosition + objectVelocity; Torque_Class_Helper tch = new Torque_Class_Helper(thisobj["projectileType"]); tch.Props.Add("dataBlock", thisobj["wetProjectile"]); tch.Props.Add("initialVelocity", '"' + muzzleVelocity.AsString() + '"'); tch.Props.Add("initialPosition", '"' + obj.getMuzzlePoint(slot).AsString() + '"'); tch.Props.Add("sourceObject", obj); tch.Props.Add("sourceSlot", slot.AsString()); tch.Props.Add("client", obj["client"]); tch.Props.Add("sourceClass", obj.getClassName()); coItem projectile = tch.Create(); ((coSimSet)"MissionCleanup").pushToBack(projectile); } }
public string RocketLauncherImageOnAltFire(string thisobj, string obj, string slot) { string currentAmmo = ShapeBaseShapeBaseGetInventory(obj, console.GetVarString(string.Format("{0}.ammo", thisobj))).AsString(); if (currentAmmo.AsInt() < console.GetVarInt(string.Format("{0}.loadCount", thisobj))) console.SetVar(string.Format("{0}.loadCount", thisobj), currentAmmo); string project = ""; for (int shotCount = 0; shotCount < console.GetVarInt(string.Format("{0}.loadCount", thisobj)); shotCount++) { // Decrement inventory ammo. The image's ammo state is updated // automatically by the ammo inventory hooks. ShapeBaseShapeBaseDecInventory(obj, console.GetVarString(string.Format("{0}.ammo", thisobj)), "1"); // We fire our weapon using the straight ahead aiming point of the gun // We'll need to "skew" the projectile a little bit. We start by getting // the straight ahead aiming point of the gun Point3F vec = ShapeBase.getMuzzleVector(obj, slot.AsInt()); Random r = new Random(); TransformF matrix = new TransformF(); matrix.MPosition.x = (float) ((r.NextDouble() - .5)*2*Math.PI*0.008); matrix.MPosition.y = (float) ((r.NextDouble() - .5)*2*Math.PI*0.008); matrix.MPosition.z = (float) ((r.NextDouble() - .5)*2*Math.PI*0.008); TransformF mat = math.MatrixCreateFromEuler(matrix); // Which we'll use to alter the projectile's initial vector with TransformF muzzleVector = math.MatrixMulVector(mat, vec); // Get the player's velocity, we'll then add it to that of the projectile TransformF objectVelocity = new TransformF(ShapeBase.getVelocity(obj)); muzzleVector = muzzleVector.vectorScale(console.GetVarFloat(string.Format("{0}.projectile.muzzleVelocity", thisobj))); objectVelocity = objectVelocity.vectorScale(console.GetVarFloat(string.Format("{0}.projectile.velInheritFactor", thisobj))); TransformF muzzleVelocity = muzzleVector + objectVelocity; Torque_Class_Helper tch = new Torque_Class_Helper(console.GetVarString(string.Format("{0}.projectileType", thisobj)), ""); tch.Props.Add("dataBlock", console.GetVarString(string.Format("{0}.projectile", thisobj))); tch.Props.Add("initialVelocity", '"' + muzzleVelocity.ToString() + '"'); tch.Props.Add("initialPosition", '"' + ShapeBase.getMuzzlePoint(obj, slot.AsInt()).ToString() + '"'); tch.Props.Add("sourceObject", obj); tch.Props.Add("sourceSlot", slot); tch.Props.Add("client", console.GetVarString(string.Format("{0}.client", obj))); project = tch.Create(m_ts).ToString(CultureInfo.InvariantCulture); SimSet.pushToBack("MissionCleanup", project); } return project; }