How to delay Artillery & Typhoon?

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

How to delay Artillery & Typhoon?

Post by GottaLove88s »

Pip, I'm trying to delay Typhoon, Naval artillery, 25Pdr and German artillery, for the first two turns of an MP game (Allies deploy in their first turn). I've dropped the code below into my scenario.BSF but it's not changing anything.

Any ideas what I'm missing? Sorry... :oops:

Code: Select all

FUNCTION StartTurn(side)
{

	// Deactivate bombardments for the first two turns

	if (GetTurn() == 0) // Allied
	{
		SetScriptGlobal("Typhoon", "gCounter", 2) ;
		SetScriptGlobal("Naval", "gCounter", 2) ;
		SetScriptGlobal("25Pdr", "gCounter", 2) ;
	}

	if (GetTurn() == 1) // German
	{
		SetScriptGlobal("GermanArt", "gCounter", 2) ;
	}
}
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: How to delay Artillery & Typhoon?

Post by pipfromslitherine »

From looking at the script, seems the counter counts up from zero, so setting it to zero should start it off with it's normal delay before it becomes available.

Cheers

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

Re: How to delay Artillery & Typhoon?

Post by GottaLove88s »

pipfromslitherine wrote:From looking at the script, seems the counter counts up from zero, so setting it to zero should start it off with it's normal delay before it becomes available.

Cheers

Pip
Thanks Pip,

Updated code to below, reseting to 0 instead of 2, but when I run the MP, it still stays 25 Pdr and German Art are "Ready to use" and lets me order them... In an MP game with Allied deployment, is the Allied first actual move still turn 0? And the German first move still turn 1?

Code: Select all

// Deactivate bombardments for the first two turns

   if (GetTurn() == 0) // Allied
   {
      SetScriptGlobal("Typhoon", "gCounter", 0) ;
      SetScriptGlobal("Naval", "gCounter", 0) ;
      SetScriptGlobal("25Pdr", "gCounter", 0) ;
   }

   if (GetTurn() == 1) // German
   {
      SetScriptGlobal("GermanArt", "gCounter", 0) ;
   }
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: How to delay Artillery & Typhoon?

Post by pipfromslitherine »

No - the turns are still as they are in single player. Looking at the code, it should work from what I can see. The bonus calls are done before the StartTurn call, so it should override it.

Try checking the return values to make sure the script/global is being found properly.

Cheers

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

Re: How to delay Artillery & Typhoon?

Post by GottaLove88s »

Foolish question, but how do I check the return values? :(
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: How to delay Artillery & Typhoon?

Post by pipfromslitherine »

if (SetScriptGlobal(..... ) == 1 )
{
Log("Found the global") ;
}
else
{
Log("Could not find global...") ;
}
Post Reply

Return to “Battle Academy : Modders Corner ”