Author Topic: load as a command?  (Read 963 times)

Im thinking /load "savename"

I have no idea how to do this maybe someone could make this or teach me how? ty

uhm, load bricks as a command?

or what?

I know theres a command for load bricks... I think... maybe not.... Dunno... perhaps... Ask someone else...

Yeah, I'm fairly certain there is already a command, but the number of parameters it requires makes it far easier to just use the menus.

There's a function called serverloadbricksdirect("base/saves/MapName/Save.bls"); which you can use serverside, I think.

EDIT: Ah, in the Tutorial source:
serverDirectSaveFileLoad("base/saves/tutorial/TutorialBricks.bls", 3);

The 3 is the method of loading colours, replacing them with the ones in the file, matching to nearest in paint set, adding them to the end, etc. I don't know what number means which method, though.

You'd have something like:

Code: [Select]
function servercmdload(%client,%file)
{
 if(isFile("base/saves/" @ %file @ ".bls") && %client.isSuperAdmin)
 {
  serverDirectSaveFileLoad("base/saves/" @ %file @ ".bls", 3);
 }
}

Then someone would type /load Slate/SaveName to load "SaveName" for Slate. Bear in mind that this loads files from the host's computer, not whoever types the command. (You'd need stuff to upload the file for the other)
« Last Edit: February 18, 2008, 11:14:41 AM by Space Guy »

Yeah, but I think it's more of a hassle to do that sort of thing for a client-uploaded save.

Since savebricks("base/data/saves/slate/save.bls"); exists, I'm sure trying a loadbricks("base/data/saves/slate/save.bls"); is worth a try.