![]() Dec 10 2010, 3:00 pm
In response to Spunky_Girl
|
|
what i am trying to say is that I have the puff of smoke which then turns into a clone as a movement-style icon already I just need to know how to transfer that to code and how to make the clones stay and act like NPC's possibly attacking any enemies within say 6 tiles.. Descriptive enough and clear enough for you??
|
And I said nothing about making the icon into a movement state icon. What you want to do, is to keep it as a regular state icon, and whether or not the state is in the icon file or in a separate icon file as the original icon, you would want to flick() to it.
Let's say the base icon for the caster is called 'Male.dmi', and it has 2 states within it. One is the actual icon without a state name, and your smoke icon state with the state name "puff". You would want to call flick() like so:
flick("puff",m)
However, if your smoke icon is NOT in the 'Male.dmi' icon file (so it's in its own separate icon file), let's call this other dmi file 'Puff.dmi', you would want to call flick() like so:
flick('Puff.dmi',m)
Again, your "puff of smoke" icon should NOT be a movement state icon; just a normal icon. |
Thanks also whenever I insert a new piece of fresh coding this coding always has a problem with it like a bad argument definition or other problems
mob/proc/UpdateInventory() var/items = 0 for(var/obj/O in src) if(equipment && O.slot && equipment[O.slot]==O) continue winset(src, "inventory", "current-cell=[++items]") src << output(O, "inventory") winset(src, "inventory", "cells=[items]") mob/proc/UpdateEquipment() var/items = 0 for(var/slot in equipment) winset(src, "equipment", "current-cell=1,[++items]") src << output(slot, "equipment") winset(src, "equipment", "current-cell=2,[items]") src << output(equipment[slot], "equipment") winset(src, "equipment", "cells=2x[items]") mob var/list/equipment obj var/slot |
You are getting errors that show us that you haven't taken the time to learn the basics of the language, or programming in general. I suggest you brush up with the following links:
http://byond.com/docs/guide http://byond.com/docs/ref http://byond.com/developer/articles/start http://www.byond.com/members/ DreamMakers?command=view_keyword_posts&keyword=beginner |
i have taken the time i am just confused as to why this error is appearing i have looked through the guide and reference and nothing helps me there that i oculd find!!
|
It's because you can't just place in a piece/section of code that you find for something and expect it to automatically work, usually at least minor changes need to be made, or you have to search for another section and add it in that relates to it. Often, it's best to make something like this yourself, so you actually understand exactly how it works instead of having to guess-and-check.
|
ef yhu hud red thu post bye spunky girl yu woulde hadde realise tha she hasd erything yhu needed. I am witing wike vis becoz i honesgyl fink ne1 can wunderstand ma mumblings and shuwdntun bwe gugementele.
P.S: the ending of your last post clearly show that you want someone to do it for you.. but we arent here to "code" for you but to help you along the way. So take the advice and actually read the guide! some pointers.. dont copy and paste, tweak the errors :) mob |
The .summoner mucked me up but then i relized it didn't need to be replace it needed to be remove. Thanks for helping with a point, and with the coding :)
|
i am stuck on the clone again sadly i got it to apper the way i wanted it to but sadly i can't get it to move around it around i checked out some demo's and this is what i came up with there's and error can u help me sovle it plz.
mob Clone New() flick('Clone.dmi',usr) verb Clone() var/mob/Clone/m=new/mob/Clone m.overlays+=usr.overlays m.underlays+=usr.underlays m.overlays-=src.underlays m.Move(get_step(usr,usr.dir,)) Clone_walk_to() if(src.client) return 0 else for(var/mob/M in oview(10,src)) if(M.client) if(get_dist(src,M) <= 10) walk_to(src,M,1,10) Clone_check_dist(src,M)// error ??? proc Delete() for(var/mob/Clone/mob in world) if(mob==usr) Del(mob) proc Poff(mob/M) src << "You kill [src]!" M << "You have been killed!" if(M.Health <= 0) src.death(M) del src |
I believe it's your "client check" in your Clone_walk_to() proc. If a player is the one calling the verb (which I bet is the case), it will simply return and nothing will happen.
It appears that you do not know the difference between usr and src. usr refers to the caller of a verb or proc src refers to the parent of the verb or proc |
Well i thought that it was the usr is you and the clone is the src is that not right? I am talking in a lesser sence now and by this do u mean i had to change this?
Clone_walk_to() if(usr.client) |
i badly need help i can't over come this i can understand why this wont work
mob Clone New() flick('Clone.dmi',usr) verb Clone() if(Chakra >= 10) var/mob/Clone/m=new/mob/Clone m.overlays+=usr.overlays m.underlays+=usr.underlays m.Move(get_step(usr,usr.dir,)) usr.HurtChakra(10) follow(mob/M) walk_to(usr,M,get_dist(src,M),30) proc Delete() for(var/mob/Clone/mob in world) if(mob==usr) Del(mob) well i can't get the clone to follow it wont seem to do it is it because i have it as i verb should it be a proc and with the delete do i have to make a verb call delete on my usr ? |