Editing the Chrome?

How does one do this?

Information and discussion for custom maps and mods.
Post Reply
salvakiya
Posts: 36
Joined: Fri Jul 27, 2012 5:26 am

Editing the Chrome?

Post by salvakiya »

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.

knivesron
Posts: 93
Joined: Wed Aug 10, 2011 5:05 am

Post by knivesron »

some where on the forum they say how to enable multiple build queues. i cant remember for the life of me where. from memory its just a simple true false argument i thinks.

try search the forum

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

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.

salvakiya
Posts: 36
Joined: Fri Jul 27, 2012 5:26 am

Post by salvakiya »

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.

User avatar
Sleipnir
Posts: 878
Joined: Wed Apr 10, 2002 11:52 pm
Contact:

Post by Sleipnir »

salvakiya wrote: I added the following under World in System.yaml

ProductionQueueFromSelection:
ProductionTabsWidget: PRODUCTION_TABS
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.

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.

salvakiya
Posts: 36
Joined: Fri Jul 27, 2012 5:26 am

Post by salvakiya »

Sleipnir wrote:
salvakiya wrote: I added the following under World in System.yaml

ProductionQueueFromSelection:
ProductionTabsWidget: PRODUCTION_TABS
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.

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.

this i added to the airfield structure

ProductionQueue:
Type: Aircraft
Group: Aircraft
BuildSpeed: .4
LowPowerSlowdown: 3
ReadyAudio:

Post Reply