Manipulating Level_Up to suppress promotion stars

Modders can post their questions on scripting and more.

Moderators: Slitherine Core, BA Moderators

Post Reply
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Manipulating Level_Up to suppress promotion stars

Post by GottaLove88s »

Pip/Iain,

Where is the code for LEVEL_UP in core BA?

I can find the Drill Sgt code, and even a Level Up animation, but I can't find where the animation and caption are executed. I want to disable the promotion star and "promoted" caption.

Thanks!
GL88
Last edited by GottaLove88s on Wed Sep 12, 2012 10:57 am, edited 1 time in total.
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
rf900
Staff Sergeant - Kavallerie
Staff Sergeant - Kavallerie
Posts: 339
Joined: Fri May 04, 2012 6:59 am

Re: Where is the Level_Up code?

Post by rf900 »

It seems to be in the MoraleTools.BSF file

You can remove the text line (AddVizUnitText(me, "IDS_UNIT_LEVELUP", "ffffff") ;) and the animation effect one (AddVizSpotAnim(effectX, effectY, "LEVEL_UP", -1, 100) ;) that may do it.

Code: Select all

		// level up
		if ( newLevel > level )
		{
			SetUnitStatus ( me, newLevel ) ;
			morale = GetAttrib (me, "Morale") ;
			morale += 25 ;
			SetAttrib (me, "Morale", morale) ;			
			AddVizUnitText(me, "IDS_UNIT_LEVELUP", "ffffff") ;
			
			effectX = GetUnitX (me) ;
			effectX *= 100 ;
			effectX += 50 ;
			effectY = GetUnitY (me) ;
			effectY *= 100 ;
			effectY += 50 ;
			AddVizSpotAnim(effectX, effectY, "LEVEL_UP", -1, 100) ;	
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Where is the Level_Up code?

Post by GottaLove88s »

Gracias RF. That's genius!

I'll copy MoraleTools.BSF over into Data\Scripts for my Campaign.
Then I'll just make the two AddViz functions remarks...
// AddVizUnitText(me, "IDS_UNIT_LEVELUP", "ffffff") ;
// AddVizSpotAnim(effectX, effectY, "LEVEL_UP", -1, 100) ;

No more promotion stars showing the enemy where I'm hiding... Sorted.
:-)
Last edited by GottaLove88s on Wed Sep 12, 2012 2:00 pm, edited 1 time in total.
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Where is the Level_Up code?

Post by GottaLove88s »

Link to a simple Normandy forest MP scenario if you'd like to test:

1. Wider deployment zone for 1st player (assumed defender in an attack-defence game)
2. Smoking mortars
3. Swap places between adjacent units
4. Disabled promotion stars (so you don't accidentally reveal your position)
5. Disabled "loaded" and "unloaded" captions (ditto)

viewtopic.php?f=87&t=36734&start=240#p351624

NB. With much thanks to Granfali, rf900, Enric & Merr... Cheers guys! :D
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Manipulating Level_Up to suppress promotion stars

Post by GottaLove88s »

Saludos RF, your point that copying MoraleTools.BSF into local campaign folders might mean that they need to be refreshed every time BA's core MoraleTools gets updated, made me think of an alternative...

Is there an operator that returns whether a game is single or multiplayer?

Promotion stars are nice to see in single player games, but they're a problem for MP because both sides see them, so it gives away the positions of hidden units. It looks like showing promotion stars to only the promoted unit's player but excluding them from the other player's replay is difficult to do.

So maybe we could modify MoraleTools to execute those AdViz commands selectively, only IF the game is single-player. It's not perfect but it's a global fix that would do until Slith can come up with something more cunning...
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
pipfromslitherine
Site Admin
Site Admin
Posts: 9937
Joined: Wed Mar 23, 2005 10:35 pm

Re: Manipulating Level_Up to suppress promotion stars

Post by pipfromslitherine »

There isn't a function to tell you whether you are in a MP game, and showing the animation just to the one side can lead to (even more...) sync errors, which is why we haven't done a simple fix for it. It's on my list, but I will confess it's fairly low priority.

Cheers

Pip
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Manipulating Level_Up to suppress promotion stars

Post by GottaLove88s »

Thanks Pip, Is there a function by proxy? Maybe some AI variables that would only be active if there was an AI player doing something? GL88
SCENARIO LINKS
Seelow'45 -> www.slitherine.com/forum/viewtopic.php?f=313&t=55132
Normandy'44 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42094
Dieppe'42 -> www.slitherine.com/forum/viewtopic.php?f=87&t=42347
Post Reply

Return to “Battle Academy : Modders Corner ”