ID:178918
 
When I go to host my game, only one person can be in battle at a time. How can I make it so that more than one person that is in the world can be in battle? Here is the code for the entering battle proceedure. Thanks.

-------

mob/proc

//40% chance of searching for unoccupied area and beginning combat.
randomencounter1(mob/M as mob)
var
turf
battlearea
T
var
mon
randomnum
if(usr.preslocation !="town")
if (prob(40))
for(T in world)
if(!T.occupied)
M.battlearea = T
T.occupied = 1
M.oldlocx = M.x
M.oldlocy = M.y
M.oldlocz = M.z
M.battlearea = T
M.invisibility = 1
spawn(1)M.Move(usr.battlearea)
M.oldbattlefield = M.onbattlefield
M.onbattlefield = null
if(usr.preslocation == "ryuzak")
randomnum = rand(0,1)
if (randomnum == 0)
mon = new /mob/slime(locate(M.battlearea.x,M.battlearea.y+1,M.battleare a.z))
else
mon = new /mob/raven(locate(M.battlearea.x,M.battlearea.y+1,M.battleare a.z))
if(usr.preslocation == "ryuzak-atlancave")
randomnum = rand(0,2)
if (randomnum == 0)
mon = new /mob/slime(locate(M.battlearea.x,M.battlearea.y+1,M.battleare a.z))
else if (randomnum == 1)
mon = new /mob/raven(locate(M.battlearea.x,M.battlearea.y+1,M.battleare a.z))
else
mon = new /mob/hornedrabbit(locate(M.battlearea.x,M.battlearea.y+1,M.ba ttlearea.z))
if(usr.preslocation == "atlan")
randomnum = rand(0,2)
if (randomnum == 0)
mon = new /mob/giantanteater(locate(M.battlearea.x,M.battlearea.y+1,M.b attlearea.z))
else if (randomnum == 1)
mon = new /mob/babble(locate(M.battlearea.x,M.battlearea.y+1,M.battlear ea.z))
else
mon = new /mob/scorpionwasp(locate(M.battlearea.x,M.battlearea.y+1,M.ba ttlearea.z))
maincombat(usr, mon)
return 1
return 0
Sincs it looks like Zagreus's Random Combat Demo i will be able to help you easily.
You know the batter area
where the character goes when they encounter an enemy.
Well if you do know, all you need to do is make more of those but in different areas
v=void b=battle area m=monster
v v v v v
v v m v v
v v v v v
v v b v v
v v v v v
thats what you probablly have down
and you would want to put another one right next to it so it would look like this
v v v v v v v v v v
v v m v v v v m v v
v v v v v v v v v v
v v b v v v v b v v
v v v v v v v v v v
you would want to make more of those.
the code checks for the battle area and if the battle area is occupied it looks for another one
thats all you need to do
In response to Richter
I have a couple in the game, but sometimes it likes to fill the empty ones with copies of myself, so i'm fighting multiple enemies.