Author Topic: Event: SetItem / SetInventory (V2)  (Read 11659 times)

SetItem / SetInventory (V2)
Two simple output events that involve dealing with items.

Instructions
Player -> SetItem [ITEM]
Player -> SetInventory [ITEM] [SLOT]
[ITEM] is the item you would like to give the user. "NONE" removes the item.
[SLOT] is the slot in the inventory you would like the item to appear.

Notes
By using onPlayerTouch -> Player -> SetItem "NONE", you can do a few new things.
For example, you can not let them have an item on a platform without taking it away.
SetInventory to "NONE" now has no console errors. Thanks to Space Guy for pointing it out!

Problems
No problems have been found, including console errors.
Please report any if you find them!

Download
WillHostForFood: Event_SetItem.zip
Return To Blockland: Event_SetItem.zip
(Last updated on: 11/3/08 at 4:30 P.M. EST.)

Installation
Save Event_SetItem.zip into the Add-Ons folder in your Blockland folder.
« Last Edit: November 04, 2008, 09:40:35 AM by Truce »


Epic,needed this to make a good class picking system.

This is needed. Now all we need for a good classing system is to be able to change player speed...

EPIC

Just... plain... EPIC

Edited the first post for some clarification on the value that goes with SetInventory.
Making this was a LOT easier than I thought, so I'll see if setting speed is just as easy.

Warning - while you were typing a new reply has been posted. You may wish to review your post.

First time I've ever enojoyed seeing that xD

Loelme?
Anyway, as I said, EPIC... I can't stop saying that...


Awesome job, Truce. Keep practicing at this, and you'll know Torque Script 100% in no time.

You've been promoted to a Mod Creator. :D

« Last Edit: August 05, 2010, 10:35:06 PM by Ether »

Very useful.

It looks like it might cause console errors with SetInventory if you choose None - I know you said it, but it probably does need fixing.

Very useful.

It looks like it might cause console errors with SetInventory if you choose None - I know you said it, but it probably does need fixing.

You know it's good when Space Guy, the scripting guru, approves of it.

Very useful.

It looks like it might cause console errors with SetInventory if you choose None - I know you said it, but it probably does need fixing.

SetInventory to "NONE" actually does remove the item from the slot.
The only thing I was concerned with is SetItem to "NONE": nothing [visible] happens, at all.


You should have a check to see if it's "NONE", so you can use 'MsgDropItem' rather than 'MsgItemPickup'.