How do I enable multiple build queues in RA1 and TS mods?
How do I enable multiple build queues in RA1 and TS mods?
I know that multiple build queues, one for each individual factory, is possible, as it is in the TD mod, but how can I enable it for a custom RA or TS mod?
- Graion Dilach
- Posts: 277
- Joined: Fri May 15, 2015 5:57 pm
You remove the ClassicProduction traits from ^Player and replace the PrimaryBuilding trait with properly set up Production traits on the factories, specify the proper subqueues on all the units then mod the UI/use TDs to make the UI aware of the factory queues.
I'm not that good in UI though to point out how to do the last one.
This goes to the modding questions and not to the general one, btw.
I'm not that good in UI though to point out how to do the last one.
This goes to the modding questions and not to the general one, btw.
AFAIK it should be possible to have a standard queue for aircraft and a multi queue for infantry for example, just make sure you don't have both on the same structure or things will start to mess up a bit.
I have experienced cases when combining both where the only way to produce units is to select the specific factory in question, and if I try to interact with the queue without doing that, the money ends being spent but no units come out of any factory, so use only one on each queue.
I have experienced cases when combining both where the only way to produce units is to select the specific factory in question, and if I try to interact with the queue without doing that, the money ends being spent but no units come out of any factory, so use only one on each queue.
I keep getting an exception when I try to go ingame, and I've even copied/used the CnC chrome completely. Removed the ClassicProductionQueue from Player and added ProductionQueue to the Construction Yard to begin with. I am always getting this error and it has something to do with the ProductionTabsWidget.
Code: Select all
Exception of type `System.Reflection.TargetInvocationException`: Exception has been thrown by the target of an invocation.
Inner Exception of type `System.Reflection.TargetInvocationException`: Exception has been thrown by the target of an invocation.
Inner Exception of type `System.ArgumentNullException`: Value cannot be null.
Parameter name: key
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at OpenRA.Mods.Common.Widgets.ProductionTabsWidget..ctor(World world)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at OpenRA.ObjectCreator.CreateUsingArgs(ConstructorInfo ctor, Dictionary`2 args)
at OpenRA.ObjectCreator.CreateObject[T](String className, Dictionary`2 args)
at OpenRA.WidgetLoader.NewWidget(String widgetType, WidgetArgs args)
at OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
at OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
at OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, String w)
at OpenRA.Game.LoadWidget(World world, String id, Widget parent, WidgetArgs args)
at OpenRA.Mods.Common.Widgets.Logic.LoadIngamePlayerOrObserverUILogic..ctor(Widget widget, World world)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at OpenRA.ObjectCreator.CreateUsingArgs(ConstructorInfo ctor, Dictionary`2 args)
at OpenRA.ObjectCreator.CreateObject[T](String className, Dictionary`2 args)
at OpenRA.Widgets.Widget.<PostInit>c__AnonStorey0.<>m__0(String l)
at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at OpenRA.Widgets.Widget.PostInit(WidgetArgs args)
at OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, MiniYamlNode node)
at OpenRA.WidgetLoader.LoadWidget(WidgetArgs args, Widget parent, String w)
at OpenRA.Game.LoadWidget(World world, String id, Widget parent, WidgetArgs args)
at OpenRA.Mods.Common.Traits.LoadWidgetAtGameStart.WorldLoaded(World world, WorldRenderer wr)
at OpenRA.World.LoadComplete(WorldRenderer wr)
at OpenRA.Game.StartGame(String mapUID, WorldType type)
at OpenRA.Network.UnitOrders.ProcessOrder(OrderManager orderManager, World world, Int32 clientId, Order order)
at OpenRA.Network.OrderManager.TickImmediate()
at OpenRA.Sync.<CheckSyncUnchanged>c__AnonStorey0.<>m__0()
at OpenRA.Sync.CheckSyncUnchanged[T](World world, Func`1 fn)
at OpenRA.Sync.CheckSyncUnchanged(World world, Action fn)
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)
- Graion Dilach
- Posts: 277
- Joined: Fri May 15, 2015 5:57 pm
I'll be assuming you still use the C&C UI.
The C&C UI and the RA UI calls the Support/Defense tab differently in ProductionQueue->Group (RA uses Support, C&C Defense). Also, if you removed all ClassicProductionQueues from Player but only added the Conyard ones, the infantry/vehicle/aircraft queues could indeed crash the game due to not having a single queue associated with them.
The C&C UI and the RA UI calls the Support/Defense tab differently in ProductionQueue->Group (RA uses Support, C&C Defense). Also, if you removed all ClassicProductionQueues from Player but only added the Conyard ones, the infantry/vehicle/aircraft queues could indeed crash the game due to not having a single queue associated with them.
RA uses Defense, and CnC uses Defence (the tooltip text is Support, however.) I have already corrected these to the Defense spelling. Seeing as I'm only currently testing with the ConYard, I removed the other production type buttons for now, and the error is still thrown.
Can't get my head around it.
Can't get my head around it.

- Graion Dilach
- Posts: 277
- Joined: Fri May 15, 2015 5:57 pm
Of course. I've just now copied the /ra mod folder to start from 'scratch' rather than my other mod, changed the structures to use Dawn's production queue style, I have all of Dawn's UI and bits loaded in as well, the game still crashes with the Same error on starting up a skirmish.
EDIT: I also saw that there are some differences with the world actor, and have adjusted it to match as well
(and yes still the same crash/exception)
Here is some code for the BARR just to show:
EDIT: I also saw that there are some differences with the world actor, and have adjusted it to match as well
Code: Select all
ProductionQueueFromSelection:
ProductionTabsWidget: PRODUCTION_TABS
Here is some code for the BARR just to show:
Code: Select all
BARR:
Inherits: ^Building
Buildable:
Queue: Building
BuildPaletteOrder: 30
Prerequisites: anypower, ~structures.soviet, ~techlevel.infonly
Valued:
Cost: 400
Tooltip:
Name: Soviet Barracks
Description: Trains infantry.
Building:
Footprint: xx xx
Dimensions: 2,2
Health:
HP: 800
Armor:
Type: Wood
RevealsShroud:
Range: 5c0
Bib:
RallyPoint:
Exit@1:
SpawnOffset: -170,810,0
ExitCell: 1,2
Exit@2:
SpawnOffset: -725,640,0
ExitCell: 0,2
Production:
Produces: Infantry, Soldier
.... (prerequisite nonsense)
Power:
Amount: -20
ProvidesPrerequisite@buildingname:
InfiltrateForSupportPower:
Proxy: barracks.upgraded
Targetable:
TargetTypes: Ground, C4, DetonateAttack, Structure, SpyInfiltrate
ProductionBar:
ProductionQueue:
Type: Infantry
Group: Infantry
BuildSpeed: 40
LowPowerSlowdown: 2
- Graion Dilach
- Posts: 277
- Joined: Fri May 15, 2015 5:57 pm
Code: Select all
Production:
Produces: Infantry, Soldier