ID:173890
![]() Nov 2 2003, 3:07 pm
|
|
Can someone help me out on making a Pushing/Pulling Verb?
|
Malver wrote:
CrazyFighter wrote: mob/verb Thanks |
I feel guilty that I provided this code without explaining how it works. The last thing I want is a simple copy+paste job without you understanding what you've done. Here's a commented version:
mob/verb Hope that clarifies. Play around with the code to get a better understanding as to how it works. Trust me, the last thing you want to do is copy+paste code without knowing how it works. |
He forgot to add the ",180" as the last paramiter.
Does step() check for dense objects before it moves something? |
Push()
var/obj/O = locate() in get_step(src,src.dir) if(O) step(O,src.dir) Pull() var/obj/O = locate() in get_step(src,src.dir) if(O) step(src,turn(get_dir(O,src),180)) ------->step(O,turn(src.dir))<------- I PUT THAT but it says Turn:Expected 2 arguments found 1 one the one pointed to! |
Shadow9191 wrote:
------->step(O,turn(src.dir))<------- It means it's expecting 2 arguments for turn(), not for step(). You need to add the argument after src.dir; for example: <code>step(O,turn(src.dir, 180))</code> |
Hey when i put the code it works and every thing but when he pulls he waqlks forwasrd how do i fix that?
|
When i try to pull the item he moves forwaard...i want him to move backward so that he moves with the item now when i try to move some thing with density he wont do it cuz he wants to move foreward PLZ HELP!
|
Don't bump your post three times within six hours. This is a FORUM, not a chatroom. If you hadn't been so rude about bumping, I might actually be inclined to help you.
|
I would also Like to know how to do this to I have fixed the pushing so now he walks with the boulder but the pull does not completely work I have the boulder to move but not him.
obj/Boulder icon = 'Turfs.dmi' icon_state = "Rock1" density = 1 verb Push() set src in oview(1) var/obj/O = locate() in get_step(usr,usr.dir) if(O) step(O,usr.dir) step(usr,O.dir) Pull() set src in oview(1) var/obj/O = locate() in get_step(usr,usr.dir) if(O) step(usr,turn(get_dir(O,src),180)) step(O,turn(usr.dir,180)) |
Without offering specifics, this is the most I can give: