Author Topic: Documentation?  (Read 2853 times)

Where is it?

Specificly for blockland and all the commandToServer stuff we can override when making addons.
Im not talking about existing addons, or the functions built into torque, but the stuff thats unique to blockland.

Is there a magic cmd in game that will list out ALL the events and server commands?  is there a magic keyword I didnt search for? (searching for "documentation" didnt help).

help and/or links would be great

dumpConsoleFunctions();

thanks -- i'll try that

serverCmdWtf
serverCmdConfusion
serverCmdHate
serverCmdLove
serverCmdClearFarAwayBricks
serverCmdClearFloatingBricks
serverCmdClearSpamBricks
serverCmdResetMiniGame
ServerCmdSetMiniGameData
serverCmdEndMiniGame
serverCmdCreateMiniGame
serverCmdRequestMiniGameColor List
serverCmdIgnoreMiniGameInvite
serverCmdRejectMiniGameInvite
serverCmdAcceptMiniGameInvite
serverCmdInviteToMiniGame
serverCmdRemoveFromMiniGame
serverCmdLeaveMiniGame
serverCmdJoinMiniGame
serverCmdRequestMiniGameList
serverCmdTrustListUpload_Done
serverCmdTrustListUpload_Line
serverCmdTrust_Demote
serverCmdUnIgnore
serverCmdIgnoreTrustInvite
serverCmdRejectTrustInvite
serverCmdAcceptTrustInvite
serverCmdTrust_Invite
ServerCmdClearAllBricks
ServerCmdClearBrickGroup
ServerCmdHilightBrickGroup
ServerCmdRequestBrickManList
serverCmdSit
serverCmdHug
serverCmdZombie
serverCmdBSD
serverCmdAlarm
serverCmdSetWrenchData
serverCmdVehicleSpawn_Respawn
serverCmdDoPlayerIcons
serverCmdDoSecondPackIcons
serverCmdDoPackIcons
serverCmdDoItemIcon
serverCmdDoIcon
serverCmdDoAllIcons
serverCmdIconInit
serverCmdPrevSeat
serverCmdNextSeat
serverCmdStopTalking
serverCmdStartTalking
serverCmdBuyBrick
serverCmdClearInventory
serverCmdSetPrint
serverCmdUseHammer
serverCmdUseSprayCan
serverCmdUseFXCan
serverCmdUsePrintGun
ServerCmdCancelBrick
ServerCmdPlantBrick
ServerCmdUndoBrick
ServerCmdRotateBrick
ServerCmdSuperShiftBrick
ServerCmdShiftBrick
ServerCmdDropTool
ServerCmdUnUseTool
ServerCmdUseTool
serverCmdInstantUseBrick
ServerCmdUseInventory
serverCmdRayPZ
serverCmdGetPZ
serverCmdDFG
ServerCmdClearBots
ServerCmdClearVehicles
ServerCmdResetVehicles
serverCmdCancelEvents
serverCmdCancelAllEvents
ServerCmdClearBricks
ServerCmdSetFocalPoint
serverCmdSelf Delete
serverCmdDropCameraAtPlayer
serverCmdDropPlayerAtCamera
serverCmdColorTest
serverCmdLight
serverCmdTripOut
serverCmdBrickCount
serverCmdRealBrickCount
serverCmdDoUpdates
serverCmdTimeScale
serverCmdWarp
serverCmdSpy
serverCmdRet
serverCmdFind
serverCmdFetch
serverCmdGetID
ServerCmdListAllDataBlocks
serverGetMissionPreviewImage
serverGetMissionDisplayName
serverCmdGetMapList
serverCmdChangeMap
ServerCmdUpdateBodyColors
ServerCmdUpdateBodyParts
serverLoadAccentInfo
serverLoadAvatarName
serverLoadAvatarNames
serverCmdWand
serverCmdMagicWand
serverCmdUnBan
serverCmdRequestBanList
serverCmdBan
serverCmdKick
serverCmdReloadBricks
serverCmdEndSaveFileUpload
serverCmdCancelSaveFileUpload
serverCmdUploadSaveFileLine
serverCmdStartSaveFileUpload
serverCmdInitUploadHandshake
serverCmdSetSaveUploadDirName
serverCmdSetColorMethod
serverCmdClearColors
ServerCmdCancelExtendedBrickI nfoRequest
ServerCmdRequestExtendedBrick Info
ServerCmdRequestNamedTargets
serverCmdRequestEventTables
ServerCmdRequestWrenchEvents
serverCmdClearEvents
serverCmdAddEvent
serverCmdClosePlayerList
serverCmdOpenPlayerList
serverCmdMissionStartPhase3Ac k
serverCmdMissionStartPhase2Ac k
serverCmdMissionStartPhase1Ac k
serverCmdMessageSent
serverCmdTeamMessageSent
serverCmdSADSetPassword
serverCmdSAD
serverCmdSymbolHandeler
serverCmdFakeJoin
servercmdFakeTalk
servercmdFakeLeave

To find the functions attached to an object, you can dump it.
%obj.dump();
This also displays any variables attached to the object.

ok that helps a lot
but for each of those functions.. where do I findout what parameters they take and what the function is supposed to do?
or do I need to make 860 forum searches and see what comes up?

You'll have to find that out by yourself in most cases unless you do feel like searching. It's not as hard as you may think.

searching i guess i can do .. but when the search gives nothing useful.. it makes a guy wonder.

ex: - i searched for the following 3 cmds at the top of the list:
serverCmdClearFarAwayBricks
serverCmdClearFloatingBricks
serverCmdClearSpamBricks

each search gives exactly 3 hits.  first one is this thread, the other 2 hits are people asking the exact same question.. and getting the exact same answer.

searching i guess i can do .. but when the search gives nothing useful.. it makes a guy wonder.

ex: - i searched for the following 3 cmds at the top of the list:
serverCmdClearFarAwayBricks
serverCmdClearFloatingBricks
serverCmdClearSpamBricks

each search gives exactly 3 hits.  first one is this thread, the other 2 hits are people asking the exact same question.. and getting the exact same answer.

Code: [Select]
function serverCmdClearSpamBricks(%client)
{
   if(!%client.isAdmin)
      return;
   
   if($Server::BrickCount > 0)
messageAll('MsgClearBricks', "\c3" @ %client.getPlayerName() @ "\c0 cleared spam bricks.");

   //loop through all bricks
   %groupCount = MainBrickGroup.getCount();
   for(%i = 0; %i < %groupCount; %i++)
   {
      %group = MainBrickGroup.getObject(%i);
      %count = %group.getCount();
      for(%j = 0; %j < %count; %j++)
      {
         %brick = %group.getObject(%j);

         //we're only interested in bricks...
         if(!(%brick.getType() & $TypeMasks::FxBrickAlwaysObjectType))
            continue;

         //that are on the ground...
         if(%brick.getDistanceFromGround() != 0)
            continue;

         //and planted...
         if(!%brick.isPlanted)
            continue;
         
         //and not dead...
         if(%brick.isDead)
            continue;

         %brickData = %brick.getDataBlock().getID();
         if(%brickData.category $= "Baseplates")
         {
            //it's a baseplate, but if it's all alone and red or has an item attached to it, it's probably still spam
            if(%brick.getNumUpBricks() == 0 && (%brick.getColorID() == 0 || isObject(%brick.item)) )
            {
               %brick.killBrick();
            }
            //if this is a red "plain" or "road" baseplate with an identical baseplate on top of it, it's probably spam
            else if(%brick.getNumUpBricks() == 1 && %brick.getColorID() == 0 && (%brickData.subCategory $= "Plain" || %brickData.subCategory $= "Road"))
            {
               %upBrick = %brick.getUpBrick(0);
               if(%upBrick.getDataBlock().getID() == %brickData && %upBrick.getColorID() == 0)
                  %brick.killBrick();
            }
         }
         else
         {
            //not a baseplate, kill it
            %brick.killBrick();
         }
      }
   }
}

function serverCmdClearFloatingBricks(%client)
{
   if(!%client.isAdmin)
      return;
   
   if($Server::BrickCount > 0)
messageAll('MsgClearBricks', "\c3" @ %client.getPlayerName() @ "\c0 cleared floating bricks.");

   //loop through all bricks
   %groupCount = MainBrickGroup.getCount();
   for(%i = 0; %i < %groupCount; %i++)
   {
      %group = MainBrickGroup.getObject(%i);
      %count = %group.getCount();
      for(%j = 0; %j < %count; %j++)
      {
         %brick = %group.getObject(%j);
         if(!(%brick.getType() & $TypeMasks::FxBrickAlwaysObjectType))
            continue;

         if(%brick.getDistanceFromGround() != 2147483647)
            continue;

         if(!%brick.isPlanted)
            continue;
         
         if(%brick.isDead)
            continue;

         %brick.killBrick();
      }
   }
}


//clears bricks that are > 1000 units away
function serverCmdClearFarAwayBricks(%client)
{
   if(!%client.isAdmin)
      return;

   %player = %client.player;

   if(!isObject(%player))
      return;

   if($Server::BrickCount <= 0)
      return;

   messageAll('MsgClearBricks', "\c3" @ %client.getPlayerName() @ "\c0 cleared far away bricks.");

   %playerPos = %player.getPosition();

   //loop through all bricks
   %groupCount = MainBrickGroup.getCount();
   for(%i = 0; %i < %groupCount; %i++)
   {
      %group = MainBrickGroup.getObject(%i);
      %count = %group.getCount();
      for(%j = 0; %j < %count; %j++)
      {
         %brick = %group.getObject(%j);
         if(!(%brick.getType() & $TypeMasks::FxBrickAlwaysObjectType))
            continue;

         if(%brick.getDistanceFromGround() != 0)
            continue;

         if(!%brick.isPlanted)
            continue;
         
         if(%brick.isDead)
            continue;

         %brickPos = %brick.getPosition();

         %delta = vectorSub(%brickPos, %playerPos);
         %distance = vectorLen(%delta);

         if(%distance < 1000)
            continue;

         %brick.killBrick();
      }
   }
}

function scheduletest()
{
   if(isEventPending($ST))
   {
      cancel($ST);
      return;
   }
   
   echo("time delta: "@ getSimTime() - $STTime);
   $STTime = getSimTime();

   $ST = schedule(33,0, scheduleTest);

}
Found in Script_ClearSpam/Server.cs

that helps some more.  Thanks!

lets move on to anotner one: serverCmdCreateMiniGame
I did a search for 'CreateMiniGame' and came up with this:
http://forum.blockland.us/index.php?topic=91198.0

In there are the arguments for that cmd:  (%cl, %name).  namely clientID and minigame name.
which is fine for that cmd.  But where did they get those argument names FROM in the first place?  When a new server command is added to a new version of blockland, how do people figure out what arguments it needs?

Theres got to be some process or trick people are using to get this info.  Rather than combing through the forums for every one of the 86 different commands, i want to use said trick or process on my own.

When you use a serverCmd your %client(%cl) is automatically there, the %name is the arg sent to the server for the new minigame

yes i know that.

but your missing my point -- where did you know to even include %name in the first place?

commandToServer('wtf');
Is equivalent to using /wtf, or hitting the confusion emote key bind.

yes i know that.

but your missing my point -- where did you know to even include %name in the first place?
You mean like, how someone figured out how these are the correct args?
Code: [Select]
GameConnection::onDeath(%this,%sourceObject,%sourceClient,%damageType,%damageArea)

commandToServer('wtf');
Is equivalent to using /wtf, or hitting the confusion emote key bind.
Your right -- but your not helping.

I know that as well.  But I need to know how to figure out what put _after_ the /command part

ex:
/ban ? ? ?
what goes there? and in what order?
just typing /ban in the game, gives nothing
if I type:   /ban 1234
I get an error about BL_ID not specified.  Not very helpful, but at least it Tells me something.

So I searched around in some mods and found:
serverCmdBan(%cl, %name, %bl_ID, %time, %reason)

but for the person who wrote the mod to begin with -- where did they get the info from???