Army Lists and Min Max

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

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

Army Lists and Min Max

Post by Brummbar44 » Thu Jul 21, 2016 1:58 pm

I've been working with the Army Lists for a MP Skirmish campaign and something just doesn't add up.

The Min and Max forces seem to scale depending on the size of the forces but I can't figure out how they scale.

Wouldn't the MIN forces show up regardless of the size? I would think these would be the minimum forces no matter the battle size.

If not, how can I accurately assess what will show up based on battle size?

Petcat
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 148
Joined: Sat Nov 06, 2010 10:10 pm
Location: Ye Middle Lands, UK

Re: Army Lists and Min Max

Post by Petcat » Sun Aug 07, 2016 6:34 pm

The wiki sort of has the answer: https://sites.google.com/site/battleaca ... tomization

I think:

UNIT_0 German_Infantry -->corresponds just to the first number "0" being german infantry.
MIN_0 4 --> "0" is the unit, and the "4" is the amount of fixed units.
MAX_0 7 --> "7" is the amount of added purchasable units, so the amount of purchasable units is 3 due to "7"-"4"=3.

Hopefully this is helpful :)

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: Army Lists and Min Max

Post by Brummbar44 » Sun Aug 07, 2016 8:04 pm

Thanks for the link Petcat and the reply.

I understand how the min/max works, I just don't quite get how they scale up or down depending on the size of the battle.

I've done some experimenting though and am starting to figure out how best to set them...still haven't figured it all out yet though.

Petcat
Administrative Corporal - SdKfz 251/1
Administrative Corporal - SdKfz  251/1
Posts: 148
Joined: Sat Nov 06, 2010 10:10 pm
Location: Ye Middle Lands, UK

Re: Army Lists and Min Max

Post by Petcat » Sun Aug 07, 2016 9:42 pm

No problem, don't really know any more about skirmish.
Good luck with your multiplayer campaign league

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: Army Lists and Min Max

Post by Brummbar44 » Sun Aug 07, 2016 9:59 pm

Thanks again, the link is really helpful!

So far the league has been fun...looking forward to the next turn.

We're always recruiting ;)

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: Army Lists and Min Max

Post by Brummbar44 » Mon Aug 08, 2016 3:35 pm

In looking further into the documentation, I see there are some other variables that can be set (for example, by adding REPLACE the default forces no longer appear as an option...handy!).

However, I tried changing TURNLIMIT and it had no effect. I couldn't find an example of that variable so maybe I am doing it wrong - TURNLIMIT 12

I also saw in the All Features List a section on Skirmish variables.

//set the turn limit. Limited to 1000.
SkirmishSetTurnLimit(limit)

Would this control the turn limit? If so, where would these scripts go within the campaign to alter the Skirmishes?? (there are quite a few handy variables in there that could be set for historical purposes).

Is there any other documentation about these variables that could help me out?

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

Re: Army Lists and Min Max

Post by pipfromslitherine » Mon Aug 08, 2016 3:54 pm

The script commands only work when you are triggering a skirmish from script, so you would need a custom campaign UI to do so.

From the code it looks like the TURNLIMIT value just alters the default turn limit that you see when you choose a new campaign from the skirmish UI (and then only if it is already at a default value).

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: Army Lists and Min Max

Post by Brummbar44 » Mon Aug 08, 2016 4:32 pm

Thanks Pip,
pipfromslitherine wrote:The script commands only work when you are triggering a skirmish from script, so you would need a custom campaign UI to do so.
Is there any example of this you could point to? Would this be useable in MP?
pipfromslitherine wrote:From the code it looks like the TURNLIMIT value just alters the default turn limit that you see when you choose a new campaign from the skirmish UI (and then only if it is already at a default value).
I added TURNLIMIT 12 to my single player ArmyList.txt to see if it would change the default turn limit and it didn't change...am I doing it wrong? Can this also be applied to MP?

Thanks again, if I can get a handle on this, I'm hoping that we can make the Multiplayer League more interesting and historical.

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

Re: Army Lists and Min Max

Post by pipfromslitherine » Mon Aug 08, 2016 7:37 pm

It's not usable in MP unfortunately, unless RBS can prove me wrong as he actually uses the system most :)

Hmmm - the code seems to say it should do that, though it may be that the BA2 codebase is lagging the code I am reading (in fact, I would imagine it almost certainly is). I will check again to see if there are any obvious gotchas.

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: Army Lists and Min Max

Post by Brummbar44 » Mon Aug 08, 2016 9:06 pm

pipfromslitherine wrote:It's not usable in MP unfortunately, unless RBS can prove me wrong as he actually uses the system most :)
Fingers crossed! It would be awesome if there is some MP capability but I can see this might even have some interesting single player applications. Please do let us know.
pipfromslitherine wrote:Hmmm - the code seems to say it should do that, though it may be that the BA2 codebase is lagging the code I am reading (in fact, I would imagine it almost certainly is). I will check again to see if there are any obvious gotchas.
Thanks Pip. I was hoping it would work but didn't quite understand how (for example, I assume a single number, say 12, would be for the medium games and it would scale from there...or...does it need turns for each size...so that's where I wasn't sure).

Appreciate the follow up! Cheers!

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: Army Lists and Min Max

Post by Brummbar44 » Fri Aug 12, 2016 4:28 pm

Along the lines of the MP Skirmishes...

I've discovered the MAPGENERATE2.BSF file which looks like the key to Skirmishes.

I am trying to comprehend it...might take awhile. But it certainly looks promising if we can incorporate it into MP.

Is there a way to add other bonuses? I'd like to include some artillery options...possible?

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

Re: Army Lists and Min Max

Post by pipfromslitherine » Fri Aug 12, 2016 6:23 pm

Hmmm. Not sure - the skirmish UI is part of CORE which means it can't be overloaded, so it might be tricky. I can't recall if BA2 has the fix that allowed the UI to catch events via the FUNCTION UI_OBJ_HANDLE(data, event, id) or not, as that would be the only way to try and hook in additional UI.

One way might be to add more skirmish types, so you could have Attack (w art) for example and handle it in the MAPGENERATE2.BSF script that way.

It's a little involved, but potentially doable :)

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: Army Lists and Min Max

Post by Brummbar44 » Fri Aug 12, 2016 7:30 pm

Thanks Pip,

Doable maybe...but might take me awhile to figure it out. Can I assume that the other bonuses in that file can be examples of what you mean or would this require something new?

...and I can just include my revised MAPGENERATE2.BSF in the campaign folder I make to effect the changes correct?

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

Re: Army Lists and Min Max

Post by pipfromslitherine » Fri Aug 12, 2016 7:56 pm

Yes - you should be able to duplicate the file in your campaign folder and then make changes and it should in theory be used for your skirmishes (if you select your campaign via the UI).

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: Army Lists and Min Max

Post by Brummbar44 » Sat Aug 13, 2016 10:57 pm

Thanks Pip...I may brave that and see how it goes.

I do see Air bonuses in that file...but I've never seen them in a Skirmish. I don't understand how they are called in the script exactly...is it a points thing or just a random thing?

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

Re: Army Lists and Min Max

Post by pipfromslitherine » Sun Aug 14, 2016 8:47 pm

I didn't write the skirmish logic, so can't say! I do recall vaguely that they are random.

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: Army Lists and Min Max

Post by Brummbar44 » Sun Aug 14, 2016 9:35 pm

Thanks Pip,

Yes, they happen by random...and yes, it was relatively easy to add the side Artillery bonus (using the example of the Air bonus, I was able to call German Arty or Soviet Arty depending on the side).

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: Army Lists and Min Max

Post by Brummbar44 » Mon Aug 15, 2016 5:02 pm

Hi Pip,

I know this isn't really your department, but you've been very helpful and was wondering one more thing. I've figured out the Artillery bonus but realize it will have too much of an impact on Very Small or even Small maps. So I tried to include mapSize in calling the bonus but now it simply doesn't show up at all. I'm guessing the variable isn't coming through but don't know how to make it.

Here is what I have...

Code: Select all

// Artillery Bonuses based on side and mapSize
		if (mapSize >= 2)
		{
			if ((GetSideID(0) == 1 || GetSideID(1) == 1) && (GetSideID(0) == 7 || GetSideID(1) == 7))
			{
				// GERMAN
				side = -1 ;
				if (GetSideID(0) == 1)
				{
					side = 0 ;
				}
				if (GetSideID(1) == 1)
				{
					side = 1 ;
				}
				if (side >= 0)
				{
					AddBonus(side, "GERMANBATTERY") ;
				}
				// SOVIET
				side = -1 ;
				if (GetSideID(0) == 7)
				{
					side = 0 ;
				}
				if (GetSideID(1) == 7)
				{
					side = 1 ;
				}
				if (side >= 0)
				{
					AddBonus(side, "152MM") ;
				}
			}
		}
I'm probably overlooking the obvious...

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

Re: Army Lists and Min Max

Post by pipfromslitherine » Mon Aug 15, 2016 7:44 pm

Have you tried adding Log calls to track where it is failing/what the values are? It's the most likely way to spot where/if there is a logic bug. It doesn't look like mapSize is passed to the build function (so not sure where you were pulling it from) but it does get passed into the RandomMap_MapSize function, so you could always store it away from in there perhaps (or just look at the map width/height instead and work it out via that).

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: Army Lists and Min Max

Post by Brummbar44 » Mon Aug 15, 2016 7:59 pm

pipfromslitherine wrote:Have you tried adding Log calls to track where it is failing/what the values are? It's the most likely way to spot where/if there is a logic bug. It doesn't look like mapSize is passed to the build function (so not sure where you were pulling it from) but it does get passed into the RandomMap_MapSize function, so you could always store it away from in there perhaps (or just look at the map width/height instead and work it out via that).

Cheers

Pip
In English please :wink:

Not sure what all that means, where do I 'Log calls to track where it is failing/what the values are'...mapSize is in the function above in the same script...so I'm guessing it is local to it's own function (FUNCTION RandomMap_MapSize). Not sure how to make it global so I can use it in the Bonus function.

Post Reply

Return to “Battle Academy 2: Modders Corner”