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?
The object is already in the code. I just need to remember what you do to like, spawn the item into your inventory.
|
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... |
Did you click the link I provided? It explains just what you're asking for if I'm not mistaken.
|
It really depends on how you have set up your shops.
For instance: In the following setup: mob You could spawn a copy of the item by doing the following: var/obj/o = shop[1] Or you could move the item by doing the following: var/obj/o = shop[1] 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