Random map adding a new map type

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
Sabratha
SPM Contributor
SPM Contributor
Posts: 497
Joined: Thu Jan 05, 2012 2:39 am

Random map adding a new map type

Post by Sabratha » Tue Mar 17, 2015 3:24 pm

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?

pipfromslitherine
Site Admin
Site Admin
Posts: 8977
Joined: Wed Mar 23, 2005 10:35 pm

Re: Random map adding a new map type

Post by pipfromslitherine » Tue Mar 17, 2015 7:27 pm

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
follow me on Twitter here

Sabratha
SPM Contributor
SPM Contributor
Posts: 497
Joined: Thu Jan 05, 2012 2:39 am

Re: Random map adding a new map type

Post by Sabratha » Tue Mar 17, 2015 9:30 pm

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.

Sabratha
SPM Contributor
SPM Contributor
Posts: 497
Joined: Thu Jan 05, 2012 2:39 am

Re: Random map adding a new map type

Post by Sabratha » Mon Jul 13, 2015 3:29 pm

Is this functional now?

pipfromslitherine
Site Admin
Site Admin
Posts: 8977
Joined: Wed Mar 23, 2005 10:35 pm

Re: Random map adding a new map type

Post by pipfromslitherine » Mon Jul 13, 2015 7:34 pm

Should work in the latest version.

Cheers

Pip
follow me on Twitter here

Brummbar44
2nd Lieutenant - Panzer IVF/2
2nd Lieutenant - Panzer IVF/2
Posts: 689
Joined: Sun Oct 16, 2011 3:53 pm
Location: Canada
Contact:

Re: Random map adding a new map type

Post by Brummbar44 » Sun Oct 09, 2016 9:25 pm

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.

pipfromslitherine
Site Admin
Site Admin
Posts: 8977
Joined: Wed Mar 23, 2005 10:35 pm

Re: Random map adding a new map type

Post by pipfromslitherine » Tue Oct 11, 2016 4:22 pm

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
follow me on Twitter here

Brummbar44
2nd Lieutenant - Panzer IVF/2
2nd Lieutenant - Panzer IVF/2
Posts: 689
Joined: Sun Oct 16, 2011 3:53 pm
Location: Canada
Contact:

Re: Random map adding a new map type

Post by Brummbar44 » Tue Oct 11, 2016 4:25 pm

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"?

pipfromslitherine
Site Admin
Site Admin
Posts: 8977
Joined: Wed Mar 23, 2005 10:35 pm

Re: Random map adding a new map type

Post by pipfromslitherine » Tue Oct 11, 2016 9:38 pm

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
follow me on Twitter here

Brummbar44
2nd Lieutenant - Panzer IVF/2
2nd Lieutenant - Panzer IVF/2
Posts: 689
Joined: Sun Oct 16, 2011 3:53 pm
Location: Canada
Contact:

Re: Random map adding a new map type

Post by Brummbar44 » Wed Oct 12, 2016 3:12 pm

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?

pipfromslitherine
Site Admin
Site Admin
Posts: 8977
Joined: Wed Mar 23, 2005 10:35 pm

Re: Random map adding a new map type

Post by pipfromslitherine » Wed Oct 12, 2016 3:24 pm

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
follow me on Twitter here

Post Reply

Return to “Battle Academy 2: Modders Corner”