Identifier Suffix @ How does this work?

the plan is to make all the air units visible on the air

Information and discussion for custom maps and mods.
Post Reply
User avatar
KOYK_GR
Posts: 52
Joined: Fri Aug 26, 2011 12:46 pm

Identifier Suffix @ How does this work?

Post by KOYK_GR » Tue May 02, 2017 12:27 am

I made this under helicopter on TD default.yaml the plan is to make all the air units visible on the air,but the code it doesn't work as i imagined.

Code: Select all

^Helicopter:
	HiddenUnderFog@GROUND:
		AlwaysVisibleStances: Ally
		Type: CenterPosition
		RequiresCondition: !airborne
	HiddenUnderFog@AIRBORNE:
		AlwaysVisibleStances: Ally, Enemy
		Type: CenterPosition
		RequiresCondition: airborne
And i get this in short

Code: Select all

Exception of type `System.InvalidOperationException`: Actor tran has multiple traits of type `OpenRA.Traits.IDefaultVisibility`
   at OpenRA.TraitDictionary.TraitContainer`1.GetOrDefault(UInt32 actor)
   at OpenRA.TraitDictionary.TraitContainer`1.Get(UInt32 actor)
   at OpenRA.TraitDictionary.Get[T](Actor actor)
   at OpenRA.Actor.Trait[T]()
   at OpenRA.Actor..ctor(World world, String name, TypeDictionary initDict)
   at OpenRA.World.CreateActor(Boolean addToWorld, String name, TypeDictionary initDict)
   at OpenRA.World.CreateActor(String name, TypeDictionary initDict)
   at OpenRA.Mods.Common.Traits.ProductionFromMapEdge.<Produce>c__AnonStorey0.<>m__1&#40;World w&#41;
   at OpenRA.World.Tick&#40;&#41;
   at OpenRA.Game.InnerLogicTick&#40;OrderManager orderManager&#41;
   at OpenRA.Game.LogicTick&#40;&#41;
   at OpenRA.Game.Loop&#40;&#41;
   at OpenRA.Game.Run&#40;&#41;
   at OpenRA.Program.Run&#40;String&#91;&#93; args&#41;
   at OpenRA.Program.Main&#40;String&#91;&#93; args&#41;
So is this even possible? how you make this work?

p.s. any tutorials on Identifier Suffix will be a welcome addition, thanks.

User avatar
Inq
Posts: 88
Joined: Sun Sep 27, 2015 2:48 am

Post by Inq » Tue May 02, 2017 1:47 am

Looking at the trait list: HiddenUnderFog does not support suffix or conditions by default.

I'm fairly novice at this - and perhaps someone more experienced has a method for doing this - but I think without modifying the trait, the closest you could do is have air units visible at all times through fog, or not at all.

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

Post by Graion Dilach » Tue May 02, 2017 6:20 am

Inq wrote: Looking at the trait list: HiddenUnderFog does not support suffix or conditions by default.

I'm fairly novice at this - and perhaps someone more experienced has a method for doing this - but I think without modifying the trait, the closest you could do is have air units visible at all times through fog, or not at all.
This.

IdentifierSuffix doesn't really need a tutorial IMO - it allows to set unique IDs for trait instances where the trait has multiple-instances support (HiddenUnderFog/AlwaysVisible/FrozenUnderFog aren't among these however). Technically all traits support IdentifierSuffixes though, but it's no point specifying one if the actor can't/won't have additional instances of them.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

User avatar
KOYK_GR
Posts: 52
Joined: Fri Aug 26, 2011 12:46 pm

Post by KOYK_GR » Tue May 02, 2017 6:41 am

I see, darn it.
Well thank you both for your help!

Post Reply