Author Topic: Notification Popup  (Read 3173 times)

I want write this script for player's death at RTB message Popup.

Quote

exec("./NotificationPopUp.gui");

package NotificationPopUp
{
   function RTBCC_Session::receive(%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10)
   {
            parent::receive(%this,%message);
         if(RTBCO_getPref("CC::Message::Note"))
         {


        %detagged = detag(%tag);
      %det = detag(%msg);
      if(%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled")
      {
         if($DeathCounts == 5)
         {
            for(%x=1;%x<=4;%x++)
               $Death[%x] = $Death[%x+1];
            $Death5 = %det;
         }
         else
            $Death[$DeathCounts++] = %det;
         %deathMessage = $Death1;
         for(%x=2;%x<=$DeathCounts;%x++)
            %deathMessage = %deathMessage NL $Death[%x];
         newDeathText.setText(%deathMessage);
         return;
      }
      else
         RTBCC_NotificationManager.pus h(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled","user",%user.id@"_msg",-1);
   }


};
activatePackage(NotificationPopUp);

I checked console log,
Quote
Client checking Add-On: System_ReturnToBlockland
Loading Add-On: System_ReturnToBlockland (CRC:1727226874)
Executing Add-Ons/System_ReturnToBlockland/client.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/options.cs.
Executing config/client/rtb/prefs.cs.
Executing config/server/ADD_ON_LIST.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/profiles/generic.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/profiles/connectClient.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/profiles/infoTips.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/profiles/modManager.cs.
Executing Add-Ons/System_ReturnToBlockland/support/fileCache.cs.
Executing Add-Ons/System_ReturnToBlockland/support/functions.cs.
Executing Add-Ons/System_ReturnToBlockland/support/gui.cs.
Executing Add-Ons/System_ReturnToBlockland/support/networking.cs.
Executing Add-Ons/System_ReturnToBlockland/support/overlay.cs.
Executing Add-Ons/System_ReturnToBlockland/support/xmlParser.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/overlay.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/mods/addOns.cs.

Add-Ons/System_ReturnToBlockland/interface/mods/addOns.cs (25): Unable to find object: 'AddOnsGui' attempting to call function 'delete'
BackTrace: ->onStart->serverPart2->initClient->loadClientAddOns->interfaceFunction


Executing Add-Ons/System_ReturnToBlockland/interface/addOns.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/mods/joinServer.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/joinServer.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/mods/loading.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/mods/mainMenu.cs.
Executing Add-Ons/System_ReturnToBlockland/interface/mods/customGame.cs.
Missing file: Add-Ons/System_ReturnToBlockland/interface/colorManager.gui!
Executing Add-Ons/System_ReturnToBlockland/interface/connectClient.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/manual.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/modManager.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/modUpdates.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/options.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/serverControl.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/serverInformation.gui.
Executing Add-Ons/System_ReturnToBlockland/interface/updater.gui.
Executing Add-Ons/System_ReturnToBlockland/modules/client/authentication.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/colorManager.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/connectClient.cs.
Loading object base/data/shapes/player/m.dts
Executing config/client/rtb/rooms.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/guiControl.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/guiTransfer.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/infoTips.cs.
Executing Add-Ons/System_ReturnToBlockland/hooks/infoTips.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/manual.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/modManager.cs.
Activating package: RTBC_ModManager
    Add-On has been renamed from "System_NotificationPopUp" to "client_notificationpopup" - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    Add-On is in the list of known bad add-on names - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    No description.txt for this add-on - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
Executing Add-Ons/System_ReturnToBlockland/modules/client/serverControl.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/serverInformation.cs.
Executing Add-Ons/System_ReturnToBlockland/modules/client/updater.cs.
Activating package: RTB_Modules_Client_Authentica tion
Activating package: RTB_Modules_Client_ColorManag er
Activating package: RTB_Modules_Client_ConnectCli ent
Activating package: RTB_Modules_Client_InfoTips
Activating package: RTB_Modules_Client_GuiTransfe r
Activating package: RTB_Modules_Client_ServerCont rol
Activating package: RTB_Modules_Client_ServerInfo rmation
Activating package: RTB_Client

EDIT:
I had rename zip folder and checkname.txt, But why it keep say will not excute.

Quote
Activating package: RTBC_ModManager
    Add-On has been renamed from "System_NotificationPopUp" to "client_deathpopup" - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    Add-On is in the list of known bad add-on names - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    No description.txt for this add-on - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
    Add-On is in the list of known bad add-on CRCs - will not execute
« Last Edit: September 08, 2013, 09:59:46 AM by Furling² »

Okay I see you referenced my add on but this is seriously incorrect.

For starters modify namecheck.txt and change it to  client_deathpopup.

Also don't execute any guis because they probably don't exist.
RTBCC_Session::receive is not what is called when a death happens. It's evident that you meant to use clientCmdServerMessage. ::receive is RTB's function for receiving data from the TCP object and not when somebody dies.


The arguments you used for NotificationManager.push are incorrect, you should look at System_ReturnToBlockland/modules/client/connectClient.cs and search for ".push"


You  ripped code from advanced chat but it's completely messed up because it checks if it's a kill and separates it from the chat and if not it pushes an incorrect notification.
« Last Edit: September 08, 2013, 01:55:59 PM by {Pacnet2013} »

Use something like clientCmdServerMessage.

He should use the HandleClientDeath function.

He should use the HandleClientDeath function.

Due to the arguments he's using and the code he's referencing, the clientCmdServerMessage command is what he meant to use but messed up - HandleClientDeath would be a better option, though.

thank you, I got this little fix it up.
Fix script:
Quote
package DeathPopUp
{
   function HandleClientDeath::receive(%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10)
   {
            parent::receive(%this,%message);
         if(RTBCO_getPref("CC::Message::Note"))
         {


        %detagged = detag(%tag);
      %det = detag(%msg);
      if(%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled")
      {
         if($DeathCounts == 5)
         {
            for(%x=1;%x<=4;%x++)
               $Death[%x] = $Death[%x+1];
            $Death5 = %det;
         }
         else
            $Death[$DeathCounts++] = %det;
         %deathMessage = $Death1;
         for(%x=2;%x<=$DeathCounts;%x++)
            %deathMessage = %deathMessage NL $Death[%x];
         newDeathText.setText(%deathMessage);
         return;
      }
      else
         RTBCC_NotificationManager.pus h(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled","user",%user.id@"_msg",-1);
   }


}
activatePackage(DeathPopUp);




syntax error:

Quote
Client checking Add-On: Client_DeathPopUp
Loading Add-On: Client_DeathPopUp (CRC:319311332)
Add-Ons/Client_DeathPopUp/client.cs Line: 37 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^^^newDeathText.setText(%deathMessage);

^^^return;

^^}

^^else

^^^RTBCC_NotificationManager.push(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled","user",%user.id@"_msg",-1);

^}





}

activatePackage(##D##eathPopUp);


>>> Error report complete.

ADD-ON "Client_DeathPopUp" CONTAINS SYNTAX ERRORS


it's a package

use };

other new problem is...
Quote
Client checking Add-On: Client_NotificationPopup
Loading Add-On: Client_NotificationPopup (CRC:1046840447)
Add-Ons/Client_NotificationPopup/client.cs Line: 36 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^^^newDeathText.setText(%deathMessage);

^^^return;

^^}

^^else

^^^RTBCC_NotificationManager.push(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled","user",%user.id@"_msg",-1);

^}





};##
##

activatePackage(NotificationPopup);


>>> Error report complete.

ADD-ON "Client_NotificationPopup" CONTAINS SYNTAX ERRORS

Uh

%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled",

first of all I don't get this

Why are you putting an if statement block into a function...?

Also you need to use HandleClientDeath with the correct arguments, it's not HandleClientDeath::receive either, you use just function HandleClientDeath.



Uh

%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled",

first of all I don't get this

Why are you putting an if statement block into a function...?

Also you need to use HandleClientDeath with the correct arguments, it's not HandleClientDeath::receive either, you use just function HandleClientDeath.



Opps!!!   This is better or not?
Quote
package NotificationPopup
{
   function HandleClientDeath(%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10)
   {
            parent::receive(%this,%message);
         if(RTBCO_getPref("CC::Message::Note"))
         {


        %detagged = detag(%tag);
      %det = detag(%msg);
      if(%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled")
      {
         if($DeathCounts == 5)
         {
            for(%x=1;%x<=4;%x++)
               $Death[%x] = $Death[%x+1];
            $Death5 = %det;
         }
         else
            $Death[$DeathCounts++] = %det;
         %deathMessage = $Death1;
         for(%x=2;%x<=$DeathCounts;%x++)
            %deathMessage = %deathMessage NL $Death[%x];
         newDeathText.setText(%deathMessage);
         return;
      }
      else
         RTBCC_NotificationManager.pus h(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged,"user",%user.id@"_msg",-1);
   }


};
activatePackage(NotificationPopup);
it's a package

use };
This guy told me use }; and look at SYNTAX ERRORS


Quote
Client checking Add-On: Client_NotificationPopup
Loading Add-On: Client_NotificationPopup (CRC:450243279)
Add-Ons/Client_NotificationPopup/client.cs Line: 36 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^^^^%deathMessage = %deathMessage NL $Death[%x];

^^^newDeathText.setText(%deathMessage);

^^^return;

^^}

^^else

^^^RTBCC_NotificationManager.push(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged,"user",%user.id@"_msg",-1);

^}





};##
##

activatePackage(NotificationPopup);


>>> Error report complete.

ADD-ON "Client_NotificationPopup" CONTAINS SYNTAX ERRORS

This guy told me use }; and look at SYNTAX ERRORS
That guys also copys scripts for his own purposes.

All I did was fix your syntax errors. If there is any logic errors, I didn't check for them. I also properly spaced it out for you.

Code: [Select]
package NotificationPopUp
{
function RTBCC_Session::receive(%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10)
{
parent::receive(%this,%message);
if(RTBCO_getPref("CC::Message::Note"))
{
%detagged = detag(%tag);
%det = detag(%msg);
if(%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled")
{
if($DeathCounts == 5)
{
for(%x=1;%x<=4;%x++)
$Death[%x] = $Death[%x+1];
$Death5 = %det;
}
else
$Death[$DeathCounts++] = %det;
%deathMessage = $Death1;
for(%x=2;%x<=$DeathCounts;%x++)
%deathMessage = %deathMessage NL $Death[%x];
newDeathText.setText(%deathMessage);
return;
}
else
RTBCC_NotificationManager.push(%user.name,%tag,%msg,%a1,%a2,%a3,%a4,%a5,%a6,%a7,%a8,%a9,%a10,%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled","user",%user.id@"_msg",-1);
}
}
};
activatePackage(NotificationPopUp);
« Last Edit: September 08, 2013, 07:48:59 PM by Scriode »

That guys also copys scripts for his own purposes.

All I did was fix your syntax errors. If there is any logic errors, I didn't check for them. I also properly spaced it out for you.

It was perfect! no syntax errors!  But I not see any RTB message popup when I was die after it will popup.

It was perfect! no syntax errors!  But I not see any RTB message popup when I was die after it will popup.
Well you are using the function for when you receive a message. You want to make it so when you die, a popup appears? If so then you will need to use the function for death

Code: [Select]
function GameConnection::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
Parent::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);

//Put your rtb message push here and all your other things here.
}

Well you are using the function for when you receive a message. You want to make it so when you die, a popup appears? If so then you will need to use the function for death


function GameConnection::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
   Parent::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);
      
   //Put your rtb message push here and all your other things here.
}


Console Error:
Add-Ons/Client_NotificationPopup/client.cs (0): Unknown command onDeath. and popup is work, but it went too fast, I want it slow down, and when I was die same time my server was crashed down :(

::onDeath isn't client sided

::onDeath isn't client sided
I found it was double, I had remove the 2 lines, I did fixed as worked!

When I was test as die then popup are worked! You can see THREE popup as blank! YAYA!!!! here my code:
Quote
package NotificationPopUp
{
function GameConnection::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc)
{
   Parent::OnDeath(%client, %killerPlayer, %killer, %damageType, %damageLoc);
      if(RTBCO_getPref("CC::Message::Note"))
      {
         %detagged = detag(%tag);
         %det = detag(%msg);
         if(%detagged $= "MsgYourDeath" || %detagged $= "MsgClientKilled")
         {
            if($DeathCounts == 5)
            {
               for(%x=1;%x<=4;%x++)
                  $Death[%x] = $Death[%x+1];
               $Death5 = %det;
            }
            else
               $Death[$DeathCounts++] = %det;
            %deathMessage = $Death1;
            for(%x=2;%x<=$DeathCounts;%x++)
               %deathMessage = %deathMessage NL $Death[%x];
            newDeathText.setText(%deathMessage);
            return;
         }
         else
            RTBCC_NotificationManager.pus h("<bitmap:Client_NotificationPopup/skull16>", %user.name, %client, %killerPlayer, %killer, %damageType, %damageLoc,"user", %user.id@"_msg",-1);
      }
   }
};
activatePackage(NotificationPopUp);
What wrong with blank on the popup?