I have a unit transformer, it must to transform to transformedunit1 or transformedunit2 conditions by build upgrades. its looks must be changed after it.
OpenRA engine version release-20180307
Red Alert 2 mod version release-20180307
on map 1a848cb4377fc30745fe9ada0914e29d05dc5b8b (Arctic Circle by Westwood Studios).
Date: 2018-07-25 22:24:55Z
Operating System: Windows (Microsoft Windows NT 6.2.9200.0)
Runtime Version: .NET CLR 4.0.30319.42000
Exception of type `OpenRA.YamlException`: ActorInfo("transformedunit1") failed to initialize because of the following:
Missing:
OpenRA.Traits.IMouseBoundsInfo
Unresolved:
OpenRA.Mods.Common.Traits.TooltipInfo: { OpenRA.Traits.IMouseBoundsInfo }
в OpenRA.ActorInfo.TraitsInConstructOrder() в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\GameRules\ActorInfo.cs:строка 131
в OpenRA.Actor..ctor(World world, String name, TypeDictionary initDict) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Actor.cs:строка 98
в OpenRA.World.CreateActor(Boolean addToWorld, String name, TypeDictionary initDict) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\World.cs:строка 252
в OpenRA.World.CreateActor(String name, TypeDictionary initDict) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\World.cs:строка 247
в OpenRA.Mods.Common.Traits.Production.<>c__DisplayClass5.<DoProduction>b__4(World w) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Mods.Common\Traits\Production.cs:строка 91
в OpenRA.World.Tick() в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\World.cs:строка 359
в OpenRA.Game.InnerLogicTick(OrderManager orderManager) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Game.cs:строка 605
в OpenRA.Game.LogicTick() в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Game.cs:строка 629
в OpenRA.Game.Loop() в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Game.cs:строка 759
в OpenRA.Game.Run() в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Game.cs:строка 799
в OpenRA.Game.InitializeAndRun(String[] args) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Game.cs:строка 253
в OpenRA.Program.Main(String[] args) в c:\games\RTS\OPENRA-ra2\engine\OpenRA.Game\Support\Program.cs:строка 37
How to write use conditions and upgrades to make this workabe?
Did it, there is no crash now, but RequiresCondition: trait is not work, and unit use transformedunit1 sprites before upgrade...
hmm... add transformedunit2 code, second GrantConditionOnPrerequisite and second RenderSprites traits to transformer, and now have another crach: "Actor transformer has multiple traits of type `OpenRA.Mods.Common.Traits.Render.RenderSprites`"
i'm in confuse, how to use logic of conditions to change sprites, name, speed, armament e.t.c. of unit?
I think you're lacking a lot of basic functional traits to get your units working. Do note that all the default units all have a template to inherit from.
To be honest Graion nailed it with his answer, you need to either list EVERY SINGLE TRAIT needed to make the action function or one of the basic inheritances that do the same, see this example, the first thing you see is the basic actor type inheritance, its gonna tell the unit basic things like death animations or how much space it uses on a cell. (Inherits: ^Soldier)
Also, you do not have any trait that could link up the transformation on condition, just a few provides prerequisites on the main actor that are not linked to anything, afaik the vanilla OpenRA codebase does not include a transform on condition trait, (unlike Graions fork, which does)
Yes, of course I tested with "Inherits: ^Animal" which inverit "^Soldier" and nothing changed...
" vanilla OpenRA codebase does not include a transform on condition trait"
What did it mean?
"RequiresCondition: transformedunit1" is not enoth?
maybe i need to add something like "ProvidesCondition@upgradename:" to transformedunit1&2?
Link from upgrades to buildings in vanilla d2k mod is work, i tryed repit same way...
Maybe it will be more understandable if someone show this functional on existing game unit? RA2 dog, like exaple - how can I change it name, or it sprites using upgrade?