Skip to content

Instantly share code, notes, and snippets.

@MustaphaTR
Created December 21, 2019 11:30
Show Gist options
  • Save MustaphaTR/8a1dcd6223726876688316802ac7f921 to your computer and use it in GitHub Desktop.
Save MustaphaTR/8a1dcd6223726876688316802ac7f921 to your computer and use it in GitHub Desktop.
--cameras = { CAMERA_NOD_CABAL, CAMERA_MUTANT_CABAL, CAMERA_SCRIN_GDI }
MutantBusGuys = { marauder, marauder, marauder, marauder, mutfiend }
GDIPatrol1 = { GDIPatrolA1.Location, GDIPatrolA2.Location }
GDIPatrol2 = { GDIPatrolB1.Location, GDIPatrolB2.Location }
GDIPatrol3 = { GDIPatrolC1.Location, GDIPatrolC2.Location }
NodPatrol1 = { NodPatrolA1.Location, NodPatrolA2.Location }
NodPatrol2 = { NodPatrolB1.Location, NodPatrolB2.Location }
NodPatrol3 = { NodPatrolC1.Location, NodPatrolC2.Location }
NodPatrol4 = { NodPatrolD1.Location, NodPatrolD2.Location }
NodPatrol5 = { NodPatrolE1.Location, NodPatrolE2.Location }
NodPatrol6 = { NodPatrolF1.Location, NodPatrolF2.Location }
ScrinPatrol1 = { ScrinPatrolA1.Location, ScrinPatrolA2.Location }
ScrinPatrol2 = { ScrinPatrolB1.Location, ScrinPatrolB2.Location, ScrinPatrolB3.Location }
MutantPatrol1 = { MutantPatrolA1.Location, MutantPatrolA2.Location, MutantPatrolA3.Location, MutantPatrolA2.Location }
SpawnPartrollers = function()
local marine1 = Actor.Create("gdie1", true, { Owner = gdi, Location = GDIPatrol1[1], SubCell = 1 })
local phlanx1 = Actor.Create("grenadier", true, { Owner = gdi, Location = GDIPatrol1[1], SubCell = 2 })
local marine2 = Actor.Create("gdie1", true, { Owner = gdi, Location = GDIPatrol2[1], SubCell = 1 })
local phlanx2 = Actor.Create("grenadier", true, { Owner = gdi, Location = GDIPatrol2[1], SubCell = 2 })
local wolverine1 = Actor.Create("grenadier", true, { Owner = gdi, Location = GDIPatrol3[1] })
Patrol2A(marine1, GDIPatrol1, DateTime.Seconds(7))
Patrol2A(phlanx1, GDIPatrol1, DateTime.Seconds(7))
Patrol2A(marine2, GDIPatrol2, DateTime.Seconds(7))
Patrol2A(phlanx2, GDIPatrol2, DateTime.Seconds(7))
Patrol2A(wolverine1, GDIPatrol3, DateTime.Seconds(6))
local buggy1 = Actor.Create("bggy", true, { Owner = nod, Location = NodPatrol1[1] })
local buggy2 = Actor.Create("bggy", true, { Owner = nod, Location = NodPatrol2[1] })
local buggy3 = Actor.Create("rocketbggy", true, { Owner = nod, Location = NodPatrol3[1] })
local buggy4 = Actor.Create("rocketbggy", true, { Owner = nod, Location = NodPatrol4[1] })
local crusader1 = Actor.Create("crusader", true, { Owner = nod, Location = NodPatrol5[1], SubCell = 1 })
local crusader2 = Actor.Create("crusader", true, { Owner = nod, Location = NodPatrol5[1], SubCell = 2 })
local crusader3 = Actor.Create("crusader", true, { Owner = nod, Location = NodPatrol5[1], SubCell = 3 })
local crusader4 = Actor.Create("crusader", true, { Owner = nod, Location = NodPatrol6[1], SubCell = 1 })
local crusader5 = Actor.Create("crusader", true, { Owner = nod, Location = NodPatrol6[2], SubCell = 1 })
Patrol2A(buggy1, NodPatrol1, DateTime.Seconds(7))
Patrol2A(buggy2, NodPatrol2, DateTime.Seconds(7))
Patrol2A(buggy3, NodPatrol3, DateTime.Seconds(6))
Patrol2A(buggy4, NodPatrol4, DateTime.Seconds(6))
Patrol2A(crusader1, NodPatrol5, DateTime.Seconds(5))
Patrol2A(crusader2, NodPatrol5, DateTime.Seconds(5))
Patrol2A(crusader3, NodPatrol5, DateTime.Seconds(5))
Patrol2A(crusader4, NodPatrol6, DateTime.Seconds(3))
Patrol2B(crusader5, NodPatrol6, DateTime.Seconds(3))
local hovertank1 = Actor.Create("scrmbt", true, { Owner = scr, Location = ScrinPatrol1[1] })
local glider1 = Actor.Create("scrglyder2", true, { Owner = scr, Location = ScrinPatrol2[1] })
Patrol2A(hovertank1, ScrinPatrol1, DateTime.Seconds(5))
Patrol3A(glider1, ScrinPatrol2, DateTime.Seconds(5))
local fiend1 = Actor.Create("mutfiend", true, { Owner = mut, Location = MutantPatrol1[1], SubCell = 1 })
local fiend2 = Actor.Create("mutfiend", true, { Owner = mut, Location = MutantPatrol1[3], SubCell = 1 })
Patrol4A(fiend1, MutantPatrol1, DateTime.Seconds(9))
Patrol4C(fiend2, MutantPatrol1, DateTime.Seconds(11))
end
Patrol2A = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[1])
Trigger.AfterDelay(delay, function()
Patrol2B(unit, waypoints, delay)
end)
end
Patrol2B = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[2])
Trigger.AfterDelay(delay, function()
Patrol2A(unit, waypoints, delay)
end)
end
Patrol3A = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[1])
Trigger.AfterDelay(delay, function()
Patrol3B(unit, waypoints, delay)
end)
end
Patrol3B = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[2])
Trigger.AfterDelay(delay, function()
Patrol3C(unit, waypoints, delay)
end)
end
Patrol3C = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[3])
Trigger.AfterDelay(delay, function()
Patrol3A(unit, waypoints, delay)
end)
end
Patrol4A = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[1])
Trigger.AfterDelay(delay, function()
Patrol4B(unit, waypoints, delay)
end)
end
Patrol4B = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[2])
Trigger.AfterDelay(delay, function()
Patrol4C(unit, waypoints, delay)
end)
end
Patrol4C = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[3])
Trigger.AfterDelay(delay, function()
Patrol4D(unit, waypoints, delay)
end)
end
Patrol4D = function(unit, waypoints, delay)
if unit.IsDead then
return
end
unit.AttackMove(waypoints[4])
Trigger.AfterDelay(delay, function()
Patrol4A(unit, waypoints, delay)
end)
end
MutantBusService = function()
Trigger.AfterDelay(DateTime.Seconds(10), function()
mut.Build(MutantBusGuys, function(actors)
local bus = Actor.Create("struck", true, { Owner = mut, Location = MutantBusEntry.Location })
bus.Move(MutantBusStop.Location)
Trigger.AfterDelay(DateTime.Seconds(5), function()
Utils.Do(actors, function(actor)
actor.EnterTransport(bus)
end)
Trigger.AfterDelay(DateTime.Seconds(3), function()
bus.Move(MutantBusEntry.Location)
bus.Destroy()
MutantBusService()
end)
end)
end)
end)
end
SetWaypoints = function()
MutantRax.RallyPoint = MutantRaxRally.Location
end
ticks = 1250
speed = 7
--index = 1
--interval = 250
Tick = function()
ticks = ticks + 1
--if ticks % interval == 0 then
-- Camera.Position = cameras[index].CenterPosition
-- if index + 1 > #cameras then
-- index = 1
-- else
-- index = index + 1
-- end
--end
local t = (ticks + 45) % (360 * speed) * (math.pi / 180) / speed;
Camera.Position = viewportOrigin + WVec.New(46080 * math.sin(t), 35840 * math.cos(t), 0)
end
WorldLoaded = function()
gdi = Player.GetPlayer("GDI")
nod = Player.GetPlayer("Nod")
cab = Player.GetPlayer("Cabal")
mut = Player.GetPlayer("Mutants")
scr = Player.GetPlayer("Scrin")
viewportOrigin = Camera.Position
SpawnPartrollers()
MutantBusService()
SetWaypoints()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment