Random map adding a new map type
Moderators: Slitherine Core, BA Moderators
Random map adding a new map type
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?
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?
-
- Site Admin
- Posts: 9702
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Random map adding a new map type
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
Hope that makes sense! The next update should be very soon.
Cheers
Pip
follow me on Twitter here
Re: Random map adding a new map type
Glad to hear it, looking forward to the patch.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
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
Is this functional now?
-
- Site Admin
- Posts: 9702
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Random map adding a new map type
Should work in the latest version.
Cheers
Pip
Cheers
Pip
follow me on Twitter here
-
- 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
Can this be done for multiplayer? If so, how can we create new random map types?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.
Please advise, I think this would be a great addition to the League.
Thanks.
-
- Site Admin
- Posts: 9702
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Random map adding a new map type
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
Cheers
Pip
follow me on Twitter here
-
- 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
Thanks Pip,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
Please hold my hand! Not sure what any of that means. Where do I find the "custom random map generation script"?
-
- Site Admin
- Posts: 9702
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Random map adding a new map type
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
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
-
- 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
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?
I'll have a look (and no doubt more questions)...but to be clear, this is theoretically doable for multiplayer Skirmishes correct?
-
- Site Admin
- Posts: 9702
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Random map adding a new map type
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
Cheers
Pip
follow me on Twitter here