Author Topic: Tool slots  (Read 838 times)

Is there any way to set which tool slot is selected or detect which one is selected, client-sided?
« Last Edit: July 12, 2012, 10:34:17 PM by Scars75 »

You should look in VCE, I think there was a var:player:inventoryslot or something along those lines, just copy the function.

Code: [Select]
echo("Slot " @ %client.player.currTool);
%client.player.currTool = 1; // slot 1 (so normally wrench)

-1 if no tool is selected

A player has variables tooln where n goes from 0 to the maximum amount of items minus one. Tooln returns a numeric datablock (Torque loves numbers) that behaves just like a regular datablock.

Also, some numeric datablocks are always the same. 44 on Blockland is always the numeric datablock of the Standard Player.

Also, some numeric datablocks are always the same. 44 on Blockland is always the numeric datablock of the Standard Player.

It could be changed though, so it may not always remain 44.

oh sorry, I mean client-sided


Also, some numeric datablocks are always the same. 44 on Blockland is always the numeric datablock of the Standard Player.
They've changed a few times.

oh sorry, I mean client-sided
HUD_ToolName.getValue() - name of current item
getWord(HUD_ToolActive.position, 1) / 64 - index of current item (starting from 0)

setActiveTool(%slot) - 0 to 4. (Or player datablock maxtools) It CAN let you use a nonexistant slot, highlighting it but no errors. Won't open the menu if it isn't open already.

useTools(1) - Opens the items menu.