ok i have two verbs that let players add a card to there deck and remove i get this error when u try to remove
runtime error: cannot append to list
proc name: Remove from deck (/mob/verb/Remove_from_deck)
source file: verbs.dm,49
usr: Kavumaster (/mob/Kavumaster)
src: Kavumaster (/mob/Kavumaster)
call stack:
Kavumaster (/mob/Kavumaster): Remove from deck()
i also belive that when you clcik add it dosnt really add it here are my verbs
Add_to_deck()
var/obj/cards/todeck = input("What would you like to add?") in usr.contents
todeck.Move(deck)
usr << "You have added [todeck.name] to your deck."
Remove_from_deck()
var/obj/cards/fromdeck = input("What would you like to remove?") in usr.deck
usr.contents += fromdeck
usr << "You have taken [fromdeck.name] from your deck."
del fromdeck
ID:147216
![]() Aug 6 2004, 11:58 am
|
|
![]() Aug 6 2004, 12:23 pm
|
|
Where do you define deck?
|
Garthor wrote:
Where do you define deck? I'm guessing under his mob/ type. But sure enough if thats true those functions should be under the same mob type. |
Kavumaster wrote:
ok i have two verbs that let players add a card to there deck and remove i get this error when u try to remove I can take a guess at usr.contents += fromdeck is where your getting this runtime error. But why you couldnt add any thing to ur contents is beyond me. Umm why not do a fromdeck.Move(usr) :). Try that k. |
I find it weird that you're changing the location of this 'fromdeck', then after you changed the location you're deleting it?
How about: mob/verb/Remove_from_deck() Try something like that, then get back to me when it goes wrong. |
hmm says the var/card part is an invalid proc definition oh and thanks for putting up with my bad grammer
|
Actually, I salvagged what I could from what Green Lime had written. Though it too was bad, I could make out the errors and what needed to be fixed.
|
JohnReaper wrote:
Actually, I salvaged what I could from what Green Lime had written. Though it too was bad, I could make out the errors and what needed to be fixed. WHATs Bad! |
i think the whole problem with my code is the adding to deck i got a statpanel that looks like this
statpanel("[src.DN]","[src.deck]") the DN stands for deck name but on the stat panel when i add it to deck it dosnt show up or if i write the code a diffrent way it says undefined proc or verb /list/Enter() thats when i write like this todeck.Move(usr.deck) |
Green Lime wrote:
JohnReaper wrote: Not to be picky, but your grammar use, and spelling of words. |
Can you show us exactly how you have the lists defined, and how you use them. Along with the two current verbs you're using. (Add, remove)
|
mob/
var Money = 100.100 Gender guild DN="default" Wins Loses music class deck = list() verb Add_to_deck() var/obj/cards/todeck = input("What would you like to add?") in usr.contents todeck.Move(usr.deck) usr << "You have added [todeck.name] to your deck." /* Remove_from_deck() var/obj/cards/fromdeck = input("What would you like to remove?") in usr.deck fromdeck.Move(usr) usr << "You have taken [fromdeck.name] from your deck." */ Remove_from_deck() var/obj/cards/card=input("What would you like to remove?")in usr.deck card:Move(usr) usr<<"You removed [card] from your deck!" |
i gtg now so cant keep posting if u can make it work or write one yoursef i can use im sure me and my icon artist could give you master Gm in this game
|
mob/var Not guaranteed to work, but you get the jiffy of it. |
Thx it works just had to tweak it a little the if statement wasnt working but without it it does(Ill give u perm MGM if i see you on the game ever but i was wondering why on my statpanel
statpanel("src.DN","src.deck") when playing under ur deck statpanel it gives you the contents of your deck as /list |