Page 1 of 1

Faction-specific Starting Units

Posted: Sun Jun 17, 2012 3:19 am
by Leonan
I'm attempting to make a mod with faction-specific starting units but can't seem to figure out how. I know the code supports it as I've read through SpawnMP units, and I'm pretty sure it's something simple in system.yaml, but as of yet I haven't been able to figure it out. If anyone knows how to properly use this feature, I'd appreciate it.

Posted: Sun Jun 17, 2012 9:11 am
by Matt
Have a look at my Dune 2000 mod and https://github.com/Mailaender/OpenRA/bl ... .yaml#L198

Posted: Sun Jun 17, 2012 9:52 pm
by Leonan
Thanks a bunch. I actually had the format correct, which your file confirmed, but later found out the problem was in the shellmap (I'm currently using the default RA shellmap). The engine was crashing on startup saying that all my SpawnMPUnits blocks were missing their trait dependency of MPStartLocations. When I edited the shellmap's map.yaml to remove the -MPStartLocations and -SpawnMPUnits lines, it loaded properly.

Posted: Sun Jun 17, 2012 10:24 pm
by chrisf
Hang on -- shellmap setup is leaking into your actual map?

Posted: Mon Jun 18, 2012 5:22 pm
by Leonan
No, the game crashes seemingly because it is running normal map startup on the shellmap. I don't know if it's not honoring the shellmap's -SpawnMPUnits or if having multiple SpawnMPUnits blocks in system.yaml defeats the shellmap's own script. Either way the crash stopped occuring after I deleted the shellmap's removal of SpawnMPUnits and MPStartPositions (or whatever it's called). It's also worth noting that I'm using the newest unstable build and the shellmap I'm using is perhaps six months old - I've been updating my mod to newer versions of OpenRA along the way and have never replaced it. If the shellmap or the map yaml standards have changed since then, the problem could be a matter of me needing to update the file I'm using.

Posted: Mon Jun 18, 2012 6:31 pm
by BaronOfStuff
Wait... does this mean that in theory it's possible to set the game up so that players start with more than just the MCV, like was possible in RA95? Or do we only get one starting unit?

Or (most likely), am I missing something here?

Posted: Mon Jun 18, 2012 6:56 pm
by Matt
InitialUnit (singular) is just a string (not an array) so I guess there can only be one unit atm. You can make a map with not just the player spawn but also additional starting units (for scouting?) however.

Posted: Mon Jun 18, 2012 7:05 pm
by BaronOfStuff
Balls!

Oh well. I just wanted to know if it was possible, as I'd often start with extra units in RA95 skirmishes. Would usually make uncomfortably close spawn points interesting.

Posted: Wed Mar 20, 2013 8:51 pm
by Matt