Page 1 of 1

How to delay Artillery & Typhoon?

Posted: Sun Sep 16, 2012 8:29 pm
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) ;
	}
}

Re: How to delay Artillery & Typhoon?

Posted: Sun Sep 16, 2012 9:34 pm
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

Re: How to delay Artillery & Typhoon?

Posted: Mon Sep 17, 2012 8:44 am
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) ;
   }

Re: How to delay Artillery & Typhoon?

Posted: Mon Sep 17, 2012 3:06 pm
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

Re: How to delay Artillery & Typhoon?

Posted: Mon Sep 17, 2012 3:53 pm
by GottaLove88s
Foolish question, but how do I check the return values? :(

Re: How to delay Artillery & Typhoon?

Posted: Mon Sep 17, 2012 4:27 pm
by pipfromslitherine
if (SetScriptGlobal(..... ) == 1 )
{
Log("Found the global") ;
}
else
{
Log("Could not find global...") ;
}