Problem description:
I have a shop system in place wherein there is a list of items and you pick from one of them. If you pick, say, a dagger, how do I go about adding a dagger to the player's inventory from there?
#2 Aug 9 2012, 5:18 pm
|
|
The object is already in the code. I just need to remember what you do to like, spawn the item into your inventory.
| |
#3 Aug 9 2012, 5:23 pm
|
|
new()
/obj/Items/Potions/Small_Health_Potion = variablex variablex.Move(usr)? I feel like it is somewhere along those lines but it has been a while... | |
#4 Aug 9 2012, 5:49 pm
|
|
Did you click the link I provided? It explains just what you're asking for if I'm not mistaken.
| |
#5 Aug 9 2012, 6:06 pm
|
|
Emm wouldnt usr.contents += object chosen work?
| |
#6 Aug 9 2012, 6:48 pm
|
||||
It really depends on how you have set up your shops.
For instance: In the following setup:
You could spawn a copy of the item by doing the following:
Or you could move the item by doing the following:
Again, my knowledge of DM is a bit rusty, so there might be a minor error here or there. It's been about 2 years since I've worked with DM, so I'm using a more general syntax (I've been working with Java, Actionscript, and C# the last several years.) | ||||
http://www.byond.com/docs/ref/info.html#/atom/movable/proc/ Move