ID:160480
![]() Sep 3 2008, 5:45 am
|
|
ok, so I've been trying to do this for couple of days now, so how do I do attacking system where you first target ur opponent and when ur next to him, u attack him? I've tried this but my game crashes when I target opponent :/
|
![]() Sep 3 2008, 8:11 am
|
|
Would depend how you plan on targetting. If your game is crashing, you could post what code you may have so we can see why it might be doing so.
|
How do you go about doing the "targetting" part of the process? Do you click to target? Do you use a verb to target? What?
As for the attacking part, I'm sure it would have to go into the an Attack proc. Something along the lines like: "for mob in oview..." (if not view or get_step) "...Attack()". Where 'Attack()' is calling the attack proc. That's what it would be if you did a DM to English translation. I'm not totally sure how you'd code it. |
My targeting is by clicking. I put my current code here now (doesn't crash anymore)
There isn't no attacking as it only says hi everyone when ur next to target, or atleast it should do that :D mob |
Why are you creating a loop there with the goto start. Its set to the background so the error doesnt come up and shouldnt crash but your creating an invinte loop there is that what you want. The only thing i can think of that would be useful to do that (and only barely) is if you wanted it to say hi everytime you get close but theres better ways to do that.
|
Syntty wrote:
My targeting is by clicking. I put my current code here now (doesn't crash anymore) mob getTarget(var/mob/M)//name of the proc I don't think the loop inside a loop helps either. I'll update this (maybe) with a small example. |
Here's some crap with some useless code in it. :)
mob |