ID:272705
Dec 16 2008, 11:29 am
|
|
I'm making a TCG and am now working on the battle system, in this system when a card is played it its added to a list and a new proc creates a copy of that object at a certain number of space from the user (depending on the card), the problem I'm having is that I can't seem to figure out how to delete the new object at that spacific location when the card is discarded with out deleting other instances of that object.
|
In response to Rockinawsome
|
|
Sorry, I can be slightly bad at discriptions. Basicly what I want to do is turn this in to code: "Delete all cards at position(x,y,z) from user" but I cant figure out how to do this.
|
In response to Nightmare Fantasy
|
|
Assuming all the cards are under a standard typepath (say, /obj/cards):
proc/delete_cards(atom/a) |
In response to Popisfizzy
|
|
Thank you for the help :)
|
In response to Popisfizzy
|
|
Popisfizzy wrote:
proc/delete_cards(atom/a) |
In response to Schnitzelnagler
|
|
Aye.
|
What I think you're doing is not checking the type.
You have to use istype() to check for the type of card. If your cards are all the same object, like obj/card, then you will need a type of unique identifier. Of course, if this last form is the case, I would suggest you overhaul it so that it resembles the first.
The other possibility is that after you're deleting the first object type in your loop, you aren't breaking out of the loop.
Some examples:
Of course, something else could be going on here that I haven't been able to glean from your post.