Artillery bonus: How to restrict the target zone?

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

Artillery bonus: How to restrict the target zone?

Post 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
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: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Artillery bonus: How to restrict the target zone?

Post 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
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Artillery bonus: How to restrict the target zone?

Post 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)
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: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Artillery bonus: How to restrict the target zone?

Post by pipfromslitherine »

Yes. You can return -1 or -2. IIRC -1 means greyed out, -2 means don't show it at all.

Cheers

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

Re: Artillery bonus: How to restrict the target zone?

Post 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?
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: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Artillery bonus: How to restrict the target zone?

Post by pipfromslitherine »

pretty much right - it would probably best be

{
int ret ;

ret = -1 ;

if(tiley < 66)
{

}
follow me on Twitter here
pipfromslitherine
Site Admin
Site Admin
Posts: 9863
Joined: Wed Mar 23, 2005 10:35 pm

Re: Artillery bonus: How to restrict the target zone?

Post 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
follow me on Twitter here
GottaLove88s
Lieutenant-General - Do 217E
Lieutenant-General - Do 217E
Posts: 3151
Joined: Fri Apr 06, 2012 6:18 pm
Location: Palau

Re: Artillery bonus: How to restrict the target zone?

Post 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...
:D :D :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
Post Reply

Return to “Battle Academy 2: Modders Corner”