Blockland Forums > Modification Help

Swapping Inventories Problem

Pages: << < (2/3) > >>

Port:


--- Quote from: elm on June 06, 2012, 01:24:36 AM ---You just forgot a % on the fourth line from the while loop inside of the array.

--- End quote ---

What array?

elm:


--- Quote from: Port on June 06, 2012, 02:03:12 AM ---What array?

--- End quote ---



--- Quote from: The Russian on June 05, 2012, 08:44:21 PM ---
--- Code: --- %user.player.BDtool = %user.player.tool[client.player.naToolCount];
--- End code ---

--- End quote ---


Port:


--- Quote from: elm on June 06, 2012, 02:51:50 AM ---
--- End quote ---

I don't see anything related to arrays on that line.

Space Guy:

The square brackets - that's how arrays work in most languages...

The lines at the end %client.player.BDtool = ""; will not clear any of the arrays. It would be better to store the BDtool, naToolCount, etc. as local variables which are cleared at the end of function scope automatically.

msgItemPickup requires that you use the ID of an item (nameToID(%item) / %item.getID()) which might be why they aren't working correctly.

elm:


--- Quote from: Space Guy on June 06, 2012, 05:29:18 AM ---The square brackets - that's how arrays work in most languages...

--- End quote ---

He's just trying to be pretentious because torque script doesn't "really" use arrays, it's best just to ignore him.

Pages: << < (2/3) > >>

Go to full version