New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Allies08a #15582

Merged
merged 1 commit into from Oct 7, 2018

Conversation

Projects
None yet
4 participants
@Smittytron
Copy link
Contributor

Smittytron commented Sep 2, 2018

The scripts for Allies08a and Allies08b(#15583) are identical sans waypoints. There's a one line difference as Allies08a had one more beach to land on than Allies08b.

Using the timer conversion math from #15396 I had the mission timer at 27 min from the original, which had a 45 min timer. This seemed a bit long in testing, so I decided to shorten it to 21 min.

The player can also win early by destroying all Soviet forces on the map.

@Smittytron Smittytron referenced this pull request Sep 2, 2018

Merged

Add Allies08b #15583

@Smittytron Smittytron force-pushed the Smittytron:Allies08a branch from a69103b to eb0b7af Sep 6, 2018

@Mailaender
Copy link
Member

Mailaender left a comment

Looks good from my side.

@abcdefg30
Copy link
Member

abcdefg30 left a comment

What is the radar dome in the west supposed to do? It is at low power all the time and doesn't even belong to you.

if not target or target.IsDead or (not target.IsInWorld) then
local enemies = Utils.Where(greece.GetActors(), function(actor)
return
actor.HasProperty("Health") and

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

The format looks a bit awkward, imho. Would you mind moving everything on one line again?
return actor.HasProperty("Health") and actor.Type ~= "brik"


local targets = Utils.Where(greece.GetActors(), function(actor)
return
actor.HasProperty("Sell") and

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

What speaks against using Building instead of Sell here? You could drop the explicit checks for atek and pdox then.

This comment has been minimized.

@Smittytron

Smittytron Sep 12, 2018

Contributor

Building doesn't work. Won't crash it but the parabombs never come.

end

SendParabombs = function()
if Airfield1.IsDead or Airfield1.Owner ~= ussr then

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

Do we not want to send parabombs if the second airfield is still alive?

This comment has been minimized.

@Smittytron

Smittytron Sep 10, 2018

Contributor

Yeah, didn't know how to write that.

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 11, 2018

Member

I'd probably do something like

local airfield = Airfield1
if Airfield1.IsDead or Airfield1.Owner ~= ussr then
	if Airfield2.IsDead or Airfield2.Owner ~= ussr then
		return
	end

	airfield = Airfield2
end
end

FinishTimer = function()
for i = 0, 5, 1 do

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

Please omit the , 1.

UserInterface.SetMissionText("Chronosphere experiment completes in " .. Utils.FormatTime(ticked), TimerColor)
ticked = ticked - 1
elseif ticked == 0 and (greece.PowerState ~= "Normal") then
PowerFailure()

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

Can you call greece.MarkFailedObjective(KeepBasePowered) directly here, and remove the one-line function, please?

Camera.Position = DefaultCameraPosition.CenterPosition
TimerColor = greece.Color

Trigger.OnAnyKilled(ObjectiveBuildings, MissionFailed)

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

Another minor nit: I'd prefer not adding too many one-line functions:
Trigger.OnAnyKilled(ObjectiveBuildings, function() greece.MarkFailedObjective(DefendChronosphere) end)

local targets = Utils.Where(greece.GetActors(), function(actor)
return
actor.HasProperty("Sell") and
actor.Type ~= "brik" or

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 10, 2018

Member

Don't we want to exclude sandbags (sbag) here as well?

@Smittytron

This comment has been minimized.

Copy link
Contributor

Smittytron commented Sep 10, 2018

What is the radar dome in the west supposed to do? It is at low power all the time and doesn't even belong to you.

As far as I know, nothing. Allies08b has the same thing with a communications center on an island. I thought about adding an 'evacuate scientists' secondary objective but that'd just be for flavor.

@abcdefg30

This comment has been minimized.

Copy link
Member

abcdefg30 commented Sep 11, 2018

I thought about adding an 'evacuate scientists' secondary objective but that'd just be for flavor.

Great idea, imho. Is the island accessible by water transports? If yes I'd go for it (if no, we might want to alter the map a tiny bit). Make a trigger that spawns some scientists when you send units near the dome. Then require them to be sent to your entry location for extraction. Or something similar. ^^
What we need to do anyway is to make the dome not appear in low power state. (Best would probably be to introduce a duplicate that doesn't consume power and is unbuildable by the player. To add to the idea above: The scientists could then transfer ownership of their non-power-consuming dome to you as reward.) I would also not ally the player with Germany, not giving the location of the dome away right from the start.

@Smittytron Smittytron force-pushed the Smittytron:Allies08a branch from eb0b7af to 7a0aaf7 Sep 11, 2018

@SoScared

This comment has been minimized.

Copy link
Member

SoScared commented Sep 16, 2018

Normal difficulty: I got the '20 minutes remaining' at 14m and '10 minutes remaining' at 4m.
Mission Accomplished with 00m:01s left.

Same occurs with 'Add Allies08b' #15583

Otherwise fine 👍

@Smittytron Smittytron force-pushed the Smittytron:Allies08a branch from 7a0aaf7 to efa05b3 Sep 17, 2018

Trigger.RemoveFootprintTrigger(id)
CreateScientists()
end
end)

This comment has been minimized.

@Smittytron

Smittytron Sep 17, 2018

Contributor

Attempted to add the scientist rescue, but I'm getting a crash on entering the footprint. Best I can tell it didn't like what I did here.

end)

Trigger.OnEnteredFootprint(ScientistFootprint, function(a, id)
if a.Owner == greece and not scientistsTriggered then

This comment has been minimized.

@Mailaender

Mailaender Sep 17, 2018

Member

scientistsTriggered is undefined here. Needs a scientistsTriggered = false above the function to initialize.

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 17, 2018

Member

That shouldn't matter. lua will treat scientistsTriggered being null here the same as if it was false.

end

CreateScientists = function()
scientists = Actor.Create(ScientistType, true, { Location = ScientistsExit.Location, Owner = greece })

This comment has been minimized.

@abcdefg30

abcdefg30 Sep 17, 2018

Member

I don't think you can create multiple actors using this command, I suspect this is the issue. Try using a loop to create them, let them scatter and then save the references to the actors in a table. You can use said table then for the Trigger functions below.

This comment has been minimized.

@Smittytron

Smittytron Sep 19, 2018

Contributor

I'll have to do some learning over the weekend to tackle this. Not sure if this means anything, but I tried this with a single actor and got the same crash:

e1 275 is not revealed for player USSR (0)!
Fatal Lua Error: [string "BindingSupport.lua"]:30: Unable to convert parameter 0 to String
at OpenRA.Scripting.ScriptContext.FatalError(String message)
at OpenRA.Mods.Common.Scripting.TriggerGlobal.<>c__DisplayClass14.b__13(Actor a)
at OpenRA.Mods.Common.Traits.ActorMap.CellTrigger.Tick(ActorMap actorMap)
at OpenRA.Mods.Common.Traits.ActorMap.OpenRA.Traits.ITick.Tick(Actor self)
at OpenRA.World.b__d(TraitPair1 x) at OpenRA.WorldUtils.DoTimed[T](IEnumerable1 e, Action`1 a, String text)
at OpenRA.World.Tick()
at OpenRA.Game.InnerLogicTick(OrderManager orderManager)
at OpenRA.Game.LogicTick()
at OpenRA.Game.Loop()
at OpenRA.Game.Run()
at OpenRA.Game.InitializeAndRun(String[] args)
at OpenRA.Program.Main(String[] args)

On a different note, I typically like to reward the player for completing an objective. Would chrono tank reinforcements be fitting, or would aftermath units be straying too far? (Thought about giving a new construction option for helicopters but I don't think that's doable atm)

This comment has been minimized.

@Mailaender

Mailaender Sep 19, 2018

Member

Try

scientist = Actor.Create("chan", true, { Location = ScientistsExit.Location, Owner = greece })

This comment has been minimized.

@Smittytron

Smittytron Oct 1, 2018

Contributor

Consider me baffled. I've tried Reinforcements.Reinforce instead of actor.Create; OnEnteredProximityTrigger instead of OnEnteredFootprint. Even tried a Tanya instead of Chan.
I see no difference in what I'm attempting here and how other missions use these types of triggers. (And i tested one to make sure it wasn't broken in bleed.)
Crashes every time the footprint is entered:

Fatal Lua Error: [string "BindingSupport.lua"]:30: Unable to convert parameter 1 to String[]
at OpenRA.Scripting.ScriptContext.FatalError(String message)
at OpenRA.Mods.Common.Scripting.TriggerGlobal.c__AnonStorey8.<>m__0(Actor a)
at OpenRA.Mods.Common.Traits.ActorMap.ProximityTrigger.Tick(ActorMap am)
at OpenRA.Mods.Common.Traits.ActorMap.OpenRA.Traits.ITick.Tick(Actor self)
at OpenRA.World.m__4(TraitPair1 x) at OpenRA.WorldUtils.DoTimed[T](IEnumerable1 e, Action`1 a, String text)
at OpenRA.World.Tick()
at OpenRA.Game.InnerLogicTick(OrderManager orderManager)
at OpenRA.Game.LogicTick()
at OpenRA.Game.Loop()
at OpenRA.Game.Run()
at OpenRA.Game.InitializeAndRun(String[] args)
at OpenRA.WindowsLauncher.RunGame(String[] args)
at OpenRA.WindowsLauncher.Main(String[] args)

If we can't solve this, the only other idea I had was a "Repair the island facility" objective.

This comment has been minimized.

@abcdefg30

abcdefg30 Oct 4, 2018

Member

Reinforcements have arrived: Smittytron#1
PS: This needs a rebase.

This comment has been minimized.

@Smittytron

Smittytron Oct 6, 2018

Contributor

Updated, but I'm still getting a crash when the footprint trigger is activated. Now it's:

Fatal Lua Error: [string "BindingSupport.lua"]:30: Uncaught CLR exception at Lua->CLR boundary: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at OpenRA.Mods.Common.Scripting.ReinforcementsGlobal.Reinforce(Player owner, String[] actorTypes, CPos[] entryPath, Int32 interval, LuaFunction actionFunc) in c:\Users\Smitty\OpenRA\OpenRA.Mods.Common\Scripting\Global\ReinforcementsGlobal.cs:line 80
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at OpenRA.Scripting.ScriptMemberWrapper.Invoke(LuaVararg args) in c:\Users\Smitty\OpenRA\OpenRA.Game\Scripting\ScriptMemberWrapper.cs:line 75
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Eluant.LuaRuntime.MethodWrapper.Invoke(Object[] parms)
at Eluant.LuaRuntime.MakeManagedCall(IntPtr state, MethodWrapper wrapper)
at OpenRA.Scripting.ScriptContext.FatalError(String message)
at OpenRA.Mods.Common.Scripting.TriggerGlobal.<>c__DisplayClass14.b__13(Actor a)
at OpenRA.Mods.Common.Traits.ActorMap.CellTrigger.Tick(ActorMap actorMap)
at OpenRA.Mods.Common.Traits.ActorMap.OpenRA.Traits.ITick.Tick(Actor self)
at OpenRA.World.b__d(TraitPair1 x) at OpenRA.WorldUtils.DoTimed[T](IEnumerable1 e, Action`1 a, String text)
at OpenRA.World.Tick()
at OpenRA.Game.InnerLogicTick(OrderManager orderManager)
at OpenRA.Game.LogicTick()
at OpenRA.Game.Loop()
at OpenRA.Game.Run()
at OpenRA.Game.InitializeAndRun(String[] args)
at OpenRA.Program.Main(String[] args)

This comment has been minimized.

@abcdefg30

@Smittytron Smittytron force-pushed the Smittytron:Allies08a branch 2 times, most recently from c83e105 to 4b94521 Oct 6, 2018

@abcdefg30
Copy link
Member

abcdefg30 left a comment

You got a leading white space in a few places:

diff --git
@@ -28,10 +28,10 @@ CreateScientists = function()
 		s.Scatter()
 	end)
 
-	local flare = Actor.Create("flare", true, { Owner = greece, Location = DefaultCameraPosition.Location + CVec.New(-1, 0) })
+ 	local flare = Actor.Create("flare", true, { Owner = greece, Location = DefaultCameraPosition.Location + CVec.New(-1, 0) })
 	Trigger.AfterDelay(DateTime.Seconds(2), function() Media.PlaySpeechNotification(player, "SignalFlareNorth") end)
 
-	Trigger.OnAnyKilled(scientists, function()
+ 	Trigger.OnAnyKilled(scientists, function()
 		Media.PlaySpeechNotification(greece, "ObjectiveNotMet")
 		greece.MarkFailedObjective(EvacuateScientists)
 	end)
@@ -45,26 +45,26 @@ CreateScientists = function()
 				a.Stop()
 				a.Move(MCVEntry.Location)
 
-				-- Constantly try to reach the exit (and thus avoid getting stuck if the path was blocked)
+ 				-- Constantly try to reach the exit (and thus avoid getting stuck if the path was blocked)
 				Trigger.OnIdle(a, function()
 					a.Move(MCVEntry.Location)
 				end)
 			end
 		end)
 
-		-- Use a cell trigger to destroy the scientists preventing the player from causing glitchs by blocking the path
+ 		-- Use a cell trigger to destroy the scientists preventing the player from causing glitchs by blocking the path
 		Trigger.OnEnteredFootprint({ MCVEntry.Location }, function(a, id)
 			if a.Owner == germany then
 				a.Stop()
 				a.Destroy()
 
-				left = left - 1
+ 				left = left - 1
 				if left == 0 then
 					Trigger.RemoveFootprintTrigger(id)
 					Trigger.RemoveFootprintTrigger(changeOwnerTrigger)
 					flare.Destroy()
 
-					if not greece.IsObjectiveCompleted(EvacuateScientists) and not greece.IsObjectiveFailed(EvacuateScientists) then
+ 					if not greece.IsObjectiveCompleted(EvacuateScientists) and not greece.IsObjectiveFailed(EvacuateScientists) then
 						Media.PlaySpeechNotification(greece, "ObjectiveMet")
 						greece.MarkCompletedObjective(EvacuateScientists)
 					end
@@ -72,8 +72,8 @@ CreateScientists = function()
 			end
 		end)
 	end)
+ end
 
-end
 
 FinishTimer = function()
 	for i = 0, 5 do
AlliedBoatReinforcements = { "dd", "dd" }
TimerTicks = DateTime.Minutes(21)
ObjectiveBuildings = { Chronosphere, AlliedTechCenter }
ScientistType = { "chan", "chan", "chan", "chan" }

This comment has been minimized.

@abcdefg30

abcdefg30 Oct 6, 2018

Member

Something must have gone wrong here while squashing/rebasing. The change here https://github.com/Smittytron/OpenRA/pull/1/files#diff-fedb75b398831c487136300f93364597R12 was not carried over. This needs to be ScientistTypes.

@Smittytron Smittytron force-pushed the Smittytron:Allies08a branch from 4b94521 to fe9c162 Oct 6, 2018

@Smittytron Smittytron force-pushed the Smittytron:Allies08a branch from fe9c162 to 5931ba9 Oct 6, 2018

@Smittytron

This comment has been minimized.

Copy link
Contributor

Smittytron commented Oct 6, 2018

OK, that works. Thanks for the help!

I'll get #15583 updated once we're done here.

@abcdefg30 abcdefg30 merged commit 831ec0a into OpenRA:bleed Oct 7, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@abcdefg30

This comment has been minimized.

Copy link
Member

abcdefg30 commented Oct 7, 2018

@Smittytron Smittytron deleted the Smittytron:Allies08a branch Oct 7, 2018

@obrakmann obrakmann referenced this pull request Oct 8, 2018

Open

Add Red Alert campaign #4989

6 of 8 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment