Is it possible to give a minelayer a weapon that can fire?

Information and discussion for custom maps and mods.
Post Reply
fernoe
Posts: 32
Joined: Sat Sep 24, 2005 10:21 pm

Is it possible to give a minelayer a weapon that can fire?

Post by fernoe »

I've tried giving the AP minelayer the APC's gun, but whenever it tries to fire, the game crashes.

I have a feeling this might be due to the minelayer behavior being different (holding control allows you to highlight a patch of land to be turned into a minefield) so i'm wondering if anyone else has got it wrking and if not, if there's any workaround.

User avatar
Graion Dilach
Posts: 277
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

The mine is just another actor, so while I haven't tested it, I cannot really think about a reason why it shouldn't work.

From what I'd guess, you added an Armament without an Attack* flag (I might suggest giving the mine a turret/use AttackOmni). Post your exception.log.

fernoe
Posts: 32
Joined: Sat Sep 24, 2005 10:21 pm

Post by fernoe »

Graion Dilach wrote: From what I'd guess, you added an Armament without an Attack* flag (I might suggest giving the mine a turret/use AttackOmni).
Yeah, I suspect this was the issue. I got it working by making the minelayer use the APC image.

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Post by abcdefg30 »

You are probably missing a muzzle sequence then.

Could you paste your code / crash report, please?

fernoe
Posts: 32
Joined: Sat Sep 24, 2005 10:21 pm

Post by fernoe »

Yeah, it's the muzzle sequence thats causing the issue

Red Alert Mod at Version release-20150614
Operating System: Windows (Microsoft Windows NT 6.1.7601 Service Pack 1)
Runtime Version: .NET CLR 4.0.30319.1026
Exception of type `System.InvalidOperationException`: Unit `mnly` does not have a sequence named `muzzle`
at OpenRA.Graphics.SequenceProvider.GetSequence(String unitName, String sequenceName)
at OpenRA.Graphics.Animation.PlayThen(String sequenceName, Action after)
at OpenRA.Mods.Common.Traits.WithMuzzleFlash.Attacking(Actor self, Target target, Armament a, Barrel barrel)
at OpenRA.Mods.Common.Traits.Armament.CheckFire(Actor self, IFacing facing, Target target)
at OpenRA.Mods.Common.Traits.AttackBase.DoAttack(Actor self, Target target)
at OpenRA.Mods.Common.Activities.Attack.InnerTick(Actor self, AttackBase attack)
at OpenRA.Mods.Common.Activities.Attack.Tick(Actor self)
at OpenRA.Traits.Util.RunActivity(Actor self, Activity act)
at OpenRA.Actor.Tick()
at OpenRA.World.Tick()
at OpenRA.Game.InnerLogicTick(OrderManager orderManager)
at OpenRA.Game.LogicTick()
at OpenRA.Game.Loop()
at OpenRA.Game.Run()
at OpenRA.Program.Run(String[] args)
at OpenRA.Program.Main(String[] args)

MNLY.AP:
Inherits: ^Tank
Buildable:
Queue: Vehicle
BuildPaletteOrder: 110
Prerequisites: fix, ~vehicles.soviet, ~techlevel.medium
Valued:
Cost: 800
Tooltip:
Name: Minelayer
Description: Lays mines to destroy unwary enemy units.\nCan detect mines.
Health:
HP: 100
Armor:
Type: Heavy
Mobile:
Speed: 128
Crushes: wall, mine, crate, infantry
RevealsShroud:
Range: 5c0
RenderUnit:
Image: APC
Minelayer:
Mine: MINP
AmmoPoolName: mine
MineImmune:
AmmoPool:
Name: mine
Ammo: 5
RearmSound: minelay1.aud
DetectCloaked:
Range: 5
CloakTypes: Mine
Explodes:
Weapon: APMine
Armament:
Weapon: M60mg
LocalOffset: 0,0,171
MuzzleSequence: muzzle
AttackFrontal:
WithMuzzleFlash:
AutoTarget:

Matt
Posts: 1144
Joined: Tue May 01, 2012 12:21 pm
Location: Germany

Post by Matt »

You forgot to adapt the respective mods/*/sequences/*.yaml file. https://github.com/OpenRA/OpenRA/wiki/Sequences gives some background.

abcdefg30
Posts: 641
Joined: Mon Aug 18, 2014 6:00 pm

Post by abcdefg30 »

Or just remove "MuzzleSequence: muzzle" (from "Armament") and "WithMuzzleFlash".

Post Reply