Page 1 of 1
Is it possible to give a minelayer a weapon that can fire?
Posted: Thu Jul 02, 2015 2:19 am
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.
Posted: Thu Jul 02, 2015 7:02 am
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.
Posted: Thu Jul 02, 2015 5:18 pm
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.
Posted: Thu Jul 02, 2015 5:55 pm
by abcdefg30
You are probably missing a muzzle sequence then.
Could you paste your code / crash report, please?
Posted: Thu Jul 02, 2015 7:04 pm
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:
Posted: Sun Jul 05, 2015 8:05 am
by Matt
You forgot to adapt the respective mods/*/sequences/*.yaml file.
https://github.com/OpenRA/OpenRA/wiki/Sequences gives some background.
Posted: Sun Jul 05, 2015 9:12 am
by abcdefg30
Or just remove "MuzzleSequence: muzzle" (from "Armament") and "WithMuzzleFlash".