Page 1 of 1

Random map adding a new map type

Posted: Tue Mar 17, 2015 3:24 pm
by Sabratha
I designed a pretty simple new map type - south russian steppe (much tall grass, no tres). I tested it by replacing the MapGenerateWild.BSF with my own steppe modified version and it works fine.

I just wonder is it possible to add it as a 4th new map type to be recognized by skirmish and editor? Which files should be modified?

Re: Random map adding a new map type

Posted: Tue Mar 17, 2015 7:27 pm
by pipfromslitherine
The next update moves some of the files around so it is possible to make custom campaigns which have custom map generation scripts (as can already be done with Pike&Shot). Adding a new type is then done by having appropriate IDS_SKIRMISH_MAP_TYPE_<number> entries in your strings file. The numbering starts at zero and the type value for the scripts matches the index of the selected type.

Hope that makes sense! The next update should be very soon.

Cheers

Pip

Re: Random map adding a new map type

Posted: Tue Mar 17, 2015 9:30 pm
by Sabratha
pipfromslitherine wrote:The next update moves some of the files around so it is possible to make custom campaigns which have custom map generation scripts (as can already be done with Pike&Shot). Adding a new type is then done by having appropriate IDS_SKIRMISH_MAP_TYPE_<number> entries in your strings file. The numbering starts at zero and the type value for the scripts matches the index of the selected type.

Hope that makes sense! The next update should be very soon.

Cheers

Pip
Glad to hear it, looking forward to the patch.

That is a good side of BA and P&S using the same engine, modding experience of one game can be used for the other.

Re: Random map adding a new map type

Posted: Mon Jul 13, 2015 3:29 pm
by Sabratha
Is this functional now?

Re: Random map adding a new map type

Posted: Mon Jul 13, 2015 7:34 pm
by pipfromslitherine
Should work in the latest version.

Cheers

Pip

Re: Random map adding a new map type

Posted: Sun Oct 09, 2016 9:25 pm
by Brummbar44
pipfromslitherine wrote:Adding a new type is then done by having appropriate IDS_SKIRMISH_MAP_TYPE_<number> entries in your strings file. The numbering starts at zero and the type value for the scripts matches the index of the selected type.
Can this be done for multiplayer? If so, how can we create new random map types?

Please advise, I think this would be a great addition to the League.

Thanks.

Re: Random map adding a new map type

Posted: Tue Oct 11, 2016 4:22 pm
by pipfromslitherine
The new map type needs to be handled in the custom random map generation script, the UI allows you to choose a new type if the string exists to describe it.

Cheers

Pip

Re: Random map adding a new map type

Posted: Tue Oct 11, 2016 4:25 pm
by Brummbar44
pipfromslitherine wrote:The new map type needs to be handled in the custom random map generation script, the UI allows you to choose a new type if the string exists to describe it.

Cheers

Pip
Thanks Pip,

Please hold my hand! Not sure what any of that means. Where do I find the "custom random map generation script"?

Re: Random map adding a new map type

Posted: Tue Oct 11, 2016 9:38 pm
by pipfromslitherine
I'll be honest, it is quite complex. Basically (and bear in mind I have never done this, RBS is the real expert) you need to:

1 - add the string (as above IDS_SKIRMISH_MAP_TYPE) this will cause the UI to show it as a type you can choose.
2 - copy DATA/BATTLE/SCRIPTS/MAPGENERATE2.BSF into the DATA/BATTLE/SCRIPTS folder in your custom campaign.
3 - add script to your new file which utilises your new type (in RandomMap_Build you will see the 3 main checks, one for each of the existing types, which calls out to the different map type scripts).

You can of course copy one of these type scripts and use it as a starting point for your own script. Note that (IIRC) you can see/test your new scripts in the editor if you select the appropriate campaign to edit.

Hope that helps at least let you have a look at the task!

Cheers

Pip

Re: Random map adding a new map type

Posted: Wed Oct 12, 2016 3:12 pm
by Brummbar44
Wow! Thanks Pip.

I'll have a look (and no doubt more questions)...but to be clear, this is theoretically doable for multiplayer Skirmishes correct?

Re: Random map adding a new map type

Posted: Wed Oct 12, 2016 3:24 pm
by pipfromslitherine
Yes - although the BA2 codebase is significantly behind the P&S etc one and so we could well run into a bug which stops us dead, but I guess try something simple first to just see if the framework works correctly.

Cheers

Pip