ID:141367
 
Code:
        verb
Talk()
set src in oview(2)
if(usr.icon == 'mobs.dmi')
if(usr.talkd == 0)
var/yn = input(usr,{""Hello!", the dog catcher says, "Do you want to deposit some strays?""},"") in list ("Yes","No")
switch(yn)
if("Yes")
var/cages = 0
var/pay = 0
for(var/obj/items/Carrier/C in usr)
if(C.used == 1)
cages += 1
for(var/mob/M in C)
if(M.icon_state != "wolf1"&&M.icon_state != "wolf2")
M <<"<b>The Animal Handler dumps you into the For Sale cage."
M.bought = 0
M.owner = ""
M.OrigName()
M.loc = locate("cage")
else
M <<"<b>The Animal Handler dumps you into a cage."
M.bought = 2
M.owner = ""
M.OrigName()
M.loc = locate("wolves")
pay += 10
pay += cages*50
alert(usr,"You unloaded [cages] animals. I'll pay you $[pay] for that.")
usr.cash += pay
if("No")
alert(usr,"Alright then.")


Problem description:
It says I have no full cages, when I do.
Well, lets see if I can help out and help optimize the snippet shwon.

First of all, you really do not need switch() here, a simple if would have worked:
if("No" == input(usr,...))
No stuff
else
Yes stuff


For the full cage stuff, are you referring to the animal stuff in the for() shown? If so - make sure you put debugging statements (ex: world << "Animal found in cage") so you know it has been found since the message is sewnt to M and not usr
In response to GhostAnime
"You unloaded 0 animals. I'll pay you $0 for that."

Ethan Stellaris catches Bagel: Beagle (Male).
Debugging << Cage not found.
In response to Squeegy
Hm, mind showing the snippet of how the animals are caged?
In response to GhostAnime
    Carrier
density = 1
opacity = 0
icon_state = "carrier"
var/used = 0
verb
Drop()
set src in usr
src.loc = usr.loc
step(src,usr.dir)
if(locate(/obj/Wall) in oview(0))
step_towards(src,usr)
usr.holding = 0

Get()
set src in oview(1)
if (usr.icon == 'mobs.dmi')
src.loc = usr
else
if(usr.holding == 0)
src.loc = usr
usr.holding = 1

Put_Inside(var/mob/M in oview(1))
set src in oview(1)
if(usr.icon == 'mobs.dmi' && M.icon != 'mobs.dmi')
var/mob/dog = locate(/mob) in src.contents
if(!dog)
M.loc = src
src.name = "Carrier - Used"

Take_Out()
set src in oview(1)
if(usr.icon == 'mobs.dmi')
var/mob/dog = locate(/mob) in src.contents
if(dog)
dog.loc = src.loc
src.name = "Carrier"
In response to Squeegy
You're not going to be able to "take out" anything with that current "set" setting >_>

Since the mob (personally, I believe you should never put a mob in a mob's contents. Just seems so wrong to me :\) is in src's contents, it's not in any view. You need set src in usr.
In response to Squeegy
Squeegy wrote:
>   Carrier
> density = 1
> opacity = 0
> icon_state = "carrier"
> var/used = 0
> verb
> Drop()
> set src in usr
> src.loc = usr.loc
> step(src,usr.dir)
> if(locate(/obj/Wall) in oview(0))
> step_towards(src,usr)
> usr.holding = 0
>
> Get()
> set src in oview(1)
> if (usr.icon == 'mobs.dmi')
> src.loc = usr
> else
> if(usr.holding == 0)
> src.loc = usr
> usr.holding = 1
>
> Put_Inside(var/mob/M in oview(1))
> set src in oview(1)
> if(usr.icon == 'mobs.dmi' && M.icon != 'mobs.dmi')
> var/mob/dog = locate(/mob) in src.contents
> if(!dog)
> M.loc = src
> src.name = "Carrier - Used"
>
> Take_Out()
> set src in oview(1)
> if(usr.icon == 'mobs.dmi')
> var/mob/dog = locate(/mob) in src.contents
> if(dog)
> dog.loc = src.loc
> src.name = "Carrier"


my eyes may be bad...but I don't see you setting used to 1, you only change the name...yet the top code says it needs to be 1?