ID:266572
 
Hmm.I'm wondering how you make 2 NPCs fight in a certain place.If you know,please tell me!Thanks!

-Kappa the Imp
First of all, I think that something like "NPC vs NPC battle" would be a better topic than "Question Please Help!". The only reason I even looked at this post was because I'm tired of that kind of topic name. Giving posts those sort of names pretty much makes the topic useless.

About the battle:
Well that depends on how you want it done. Do you want them just to walk to each other on the map and have messages show to all the players in view, with one dying after a few attacks? You could do something similar to this:

proc/npcfight()
var/dead
for(,dead<>1)
view<<"[src] slashes at his opponent!"
view<<"[src] dodges!
dead=rand(0,1)
if(dead==1)
view<<"[src] is struck by a lethal blow!"
del(src)

I doubt this is what you wanted, but you did not give enough of a description to warent any legitimate help. Be more specific.
In response to Loduwijk
Loduwijk wrote:
First of all, I think that something like "NPC vs NPC battle" would be a better topic than "Question Please Help!". The only reason I even looked at this post was because I'm tired of that kind of topic name. Giving posts those sort of names pretty much makes the topic useless.

About the battle:
Well that depends on how you want it done. Do you want them just to walk to each other on the map and have messages show to all the players in view, with one dying after a few attacks? You could do something similar to this:

proc/npcfight()
var/dead
for(,dead<>1)
view<<"[src] slashes at his opponent!"
view<<"[src] dodges!
dead=rand(0,1)
if(dead==1)
view<<"[src] is struck by a lethal blow!"
del(src)

I doubt this is what you wanted, but you did not give enough of a description to warent any legitimate help. Be more specific.

Its a topic that doesn't envolve the code that I wanted.But it is a Question.And well,thats kind of what I wanted,but I would like them to goto to eachother.And always put the
<dm> tags on your code.


-Kappa the Imp
In response to Kappa the Imp
to make them walk to each other first just add the walk_to proc at the beginning
In response to Kappa the Imp
In fact the topic actually effects who will help you, most of the good coders won't help someone who uses "Please help!!" type topics.