I'm making objs likes carts, bags, etc. Which can hold other objects. I've got the part working where I can move objects from usr.contents -> src.contents and the src can be picked up and carried by usr. My problem is getting the objects out of the src and placing them at usr.loc or src.loc. Anyone know how I can do this? The code below is the take out object code I have now.
LJR
Take_Out()
if(contentst.len == null)
usr << "There are no bricks on this cart."
return
src.Move(usr.loc)
usr << "You take a brick off the cart."
ID:149736
Feb 26 2002, 11:06 am
|
|
Feb 26 2002, 11:09 am
|
|
I'd use something like this:
|
In response to Foomer
|
|
Don't forget
set src in view(1) or you'll have to pick up the cart to get anything out of it. ;) |
LordJR wrote:
if(contentst.len == null) Your trouble is in two places:
var/obj/item=contents[1] Note that this code is generic, so if the cart holds more than just bricks, that will work too. Lummox JR |
In response to Shadowdarke
|
|
And what's wrong with that!? :oP
|
In response to Lummox JR
|
|
Thanks guys.. Foomer's code worked fine for what I'm using it for and your suppose to have the cart in your inventory to use it so thats find. But I'll use Shadow's code later when I make boxes and chest to put items into. Now I need to make my bags works, where that code for multiple items will come in handy! :)
LJR |