OK, my problem is that I'm trying to feed...say chickens. I am making it so that my game only uses switches when people talk. What I want is that when you Click() A (which I have set) that you feed the chicken. What I have done is made it so that when you talk to a man he gives you Feed which I defined as a variable and you get Feed=4. Then I made it so that if you click yes to the switch for feeding the chicken you get usr.Feed-=1. This works, but the problem is that what I want is for you to only be able to feed the chicken 1 time and then move on to the next and feed it, ONE TIME. I have tried many things for this but the main thing I tried was to make it so that when you feed the chicken the chicken becomes a new icon_state. So what I did was that if you feed it and its icon_state="chicken2" a new switch somes up saying that you can't feed it and you DON'T. But my problem is that you DO feed it a second time. Not only that but the second after you feed it, the switch saying that you cannot feed it comes up because the chickens icon_state is chicken2 the second after you feed it so it goes right into the you cannot feed it switch. Did you get all that? I want the "you cannot feed it" switch to only some up if you click it a second time. and I want it to not be able to be fed a second time. I hope you got all that and can help me!
Thanks in advance!
ID:163366
![]() Sep 4 2007, 12:57 pm
|
|
![]() Sep 5 2007, 10:28 am
|
|
does anyone know?
|
you have to define a variable, let's call it... fed. and another variable variable, let's call it... feed. so this is what we have so far...
mob now we need to make the chicken... mob now, on to the verb! away! mob/Chicken/verb/Feed(mob/M in get_step(src,src.dir)) //so when you walk next to it the verb pops up. okay, that probably won't work because there is still a mob chicken there, but if you could do a repop thing or make an 'allowfeed' variable, that would probably work. oh and IDK if you can do the 'var/obj/Chicken/C' thing cause i haven't tried that out yet, but if it doesnt work, do this... var/icon/I = new('animals.dmi',"fatchicken") now all of this together should look like... mob or var/icon/I = new('animals.dmi',"fatchicken") i hope all of that helps! P.S. some other coders might find minor errors on it, so anyone feel free to correct it! |
You forgot to check if they don't have any feed or not.
With that, they could go to -293012 Feed and still be able to feed it. |