ID:161298
 
Well, as the title says a friend of mine is trying to code an attack that attacks all possible targets on screen instead of just one mob. He coded the attack to attack one target because his attempt at everything wasn't working and it worked so it isn't the attack itself so if anyone knows how to do that we'd be greatly appreciative if you could help us.
THESINKING wrote:
Well, as the title says a friend of mine is trying to code an attack that attacks all possible targets on screen instead of just one mob.

You'll want to loop through everyone in the attacker's oview() then, and attack each one in it.
In response to Kaioken
So by that do you mean code the attack to start at closest mob *for example* and continue attacking all possible mobs on screen until there is nothing left to attack?
In response to THESINKING
By that I mean that, you should have a for() loop that loops through a list of the mobs the attacker can see, which can be obtained by calling oview(attacker), and attacks a mob each iteration. The basic effect is what you've said, yes.
In response to Kaioken
Hmm... I'm not a coder so I have no idea what those commands do... if I provided the basic attack coding would you be able to code in what you are saying so I can mimic it to the other attacks?
In response to THESINKING
THESINKING wrote:
Hmm... I'm not a coder so I have no idea what those commands do...

Well, if you're not one, then what are you doing here? Should've sent your friend here to create his topic.

if I provided the basic attack coding would you be able to code in what you are saying so I can mimic it to the other attacks?

Sure I could, but I don't want to, since it won't get you anywhere anyway, unless I make the rest of the game for you as well, maybe.
In response to Kaioken
Well, if you're not one, then what are you doing here? Should've sent your friend here to create his topic.

Well he's not one for asking for help but ok nvm than.

Sure I could, but I don't want to, since it won't get you anywhere anyway, unless I make the rest of the game for you as well, maybe.

Ok well thank you for at least explaining what he needs to do in a way...