Пример #1
0
        public void onActivateBasicLM()
        {
            // If HDR is enabled... enable the special format token.
            if ((sGlobal["$platform"] == "macos") || ((coPostEffect)"HDRPostFx").isEnabledX())
            {
                ((coGFXStateBlockData)"AL_FormatToken").call("enable");
            }
            // Create render pass for projected shadow.

            coRenderPassManager BL_ProjectedShadowRPM = new Torque_Class_Helper("RenderPassManager", "BL_ProjectedShadowRPM").Create();

            // Create the mesh bin and add it to the manager.

            coRenderMeshMgr meshbin = new Torque_Class_Helper("RenderMeshMgr").Create();

            BL_ProjectedShadowRPM.addManager(meshbin);
            // Add both to the root group so that it doesn't
            // end up in the MissionCleanup instant group.

            coSimSet rootGroup = "RootGroup";

            rootGroup.pushToBack(BL_ProjectedShadowRPM);
            rootGroup.pushToBack(meshbin);
        }
Пример #2
0
        public string AiTurretShapeDataOnThrow(coAITurretShapeData thisobj, coPlayer user, int amount)
        {
            if (amount == 0)
            {
                amount = 1;
            }

            if (thisobj["maxInventory"] != "")
            {
                if (amount > thisobj["maxInventory"].AsInt())
                {
                    amount = thisobj["maxInventory"].AsInt();
                }
            }

            if (amount == 0)
            {
                return("0");
            }

            ShapeBaseShapeBaseDecInventory(user, thisobj, amount);
            //console.Call(user, "decInventory", new[] {thisobj, amount});
            TransformF rot = new TransformF(user.getEulerRotation());

            Torque_Class_Helper tc_obj = new Torque_Class_Helper("AITurretShape", "");

            tc_obj.Props.Add("datablock", thisobj);
            tc_obj.Props.Add("rotation", string.Format("{0}0 0 1 {1}{0}", '"', rot.MPosition.z));
            tc_obj.Props.Add("count", "1");
            tc_obj.Props.Add("sourceObject", user);
            tc_obj.Props.Add("client", console.GetVarString(string.Format("{0}.client", user)));
            tc_obj.Props.Add("isAiControlled", "1");

            coAITurretShape obj = tc_obj.Create();

            ((coSimSet)"MissionGroup").pushToBack(obj);
            obj.call("addToIgnoreList", user);


            coGameConnection client = user["client"];

            if (client.isObject())
            {
                if (client["ownedTurrets"] == "")
                {
                    client["ownedTurrets"] = new Torque_Class_Helper("SimSet", "").Create().AsString();
                }

                coSimSet SimSet_id    = client["ownedTurrets"];
                int      countofitems = SimSet_id.getCount();
                for (uint i = 0; i < countofitems; i++)
                {
                    coAITurretShape turret = SimSet_id.getObject(i);
                    turret.call("addToIgnoreList", obj);
                    obj.call("addToIgnoreList", turret);
                }
                SimSet_id.pushToBack(obj);
            }

            return(obj);
        }