Game Development Community

Block a command....HOW?

by CIMO · in General Discussion · 09/07/2006 (8:47 am) · 8 replies

function GameConnection::initialControlSet(%this)
{
   echo ("*** Initial Control Object");

   // The first control object has been set by the server
   // and we are now ready to go.
   
   // first check if the editor is active
   if (!Editor::checkActiveLoadDone())
   {
      if (Canvas.getContent() != PlayGui.getId())
         Canvas.setContent(PlayGui);

	|||||||||||||||||| -> if ($SinglePlayerMap == False)
	                               Canvas.pushDialog(KitSelectDlg); <- ||||||||||||||||||
   }
}

A metod for stop this code? |||||||||||||||||| -> if ($SinglePlayerMap == False)
Canvas.pushDialog(KitSelectDlg); <- |||||||||||||||||| This code i would execute only ONE!!! please help

#1
09/07/2006 (10:57 am)
NEVER? please help me.... I try all!!
#2
09/07/2006 (11:02 am)
Have you tried just removing the command?
#3
09/07/2006 (12:22 pm)
No the command execute .... but only one----
A metod for this?
#4
09/07/2006 (12:33 pm)
What you're asking for does not make any sense. If you only want that cmd to occur on a multiplayer game, then flag "$SinglePlayerMap" accordingly.

If you really want to do it your way, then just increment a counter when that cmd is reached.

Rough example:
$count = 0;

function GameConnection::initialControlSet(%this)
{
   echo ("*** Initial Control Object");
   $count++;
   // The first control object has been set by the server
   // and we are now ready to go.

   // first check if the editor is active
   if (!Editor::checkActiveLoadDone())
   {
      if (Canvas.getContent() != PlayGui.getId())
         Canvas.setContent(PlayGui);

      if (!$SinglePlayerMap && $count <1)
         Canvas.pushDialog(KitSelectDlg);

   }
}

That is NOT the way I would do it for my game but each to their own.
#5
09/07/2006 (12:53 pm)
OK =D i counter =D YES but i move a counter in this mode
$count = 0;

function GameConnection::initialControlSet(%this)
{
   echo ("*** Initial Control Object");
   
   // The first control object has been set by the server
   // and we are now ready to go.
   // first check if the editor is active
   if (!Editor::checkActiveLoadDone())
   {
          if (Canvas.getContent() != PlayGui.getId())
                 Canvas.setContent(PlayGui);
          if (!$SinglePlayerMap && $count <1)
                 Canvas.pushDialog(KitSelectDlg);
          $count++;
   }
}

Now this GUI -> "KitSelectDlg" execute just ONE time
#6
09/07/2006 (12:55 pm)
Beautiful. So it's all working fine now hey, what a relief ;)
#7
09/07/2006 (12:56 pm)
My name better appear in the credits of your game Cimo =)
#8
09/07/2006 (1:00 pm)
YES YES REALLY =) SECURE!!!! =) you are my master...
I have a messenger and i wuold talk with you if possible "simone_dagostino@hotmail.com" if you want talk with me =) and thanks of new