Page 1 of 1
Manipulating Level_Up to suppress promotion stars
Posted: Wed Sep 12, 2012 7:49 am
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
Re: Where is the Level_Up code?
Posted: Wed Sep 12, 2012 8:42 am
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) ;
Re: Where is the Level_Up code?
Posted: Wed Sep 12, 2012 8:50 am
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.

Re: Where is the Level_Up code?
Posted: Wed Sep 12, 2012 10:56 am
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!

Re: Manipulating Level_Up to suppress promotion stars
Posted: Wed Sep 12, 2012 1:59 pm
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...
Re: Manipulating Level_Up to suppress promotion stars
Posted: Wed Sep 12, 2012 2:56 pm
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
Re: Manipulating Level_Up to suppress promotion stars
Posted: Wed Sep 12, 2012 4:11 pm
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