ID:269246
 
For a random battle system, I would like to know how to create a new map for the player.

I have seen some demos, but I am not quite sure how to go about doing this!(PS, Thats all I need help with, Im not asking on random battle, etc, I can do all but this.)

Simply here is what I am trying to do
1 - Create a new map the player goes to when in battle
2.Add turfs to it.


You don't have to write the whole code either, a simple push in the right direction would help.
the only 2 ways i can think of doing this is

1: move the play to a empty part of the map and draw the turfs onto it and so on

2: move the player and draw the field (if its turn based)
onto the screen.
In response to Zmadpeter
DM doesn't register seperate maps. It loads them all into the same basic 3-dimentional array (rather, I think it's a two-dimentional array, or an array of arrays, but that doesn't really matter here.), meaning that if you have two .dmp files, they will simply be on different z-levels. If map #1 has 5-layers, and map #2 has seven, map # 2 starts at Z-layer 6, and ends at 12.

If one map is larger than the other in any one planar dimention (meaning x or y), it will stretch the boundaries of the smaller map to alot for the larger one. The default turf object will be put in place in the new expanded areas.

Essentially, to generate the random battle area, you are going to literally have to add to the world.maxz variable and then manually place the turfs with code. This ia little bit tough, and I suspect it may be beyond your level of skill.

To be absolutely honest, I think it would be much easier to dedicate a few Z-layers to battle maps. This way, you won't have to deal with creating a datum-based battle management system.

Simply paint your battle areas onto the map somewhere, and find some method of recording which are in use.

if you have something like a Dragon Warrior battle system, you could simply use the client's screen as the battlefield...

Check the DM Reference for these topics:

turfs
screen
maxz
SwapMaps was designed partly with this in mind. It can create a new battle map based on a template, which is temporary and will be deleted when you no longer need it.

Lummox JR
In response to Ter13
I have done that before. I created a battle system in which the map had 20 open spaces. If would loop through a proc and find a emtpy battle space, in which it would locate the player and begin the battle.

Well, for now I will stick to just doing that.

My BYOND coding skill level is not low, there are just a few things I ask that may be beginner sounding, becuase I have never had to use them before.