Author Topic: Is it possible to update the Brick Selector Dialogue after a server starts?  (Read 699 times)

Awhile ago, I was working on a little script, just to test something out, and I thought it was perfect, but I believe this function only servers single player.
"commandToClient('BSD_LoadBricks');"
So, I tried some other things, and it didn't work, but the BSD updates when I rejoin the server.

I'm just curious if its possible, just in case if I ever continue to work on this script.

Code: [Select]
function toggleUInames()
{
%group=DataBlockGroup;
%count=%group.getCount();
for(%i=0;%i<%count;%i++)
{
%data=%group.getObject(%i);
if(%data.getClassName() $= "fxDTSBrickData")
{
//echo(%data.uiName SPC "|" SPC %data.prevUiName);
if(!$DataUiName)
{
if(%data.prevUiName $= "")
%data.prevuiName = %data.uiName;
if(%data.prevIcon $= "")
%data.prevIcon = %data.iconName;
if(%data.prevCat $= "")
%data.prevCat = %data.category;
if(%data.prevSubCat $= "")
%data.prevSubCat = %data.subCategory;
switch$(%data.uiName)
{
case "1x1":
talk(%data);
%data.uiName = "Pistol";
%data.invImage = "pistolItem";
%data.iconName = pistolItem.iconName;
%data.category = "Pistols";
%data.subCategory = "Free";
%data.cost = 0;
case "1x2":
%data.uiName = "Rocket Launcher";
%data.invImage = "rocketLauncherItem";
%data.iconName = rocketLauncherItem.iconName;
%data.category = "Explosives";
%data.subCategory = "1000 Points";
%data.cost = 1000;
case "1x3":
%data.uiName = "Hammer";
%data.invImage = "hammerItem";
%data.iconName = hammerItem.iconName;
%data.category = "Tools";
%data.subCategory = "Admin";
case "1x4":
%data.uiName = "Wrench";
%data.invImage = "wrenchItem";
%data.iconName = wrenchItem.iconName;
%data.category = "Tools";
%data.subCategory = "Admin";
case "1x6":
%data.uiName = "Retro Pistol";
%data.invImage = "retroPistolItem";
%data.iconName = retroPistolItem.iconName;
%data.category = "Pistols";
%data.subCategory = "10 Points";
%data.cost = 10;
case "1x8":
%data.uiName = "Akimbo Pistols";
%data.invImage = "AkimboPistolItem";
%data.iconName = AkimboPistolItem.iconName;
%data.category = "Pistols";
%data.subCategory = "25 Points";
%data.cost = 25;
%data.akimbo = 1;
case "1x10":
%data.uiName = "Gun";
%data.iconName = gunItem.iconName;
%data.invImage = "gunItem";
%data.category = "Pistols";
%data.subCategory = "1000 Points";
%data.cost = 1000;
case "1x12":
%data.uiName = "Modern Pistol";
%data.invImage = "modernPistolItem";
%data.iconName = modernPistolItem.iconName;
%data.category = "Pistols";
%data.subCategory = "10 Points";
%data.cost = 10;
case "1x16":
%data.uiName = "Filler"@getRandom(1,10000);
%data.invImage = "wrenchItem";
%data.iconName = wrenchItem.iconName;
default:
%data.uiName = "";
}

}
else
{
%data.uiName = %data.prevuiName;
%data.iconName = %data.prevIcon;
%data.category = %data.prevCat;
%data.subCategory = %data.prevSubCat;
}
//$DataUIName = ($DataUIName == 1) ? 0:1;
}
}
$DataUIName = !$DataUiName;
commandToAll('BSD_LoadBricks');
}
package fxDTSWeapon
{
function fxDTSBrickData::onUse(%this, %player, %slot)
{
parent::onUse(%this, %player, %slot);
if($DataUIName)
{
%client = %player.client;
%inv = %client.inventory[%slot];
%img = %inv.invImage;
%player.mountImage(%img.image, 0);
%player.updateArm(%img.image);
if(%inv.Akimbo)
%player.playThread(1, armreadyboth);
}
}
};
activatePackage("fxDTSWeapon");
If you guys wanted the script too.

You should run a trace as you are loading to see what client command is used to recieve brick data.

You never call transmitdatablocks

You never call transmitdatablocks
I originally did this, but it didn't make a difference when I did it.

I originally did this, but it didn't make a difference when I did it.
If you don't call it, the clients don't even know that the uiname changed.

If you don't call it, the clients don't even know that the uiname changed.
Alright, but it still doesn't work, even with it in, I'll be on my computer in a bit, and I might do what Greek2me suggested and run trace as I join the server.

In theory there should be a way to transmit new bricks into a players' brick selector dialog after they've finished loading, but it would require hacking apart how loading works to figure out. I know if a player rejoins after adding a brick datablock they will be able to use it.