Author Topic: re-load inventory menu  (Read 845 times)

You know the inventory menu in the upper right?
How to let the menu to re-load, when a minigame Ends/Starts?

« Last Edit: August 06, 2009, 01:26:43 PM by chilmans »

Try adding this bit to the package.
Code: [Select]
function Armor::onNewDatablock(%this,%data)
{
Parent::onNewDatablock(%this,%data);
if(isObject(%this.client))
commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);
}

Try adding this bit to the package.
Code: [Select]
function Armor::onNewDatablock(%this,%data)
{
Parent::onNewDatablock(%this,%data);
if(isObject(%this.client))
commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);
}
I'll do that, thanks.

You may not need the ::changeDatablock one with that either. Untested, though.

I'll keep it in there just to be sure.

I added the code to it, and tried it, but it doesn't help the issue,
so I tried to add something else to it, like this:
Code: [Select]
function Minigame::onStart(%this,%data)
{
commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);
Parent::onStart(%this,%data);
}
function Minigame::onEnd(%this,%data)
{
commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);
Parent::onEnd(%this,%data);
}
I have no idea if this works, or if this is bullstuff, so if you guys know if this is right (or wrong), please tell me
it might be bullstuff because creating a minigame is serversided and not clientsided :P
« Last Edit: August 07, 2009, 04:33:11 AM by chilmans »

I got it the wrong way round.
Code: [Select]
function Armor::onNewDatablock(%data,%this)
{
Parent::onNewDatablock(%data,%this);
if(isObject(%this.client))
commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);
}
Try that. It works on my server.

I got it the wrong way round.
Code: [Select]
function Armor::onNewDatablock(%data,%this)
{
Parent::onNewDatablock(%data,%this);
if(isObject(%this.client))
commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);
}
Try that. It works on my server.
will try it!

Space Guy, it fixes the issue when starting/ending a minigame, but not when dieing in a minigame, with the unusable copy D:

it should be something like this (this is not the real code!):
Code: [Select]
function Player::onDie(%this)
{
Parent::onDie(%this)
if(isobject(%this.client))
  commandToClient(%this.client,'PlayGui_CreateToolHud',%data.maxTools);   
}
is this code right?

You can't just invent functions out of nowhere and hope they exist. It doesn't work like that.

It's probably to do with Blockland's client clearing out only the first five slots when you die. I'll look at it later.

You can't just invent functions out of nowhere and hope they exist. It doesn't work like that.
isn't there a list of functions? Or is that one classified?

While hosting a non-dedicated server:
localclientconnection.player. dump(); will give you a list of every 'player' function.
localclientconnection.dump(); will give you every 'GameConnection' function.
localclientconnection.brickgr oup.getObject(0).dump(); will give you a list of every 'fxDTSBrick' function. (Place a brick first or you get "nonexistant object")