Author Topic: Adding bricks to the current game  (Read 3452 times)

After executing a cs file that contains the datablock for a new brick is it possible to add that brick to the current game without restarting a server? Is there some sort of function that updates the gui for the brick menu?
Thanks in advance

Why not restart? It only takes about a minute or so, if you have too many add-ons, just take off what you want to use on the server.

Why not restart? It only takes about a minute or so, if you have too many add-ons, just take off what you want to use on the server.
Because there's obviously a manual way to reload the GUI, and it would be faster.

Just do trace when loading the brick menu for the first time, the function should show up.

The problem is that this all has to happen server sidedly and apply to all the clients ingame. Is there a clientcmd for what I'm looking for?

There is a client command. That is how the bricks are received, lol.

Code: [Select]
transmitdatablocks();Will register the bricks and make the appear when players rejoin, but there isn't currently a known command for sending them to players. If you want to find it, you'd probably have to dig through the API a bit. (dump() is a useful command)


exec("add-ons/brick_blah/server.cs");
transmitdatablocks();


wait a few seconds

commandtoall('BSD_LoadBricks');

might work

exec("add-ons/brick_blah/server.cs");
transmitdatablocks();


wait a few seconds

commandtoall('BSD_LoadBricks');

might work
i tried that when i was messing around a while ago and it didn't work and it just crashed the clients constantly upon joining. i wasn't sure why, considering it was vanilla blockland

probably because datablocks aren't meant to be loaded mid-game normally

I completely advise against doing this unless you're testing out an add-on on single player or with some beta testers for an add-on you're working on.

transmitDatablocks();
commandtoall('missionstartphase3');

The biggest problems with this:
If there's content included in the datablocks that a client has not loaded, they will drop out of the server.
Not sure if this still happens, but any new particles will not have textures, they will all appear as squares.
I do not remember the command that updates events.
« Last Edit: May 27, 2014, 05:36:51 PM by Chrono »

If there's content included in the datablocks that a client has not loaded, they will drop out of the server.
Not sure if this still happens
Because i'm transferring the content from the server to the client I don't think that will be a problem. I just need to ensure that transmitDatablocks(); and commandtoall('missionstartphase3'); is called after the transmission.

Edit: Another question, is there a way to make clients reload only certain datablocks? Im afraid of major lag caused by this method.
« Last Edit: May 27, 2014, 07:45:57 PM by RarwMuffinz »

Because i'm transferring the content from the server to the client I don't think that will be a problem. I just need to ensure that transmitDatablocks(); and commandtoall('missionstartphase3'); is called after the transmission.

Edit: Another question, is there a way to make clients reload only certain datablocks? Im afraid of major lag caused by this method.
You can only re-transmit the whole set of datablocks, and it also doesn't instantly do it. Transmitting datablocks takes a while. And you can not transmit new content to clients. Either the client already has it, or he gets kicked with an error.

On another note because I do not want to create another topic, how can I execute all .cs files in any given folder?