Hello everyone... I am working on a mod for OpenRA and I want a custom chrome for it. Is there any guides on how to do this?
I want the setup to be like the CNC mod. where you can have two barracks making infantry at the same time. but I also want to edit the graphics and such.
Editing the Chrome?
How does one do this?
The queue-per-structure logic and the chrome display are largely separate issues.
The queue logic is implemented in C&C by adding a ProductionQueue trait to the production structure definition (in contrast to RA, which defines all of the queues using ClassicProductionQueue on the player actor definition).
Look at mods/cnc/rules/structures.yaml and mods/ra/rules/system.yaml for more info on this.
The chrome is implemented in RA with the monolithic BuildPalette widget, which does everything relating to the RA production palette. It will display multiple queues of the same type as multiple tabs with the same icon. C&C splits the production palette over multiple simpler widgets (ToggleButton for the queue types, ProductionTabs for the tab strip, and ProductionPalette for the icons) which are wired together by the CncIngameChrome logic handler. Look at mods/cnc/chrome/ingame.yaml and OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs for more info on this.
Note that you can change RA to use multiple queues with no special changes, but you must add a reference to OpenRA.Mods.Cnc.dll if you want to use the C&C UI.
The queue logic is implemented in C&C by adding a ProductionQueue trait to the production structure definition (in contrast to RA, which defines all of the queues using ClassicProductionQueue on the player actor definition).
Look at mods/cnc/rules/structures.yaml and mods/ra/rules/system.yaml for more info on this.
The chrome is implemented in RA with the monolithic BuildPalette widget, which does everything relating to the RA production palette. It will display multiple queues of the same type as multiple tabs with the same icon. C&C splits the production palette over multiple simpler widgets (ToggleButton for the queue types, ProductionTabs for the tab strip, and ProductionPalette for the icons) which are wired together by the CncIngameChrome logic handler. Look at mods/cnc/chrome/ingame.yaml and OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs for more info on this.
Note that you can change RA to use multiple queues with no special changes, but you must add a reference to OpenRA.Mods.Cnc.dll if you want to use the C&C UI.
Sleipnir wrote: ↑The queue-per-structure logic and the chrome display are largely separate issues.
The queue logic is implemented in C&C by adding a ProductionQueue trait to the production structure definition (in contrast to RA, which defines all of the queues using ClassicProductionQueue on the player actor definition).
Look at mods/cnc/rules/structures.yaml and mods/ra/rules/system.yaml for more info on this.
The chrome is implemented in RA with the monolithic BuildPalette widget, which does everything relating to the RA production palette. It will display multiple queues of the same type as multiple tabs with the same icon. C&C splits the production palette over multiple simpler widgets (ToggleButton for the queue types, ProductionTabs for the tab strip, and ProductionPalette for the icons) which are wired together by the CncIngameChrome logic handler. Look at mods/cnc/chrome/ingame.yaml and OpenRA.Mods.Cnc/Widgets/Logic/CncIngameChromeLogic.cs for more info on this.
Note that you can change RA to use multiple queues with no special changes, but you must add a reference to OpenRA.Mods.Cnc.dll if you want to use the C&C UI.
so here is what I did...
I commented out the following under player in system.yaml
# ClassicProductionQueue@Building:
# Type: Building
# BuildSpeed: .4
# LowPowerSlowdown: 3
# QueuedAudio: Building
# ReadyAudio: ConstructionComplete
# ClassicProductionQueue@Defense:
# Type: Defense
# BuildSpeed: .4
# LowPowerSlowdown: 3
# QueuedAudio: Building
# ReadyAudio: ConstructionComplete
# ClassicProductionQueue@Vehicle:
# Type: Vehicle
# BuildSpeed: .4
# LowPowerSlowdown: 3
# ClassicProductionQueue@Infantry:
# Type: Infantry
# BuildSpeed: .4
# LowPowerSlowdown: 3
# ClassicProductionQueue@Ship:
# Type: Ship
# BuildSpeed: .4
# LowPowerSlowdown: 3
# ClassicProductionQueue@Plane:
# Type: Plane
# BuildSpeed: .4
# LowPowerSlowdown: 3
I added the following under World in System.yaml
ProductionQueueFromSelection:
ProductionTabsWidget: PRODUCTION_TABS
I added the following to FACT in structures.yaml
ProductionQueue@Building:
Type: Building
Group: Building
BuildSpeed: .4
LowPowerSlowdown: 3
QueuedAudio: Building
ReadyAudio: ConstructionComplete
ProductionQueue@Defense:
Type: Defense
Group: Defense
BuildSpeed: .4
LowPowerSlowdown: 3
QueuedAudio: Building
ReadyAudio: ConstructionComplete
assemblies looks as such in mod.yaml
Assemblies:
mods/rarw/OpenRA.Mods.RA.dll
mods/rarw/OpenRA.Mods.Cnc.dll
and I also copied the OpenRA.Mods.Cnc.dll to the directory...
what else needs to be done? it still crashes as soon as I deploy the mcv.
This will only work if you copy the sidebar chrome definitions from C&C (mods/cnc/ingame.yaml). If you remove this it should work.salvakiya wrote: ↑I added the following under World in System.yaml
ProductionQueueFromSelection:
ProductionTabsWidget: PRODUCTION_TABS
Your first step after a crash should be to check <OpenRA support dir>/Logs/exception.log. This file will tell you the cause of the crash, and is usually self explanatory enough for you to easily fix it.
it does not seem to be working still... it does not crash anymore... however whenever i build a couple barracks and a war factory I cannot seem to get the aircraft menu to come up after building an airfield.Sleipnir wrote: ↑This will only work if you copy the sidebar chrome definitions from C&C (mods/cnc/ingame.yaml). If you remove this it should work.salvakiya wrote: ↑I added the following under World in System.yaml
ProductionQueueFromSelection:
ProductionTabsWidget: PRODUCTION_TABS
Your first step after a crash should be to check <OpenRA support dir>/Logs/exception.log. This file will tell you the cause of the crash, and is usually self explanatory enough for you to easily fix it.
this i added to the airfield structure
ProductionQueue:
Type: Aircraft
Group: Aircraft
BuildSpeed: .4
LowPowerSlowdown: 3
ReadyAudio: