Page 1 of 1
Artillery bonus: How to restrict the target zone?
Posted: Mon Jan 05, 2015 3:19 pm
by GottaLove88s
Does anyone know how to restrict the target area for a German Nebelwerfer bonus?
It's for the Seelow Heights scenario ->
viewtopic.php?f=313&t=55132
Right now, it's too easy for a clever German general to blast the Kustrin-Oder bridges, which are fragile and offer precious little cover...
Thanks!
GL88
Re: Artillery bonus: How to restrict the target zone?
Posted: Mon Jan 05, 2015 4:31 pm
by pipfromslitherine
You would need to tweak the bonus script for it. You can do this by copying the script from CORE/BONUS into a local BONUS folder in your campaign. Then you can edit as you desire.
Cheers
Pip
Re: Artillery bonus: How to restrict the target zone?
Posted: Mon Jan 05, 2015 9:31 pm
by GottaLove88s
pipfromslitherine wrote:You would need to tweak the bonus script for it. You can do this by copying the script from CORE/BONUS into a local BONUS folder in your campaign. Then you can edit as you desire.
Cheers
Pip
Thanks Pip!
Looking in NEBELBATTERY.BSF, I guess the best place to put this is with...
Code: Select all
// tell us whether the drop menu item should display/be disabled. Anything >= 0 means show as normal
function CHECK_BONUS_NEBEL_BATTERY(tilex,tiley,unit)
{
return BonusCheck(tilex, tiley, unit, "Nebel") ;
}
So do I just need to tell this function to return -1 if tiley > 65 ?
(I want to prevent the Nebelbattery from targeting anything west of the y=65 line on my map)
Re: Artillery bonus: How to restrict the target zone?
Posted: Mon Jan 05, 2015 9:49 pm
by pipfromslitherine
Yes. You can return -1 or -2. IIRC -1 means greyed out, -2 means don't show it at all.
Cheers
Pip
Re: Artillery bonus: How to restrict the target zone?
Posted: Mon Jan 05, 2015 11:07 pm
by GottaLove88s
Thanks Pip,
Cool... I'll try this...
Code: Select all
// tell us whether the drop menu item should display/be disabled. Anything >= 0 means show as normal
function CHECK_BONUS_NEBEL_BATTERY(tilex,tiley,unit)
{
ret = -1 // Grey out the Nebelwerfer by default
if (tiley) < 66 // Check if the cursor location is in an area where the Nebelwerfer is not restricted
{
return BonusCheck(tilex, tiley, unit, "Nebel") ; // if it's not restricted, let the targeting icon show
}
}
Does that sort of make sense? Or am I oversimplifying?
Re: Artillery bonus: How to restrict the target zone?
Posted: Tue Jan 06, 2015 2:37 am
by pipfromslitherine
pretty much right - it would probably best be
{
int ret ;
ret = -1 ;
if(tiley < 66)
{
}
Re: Artillery bonus: How to restrict the target zone?
Posted: Tue Jan 06, 2015 2:38 am
by pipfromslitherine
pretty much right - it would probably best be
{
int ret ;
ret = -1 ;
if(tiley < 66)
{
ret = BonusCheck(tilex, tiley, unit, "Nebel") ;
}
return ret ;
}
But I am sure you would have worked out the syntax
Cheers
Pip
Re: Artillery bonus: How to restrict the target zone?
Posted: Tue Jan 06, 2015 9:03 am
by GottaLove88s
pipfromslitherine wrote:pretty much right - it would probably best be
{
int ret ;
ret = -1 ;
if(tiley < 66)
{
ret = BonusCheck(tilex, tiley, unit, "Nebel") ;
}
return ret ;
}
But I am sure you would have worked out the syntax
Cheers
Pip
Awww, thanks Pip. That works great.
You're the best! Even better than Santa Claus...
