Add new item to inventory
by James W Campbell · in Technical Issues · 02/25/2009 (8:37 pm) · 3 replies
Hi guys,
I'm trying to write up some torque script so that after a certain event an item will be added to my inventory. This works fine when adding a crossbow item using the command: %client.player.setInventory("Crossbow",1);
However i have no idea how to add an item named such as say.. a key.
Do i have to create a item datablock named key?
Where would that be stored?
does the item have to exist in data/shapes?
Any help would be great,
cheers :)
I'm trying to write up some torque script so that after a certain event an item will be added to my inventory. This works fine when adding a crossbow item using the command: %client.player.setInventory("Crossbow",1);
However i have no idea how to add an item named such as say.. a key.
Do i have to create a item datablock named key?
Where would that be stored?
does the item have to exist in data/shapes?
Any help would be great,
cheers :)
About the author
Associate Michael Hall
Distracted...
The datablock can be added to any script file, server-side, that get's executed, or you could add it to a new script file so long as you exec it in game.cs with the other script exec commands.
The item will require a valid shapefile. Shapes are most often placed in "~/data/shapes" but can be located anywhere in your directory structure, so long as the filepath and filename are correct in your datablock.