More colors for campaign mode?

Get some help with creating maps or modding.
Need a map editor or other tools, look here!
Post Reply
Kaillie
New user
Posts: 5
Joined: 15 Oct 2019, 05:40

More colors for campaign mode?

Post by Kaillie »

Is it possible to swap player/AI colors in campaign mode? Would love to play in black (which might need to switch nexus color), white, or other colors not available right now.
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

Re: More colors for campaign mode?

Post by Berserk Cyborg »

Yep. By using changePlayerColour() you can change the color of a player. You could mod the base rules.js starting here and that will forcibly set different colors for the player/AI.

Campaign player numbers are like so:

Code: Select all

0 - Human player
1 - New Paradigm
2 - The Collective
3 - Nexus
As for the color values, well, you'll have to experiment with values 0-10. I'm guessing values 1-3 probably correlate to yellow/grey/black.
Kaillie
New user
Posts: 5
Joined: 15 Oct 2019, 05:40

Re: More colors for campaign mode?

Post by Kaillie »

Er I'm kinda lost, not a programmer here. Also do you mean "changePlayerColour(player, colour)" or "setPlayerColour", cause on the wiki it says the former. Do I just add on line 242 before "setCampaignNumber(1);", something like "changePlayerColour(0, 3)"?
User avatar
Berserk Cyborg
Code contributor
Code contributor
Posts: 938
Joined: 26 Sep 2016, 19:56

Re: More colors for campaign mode?

Post by Berserk Cyborg »

Kaillie wrote: 09 Nov 2019, 07:59 Er I'm kinda lost, not a programmer here. Also do you mean "changePlayerColour(player, colour)" or "setPlayerColour", cause on the wiki it says the former. Do I just add on line 242 before "setCampaignNumber(1);", something like "changePlayerColour(0, 3)"?
:lol2: It's changePlayerColour(). Guess I wasn't paying that much attention to its name...

Adding changePlayerColour(0, 3) there will work, at least for Alpha campaign. If you want to only use one color throughout the entire campaign then you can put it outside of those if statements.

Here is a mod for version 3.3.0. It uses black for the player by default.

campaignColorMod.wz
(2.99 KiB) Downloaded 149 times
Post Reply