ID:150044
 
Ok, my currently problem is, drawing with my in game map editor. Currently, you have Replace, Replace All, Delete, Delete All, Clear. But currently you have to click one time on each space if you want to draw something. I want to be able to drag to draw the things. So lets say im draging my mouse all around the map, and i have my turf selected, I want it to add one to each loc my mouse passes over, is this possible?

The statement it uses to place a turf on the map is
new usr.turfselection.type(locate(lochere))

how can i incorperate the new mouse functions to allow me to drag the mouse around on the map, letting me place the turfs at each loc the mouse passes.

Is this possible yet? Or will i need to make a boolean var type deal when mouse over comes in?(IE. on mouse down set the boolean var to true, if the boolean var is true, on mouse over add the turf, then on mouse up set the boolean var to false.)

Thanks,
FIREking

p.s. I hope you understand what im talking about, if not, ask and I will try to clear it up.
p.s. I hope you understand what im talking about, if not, ask and I will try to clear it up.

Read up on MouseDown() and MouseUp(). That way, you just need to register MouseDown() over one turf, and MouseUp() on another. Then use a block() for the turfs contained between them (make sure you remember to check for dragging off the map, etc.) and change each turf in the block one-by-one.

You'd probably need to use client/MouseDown() (and client/MouseUp()), not turf/MouseDown(), because as soon as the turf that is calling the MouseDown() procedure is replaced the loop will be halted and some of the turfs won't be completely covered.
You want to place the selected turf over each spot the mouse passes, right? I think something like this will work:

atom/MouseDrag(A,B,C)
new usr.turfselection.type(C)

C is the turf that the mouse is over.
In response to Spuzzum
Spuzzum wrote:
p.s. I hope you understand what im talking about, if not, ask and I will try to clear it up.

Read up on MouseDown() and MouseUp(). That way, you just need to register MouseDown() over one turf, and MouseUp() on another. Then use a block() for the turfs contained between them (make sure you remember to check for dragging off the map, etc.) and change each turf in the block one-by-one.

You'd probably need to use client/MouseDown() (and client/MouseUp()), not turf/MouseDown(), because as soon as the turf that is calling the MouseDown() procedure is replaced the loop will be halted and some of the turfs won't be completely covered.

using block? Lets say someone selects grass, then starts at the bottom left of the map, and holds the mouse button down. Now they start moving north. Then when they get to the top, they start going right. Forming an upside down L. With block, wouldnt it just fill a huge ass square? I would rather have it draw exactley like the byond map editor. Where its like a paint brush. Is that possible?

FIREking
In response to FIREking
I continuously wonder why you aren't simply using BYOND's map editor if you want yours to be so very much like it. I know how your engine works, and I am wondering... why not just have the DM select the map to choose via shell? It would remove the entire trouble of using an in-game map editor.

-Lord of Water
In response to Lord of Water
Good point. But there is something you arent seeing. In order for that to work, the person has to have all the code for the objs and turfs. I am not releasing any of the source code. Plus, everything in the engine is of type obj. Even grass is an obj. This gives the DM more options to do at run time, such as moving a tree here or there. Or whatever. But still, I want to have the in game map editor anyways, for instance map changing during the runtime of a session. Lets say the DM wants to lock everyone up in a little cell, he could do so. Then if someone finds a secret passage, he can delete a block of the wall. Live time map editing is vital to the engine, and makes it work better.

If you disagree, thats your opinion. This certainly is my opinion that the in game map editor is vital. 50% of the engine depends on it.

FIREking
In response to FIREking
Your post was ambiguous. It isn't possible to click and drag to draw yet.
In response to Spuzzum
Maybe I'm getting what he wants wrong or something, but isn't this what he's looking for?

http://www.geocities.com/cinnomx/dragdraw.zip

Copy and paste that on your Address bar to get it.
In response to Cinnom
I haven't looked at what you put there, but what he means is to be able to draw as with a pencil. His original post didn't make that very clear ("draw on every turf the mouse passes over" could also imply dragging a selection box).