Let AI fire nuke in singleplayer mission

Information and discussion for custom maps and mods.
Post Reply
Boxhead
Posts: 1
Joined: Thu Jan 25, 2018 10:15 pm

Let AI fire nuke in singleplayer mission

Post by Boxhead » Fri Jan 26, 2018 9:49 am

Hello everyone, I'm new to this forum and eager to ask a question immediately.

So I am working on some OpenRA Red Alert missions for some time now, got everything I wanted working. But now I came across a problem.

In a mission I'm currently scripting I am trying to let the AI fire a nuke. I realized there is no lua function for it so I had a look in the mission "10a: Suspicion" in the OpenRA Resource Center. From what I unterstood I just have add a bot to the player which controlls the nuke in order to let it fire the nuke, but unfortunately it isn't working.

This is what I did so far:

Code: Select all

Player:
	HackyAI@USSRNukes:
		Name: USSRNukes
		Type: nuke
		MinimumExcessPower: 40
		BuildingCommonNames:
			ConstructionYard: fact
			Refinery: 
			Power: 
			Barracks: 
			VehiclesFactory: 
			Production: 
			Silo: 
		UnitsCommonNames:
			Mcv: mcv
		BuildingLimits:
			proc: 0
			barr: 0
			kenn: 0
			dome: 0
			weap: 0
			afld: 0
			stek: 0
			fix: 0
			powr: 0
			apwr: 0
			ftur: 0
		BuildingFractions:
		UnitsToBuild:
		UnitLimits:
			dog: 0
			harv: 0
			mig: 0
			yak: 0
		SquadSize: 10000
		SupportPowerDecision@spyplane:
			OrderName: SovietSpyPlane
			MinimumAttractiveness: 1
			Consideration@1:
				Against: Enemy
				Types: Structure
				Attractiveness: 1
				TargetMetric: None
				CheckRadius: 5c0
		SupportPowerDecision@paratroopers:
			OrderName: SovietParatroopers
			MinimumAttractiveness: 5
			Consideration@1:
				Against: Enemy
				Types: Structure
				Attractiveness: 1
				TargetMetric: None
				CheckRadius: 8c0
			Consideration@2:
				Against: Enemy
				Types: Water
				Attractiveness: -5
				TargetMetric: None
				CheckRadius: 8c0
		SupportPowerDecision@parabombs:
			OrderName: UkraineParabombs
			MinimumAttractiveness: 1
			Consideration@1:
				Against: Enemy
				Types: Structure
				Attractiveness: 1
				TargetMetric: None
				CheckRadius: 5c0
		SupportPowerDecision@nukepower:
			OrderName: NukePowerInfoOrder
			MinimumAttractiveness: 25
			Consideration@1:
				Against: Enemy
				Types: Air, Ground, Water, Structure
				Attractiveness: 10
				TargetMetric: Value
				CheckRadius: 5c0
	-HackyAI@RushAI:
	-HackyAI@NormalAI:
	-HackyAI@TurtleAI:
	-HackyAI@NavalAI:
Added HackyAI in rules.yaml

Code: Select all

	PlayerReference@USSR:
		Name: USSR
		Bot: USSRNukes
		Faction: soviet
		Color: FE1100
		Allies: USSRParas
		Enemies: England, Civilians, Creeps
Added bot to the enemy which is supposed to fire the nuke.

But as I said it isn't working. Did I forget something or am I doing something completely wrong?

EDIT: Nevermind, got it working. Solution was to change "Bot: USSRNukes" to "Bot: nuke".
So the bot you set in the player reference has to be equal to the type of the bot not the name.

Post Reply