How do I enable multiple build queues in RA1 and TS mods?

Information and discussion for custom maps and mods.
Post Reply
Alex06
Posts: 1
Joined: Fri Jan 27, 2006 2:48 am

How do I enable multiple build queues in RA1 and TS mods?

Post by Alex06 »

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?

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

Post by Graion Dilach »

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.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Proteus
Posts: 23
Joined: Wed Jun 08, 2011 2:42 pm

Post by Proteus »

Is it possible to have both Classic and multi-Production? My mod has a couple extra production types that I'd like to keep limited to one

User avatar
Nolt
Posts: 38
Joined: Fri Jun 19, 2015 10:04 pm
Location: Chile
Contact:

Post by Nolt »

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.
Image
Creator of Shattered Paradise and Nomad Galaxy. WARNING, there are tons of gifs on both pages.

Proteus
Posts: 23
Joined: Wed Jun 08, 2011 2:42 pm

Post by Proteus »

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&#40;String l&#41;
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext&#40;&#41;
   at System.Linq.Buffer`1..ctor&#40;IEnumerable`1 source&#41;
   at System.Linq.Enumerable.ToArray&#91;TSource&#93;&#40;IEnumerable`1 source&#41;
   at OpenRA.Widgets.Widget.PostInit&#40;WidgetArgs args&#41;
   at OpenRA.WidgetLoader.LoadWidget&#40;WidgetArgs args, Widget parent, MiniYamlNode node&#41;
   at OpenRA.WidgetLoader.LoadWidget&#40;WidgetArgs args, Widget parent, String w&#41;
   at OpenRA.Game.LoadWidget&#40;World world, String id, Widget parent, WidgetArgs args&#41;
   at OpenRA.Mods.Common.Traits.LoadWidgetAtGameStart.WorldLoaded&#40;World world, WorldRenderer wr&#41;
   at OpenRA.World.LoadComplete&#40;WorldRenderer wr&#41;
   at OpenRA.Game.StartGame&#40;String mapUID, WorldType type&#41;
   at OpenRA.Network.UnitOrders.ProcessOrder&#40;OrderManager orderManager, World world, Int32 clientId, Order order&#41;
   at OpenRA.Network.OrderManager.TickImmediate&#40;&#41;
   at OpenRA.Sync.<CheckSyncUnchanged>c__AnonStorey0.<>m__0&#40;&#41;
   at OpenRA.Sync.CheckSyncUnchanged&#91;T&#93;&#40;World world, Func`1 fn&#41;
   at OpenRA.Sync.CheckSyncUnchanged&#40;World world, Action fn&#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;

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

Post by Graion Dilach »

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.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Proteus
Posts: 23
Joined: Wed Jun 08, 2011 2:42 pm

Post by Proteus »

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. :/

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

Post by Graion Dilach »

Did you updated mods/ra/chrome.yaml as well?
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Proteus
Posts: 23
Joined: Wed Jun 08, 2011 2:42 pm

Post by Proteus »

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

Code: Select all

	ProductionQueueFromSelection&#58;
		ProductionTabsWidget&#58; PRODUCTION_TABS
(and yes still the same crash/exception)

Here is some code for the BARR just to show:

Code: Select all

BARR&#58;
	Inherits&#58; ^Building
	Buildable&#58;
		Queue&#58; Building
		BuildPaletteOrder&#58; 30
		Prerequisites&#58; anypower, ~structures.soviet, ~techlevel.infonly
	Valued&#58;
		Cost&#58; 400
	Tooltip&#58;
		Name&#58; Soviet Barracks
		Description&#58; Trains infantry.
	Building&#58;
		Footprint&#58; xx xx
		Dimensions&#58; 2,2
	Health&#58;
		HP&#58; 800
	Armor&#58;
		Type&#58; Wood
	RevealsShroud&#58;
		Range&#58; 5c0
	Bib&#58;
	RallyPoint&#58;
	Exit@1&#58;
		SpawnOffset&#58; -170,810,0
		ExitCell&#58; 1,2
	Exit@2&#58;
		SpawnOffset&#58; -725,640,0
		ExitCell&#58; 0,2
	Production&#58;
		Produces&#58; Infantry, Soldier
.... &#40;prerequisite nonsense&#41;
	Power&#58;
		Amount&#58; -20
	ProvidesPrerequisite@buildingname&#58;
	InfiltrateForSupportPower&#58;
		Proxy&#58; barracks.upgraded
	Targetable&#58;
		TargetTypes&#58; Ground, C4, DetonateAttack, Structure, SpyInfiltrate
	ProductionBar&#58;
	ProductionQueue&#58;
		Type&#58; Infantry
		Group&#58; Infantry
		BuildSpeed&#58; 40
		LowPowerSlowdown&#58; 2

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

Post by Graion Dilach »

Code: Select all

Production&#58; 
      Produces&#58; Infantry, Soldier 
IMO drop Soldier, that might be a cause as well.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Proteus
Posts: 23
Joined: Wed Jun 08, 2011 2:42 pm

Post by Proteus »

Tried that, same problem, I even tried reducing the UI to just work with the structures and it still crashes

Post Reply