Example #1
0
        private static IEnumerator ball_waitForPrematch()
        {
            while (!prematchOver)
            {
                yield return(Wait(.1f));
            }

            GSCFunctions.Objective_Add(ballObjID, "active");
            GSCFunctions.Objective_Icon(ballObjID, "waypoint_targetneutral");
            GSCFunctions.Objective_Position(ballObjID, ballEnt.Origin);

            GSCFunctions.Objective_Add(ballObjIDAllies, "invisible");
            GSCFunctions.Objective_Icon(ballObjIDAllies, "waypoint_escort");
            GSCFunctions.Objective_Position(ballObjIDAllies, ballEnt.Origin);
            //ballFX.Origin = ballEnt.Origin;
            //GSCFunctions.PlayFXOnTag(ballGlow, ballFX, "tag_origin");
            playBallFX();

            GSCFunctions.TriggerFX(baseFX);

            OnInterval(50, () => monitorBallPickup(ballEnt));
        }
Example #2
0
        private static IEnumerator spawnStations(Vector3 alliesPos, Vector3 axisPos)
        {
            yield return(Wait(.1f));

            if (isHalftime)
            {
                alliesStation = GSCFunctions.Spawn("script_model", axisPos + new Vector3(0, 0, 100));
            }
            else
            {
                alliesStation = GSCFunctions.Spawn("script_model", alliesPos + new Vector3(0, 0, 100));
            }

            alliesStation.SetModel("tag_origin");
            Entity alliesStationBack = GSCFunctions.Spawn("script_model", alliesStation.Origin);

            alliesStationBack.SetModel("tag_origin");
            alliesStation.SetField("back", alliesStationBack);
            alliesStation.SetField("team", "allies");
            OnInterval(50, () => monitorZone(alliesStation));

            if (isHalftime)
            {
                axisStation = GSCFunctions.Spawn("script_model", alliesPos + new Vector3(0, 0, 100));
            }
            else
            {
                axisStation = GSCFunctions.Spawn("script_model", axisPos + new Vector3(0, 0, 100));
            }

            axisStation.SetModel("tag_origin");
            Entity axisStationBack = GSCFunctions.Spawn("script_model", axisStation.Origin);

            axisStationBack.SetModel("tag_origin");
            axisStation.SetField("back", axisStationBack);
            axisStation.SetField("team", "axis");
            OnInterval(50, () => monitorZone(axisStation));

            alliesStation.SetField("isScoring", false);
            alliesStation.SetField("team", "allies");
            axisStation.SetField("isScoring", false);
            axisStation.SetField("team", "axis");

            GSCFunctions.Objective_Add(alliesSiteAttackerID, "active", alliesStation.Origin, "waypoint_target");
            GSCFunctions.Objective_Team(alliesSiteAttackerID, "allies");
            GSCFunctions.Objective_Add(alliesSiteDefenderID, "active", alliesStation.Origin, "waypoint_defend");
            GSCFunctions.Objective_Team(alliesSiteDefenderID, "axis");
            GSCFunctions.Objective_Add(axisSiteAttackerID, "active", axisStation.Origin, "waypoint_target");
            GSCFunctions.Objective_Team(axisSiteAttackerID, "axis");
            GSCFunctions.Objective_Add(axisSiteDefenderID, "active", axisStation.Origin, "waypoint_defend");
            GSCFunctions.Objective_Team(axisSiteDefenderID, "allies");

            //Hud
            alliesSiteAttackerWaypoint                  = GSCFunctions.NewTeamHudElem("allies");
            alliesSiteAttackerWaypoint.Alpha            = 0.5f;
            alliesSiteAttackerWaypoint.Archived         = true;
            alliesSiteAttackerWaypoint.HideIn3rdPerson  = false;
            alliesSiteAttackerWaypoint.HideWhenDead     = false;
            alliesSiteAttackerWaypoint.HideWhenInDemo   = false;
            alliesSiteAttackerWaypoint.HideWhenInMenu   = false;
            alliesSiteAttackerWaypoint.LowResBackground = false;
            alliesSiteAttackerWaypoint.SetShader("waypoint_target", 10, 10);
            alliesSiteAttackerWaypoint.X = alliesStation.Origin.X;
            alliesSiteAttackerWaypoint.Y = alliesStation.Origin.Y;
            alliesSiteAttackerWaypoint.Z = alliesStation.Origin.Z;
            alliesSiteAttackerWaypoint.SetWaypoint(true, true, false, false);
            alliesSiteAttackerWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            alliesSiteDefenderWaypoint                  = GSCFunctions.NewTeamHudElem("axis");
            alliesSiteDefenderWaypoint.Alpha            = 0.5f;
            alliesSiteDefenderWaypoint.Archived         = true;
            alliesSiteDefenderWaypoint.HideIn3rdPerson  = false;
            alliesSiteDefenderWaypoint.HideWhenDead     = false;
            alliesSiteDefenderWaypoint.HideWhenInDemo   = false;
            alliesSiteDefenderWaypoint.HideWhenInMenu   = false;
            alliesSiteDefenderWaypoint.LowResBackground = false;
            alliesSiteDefenderWaypoint.SetShader("waypoint_defend", 10, 10);
            alliesSiteDefenderWaypoint.X = alliesStation.Origin.X;
            alliesSiteDefenderWaypoint.Y = alliesStation.Origin.Y;
            alliesSiteDefenderWaypoint.Z = alliesStation.Origin.Z;
            alliesSiteDefenderWaypoint.SetWaypoint(true, true, false, false);
            alliesSiteDefenderWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            axisSiteAttackerWaypoint                  = GSCFunctions.NewTeamHudElem("axis");
            axisSiteAttackerWaypoint.Alpha            = 0.5f;
            axisSiteAttackerWaypoint.Archived         = true;
            axisSiteAttackerWaypoint.HideIn3rdPerson  = false;
            axisSiteAttackerWaypoint.HideWhenDead     = false;
            axisSiteAttackerWaypoint.HideWhenInDemo   = false;
            axisSiteAttackerWaypoint.HideWhenInMenu   = false;
            axisSiteAttackerWaypoint.LowResBackground = false;
            axisSiteAttackerWaypoint.SetShader("waypoint_target", 10, 10);
            axisSiteAttackerWaypoint.X = axisStation.Origin.X;
            axisSiteAttackerWaypoint.Y = axisStation.Origin.Y;
            axisSiteAttackerWaypoint.Z = axisStation.Origin.Z;
            axisSiteAttackerWaypoint.SetWaypoint(true, true, false, false);
            axisSiteAttackerWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            axisSiteDefenderWaypoint                  = GSCFunctions.NewTeamHudElem("allies");
            axisSiteDefenderWaypoint.Alpha            = 0.5f;
            axisSiteDefenderWaypoint.Archived         = true;
            axisSiteDefenderWaypoint.HideIn3rdPerson  = false;
            axisSiteDefenderWaypoint.HideWhenDead     = false;
            axisSiteDefenderWaypoint.HideWhenInDemo   = false;
            axisSiteDefenderWaypoint.HideWhenInMenu   = false;
            axisSiteDefenderWaypoint.LowResBackground = false;
            axisSiteDefenderWaypoint.SetShader("waypoint_defend", 10, 10);
            axisSiteDefenderWaypoint.X = axisStation.Origin.X;
            axisSiteDefenderWaypoint.Y = axisStation.Origin.Y;
            axisSiteDefenderWaypoint.Z = axisStation.Origin.Z;
            axisSiteDefenderWaypoint.SetWaypoint(true, true, false, false);
            axisSiteDefenderWaypoint.SetWaypointEdgeStyle_RotatingIcon();

            playStationFX();
        }