Author Topic: ERROR: function declaration failed: MainMenuGui::onWake  (Read 1160 times)

ERROR: function declaration failed: MainMenuGui::onWake

comes up when I try to run this script.


package wake
{
function MainMenuGui::onWake(%this)
{
 
  echo("test");

}
};
Activatepackage(Wake);

anything wrong?

Not allowed to overwrite some functions
Even if you parent, it's still considering overwriting.

Hmm... any other way to do it? How does RTB add buttons onto main menu then? I tried looking but couldnt find it.

Just add the buttons to the GUI by doing MainMenuGui.add(
new blablabla(possiblename)
{
stuff
});

Just add the buttons to the GUI by doing MainMenuGui.add(
);
Personally I hate that

%strato = new blablabla(possiblename)
{
    stuff
};
MainMenuGui.add(%strato);

There's barely any difference.

There's barely any difference.
Besides that fact that it's hard for format an object creation inside a function parameter.

?

MainMenuGui.add(
   new blablabla(possiblename)
   {
      stuff = morestuff;
   }
);

?

MainMenuGui.add(
   new blablabla(possiblename)
   {
      stuff = morestuff;
   }
);
Nah, I hate that.

function MainMenuGui::onWake(%this)
{
   // Play music...
  echo("test");
   $musicHandle = alxPlay(Music_MainMenu);
}

Also, what other things we cant overwrite?
« Last Edit: October 12, 2009, 12:08:21 AM by Stratofortress »

::getPlayerName
GameConnection::onConnect
GameConnection::spawnPlayer
::setShapeName

(::function means any class)
Not sure on which others.