Mirage Engine
How to make a frmMapEditor - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: Resources (https://mirage-engine.uk/forums/forumdisplay.php?fid=49)
+---- Thread: How to make a frmMapEditor (/showthread.php?tid=864)

Pages: 1 2


How to make a frmMapEditor - Styre - 09-04-2007

Made it with help of William, Robin, Advocate and Obsidian. Because of my lak of ability in being creative with my code, and not having a basic rundown on how to do it.

I'll share the way how I did it.

//:::::::::::::::::::::\\
||:::::Client Side::::||
\\::::::::::::::::::::://

Make a new form and call it: frmMapEditor

In frmMirage find the picMapEditor, cut it.
Paste It in your frmMapEditor.
Set the picMapEditor's visibility attribute to TRUE

in frmMirage's code find:

Code:
' // MAP EDITOR STUFF //

Private Sub optAttribs_Click()
    If optAttribs.Value = True Then
        fraLayers.Visible = False
        fraAttribs.Visible = True
    End If
End Sub
Private Sub picBackSelect_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    Call EditorChooseTile(Button, Shift, x, y)
End Sub

Private Sub picBackSelect_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    Call EditorChooseTile(Button, Shift, x, y)
End Sub

Private Sub cmdSend_Click()
    Call EditorSend
End Sub

Private Sub cmdCancel_Click()
    Call EditorCancel
End Sub

Private Sub cmdProperties_Click()
    frmMapProperties.Show vbModal
End Sub

Private Sub optWarp_Click()
    frmMapWarp.Show vbModal
End Sub

Private Sub optItem_Click()
    frmMapItem.Show vbModal
End Sub

Private Sub optKey_Click()
    frmMapKey.Show vbModal
End Sub

Private Sub optKeyOpen_Click()
    frmKeyOpen.Show vbModal
End Sub

Private Sub scrlPicture_Change()
    Call EditorTileScroll
End Sub

Private Sub cmdClear_Click()
    Call EditorClearLayer
End Sub

Private Sub cmdClear2_Click()
    Call EditorClearAttribs
End Sub

Cut this and paste it in the frmMapeditor's code.

In modHandleData find:

Code:
frmMirage.picMapEditor.Visible = False

and change it with

Code:
frmMapeditor.Visible = False

In modGameLogic find:

Code:
Public Sub EditorInit()
frmMirage.picMapEditor.Visible = True
    With frmMirage.picMapEditor.picBackselect

And replace it with:

Code:
Public Sub EditorInit()
frmMapEditor.Visible = True
    With frmMapEditor.picBackSelect

Find:

Code:
Public Sub EditorMouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)

Replace the whole sub with:

[code]
Public Sub EditorMouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim x1, y1 As Long

If InEditor Then
x1 = Int(x / PIC_X)
y1 = Int(y / PIC_Y)
If (Button = 1) And (x1 >= 0) And (x1 = 0) And (y1 = 0) And (x1 = 0) And (y1


- JokeofWeek - 09-04-2007

Dang, the day after I implement this in my source, someone remakes a tut for it :lol: It's all good though, I did pretty much the same things, grats on the tutorial though Big Grin


- Reece - 09-04-2007

Me and funky was talking about this on TS. Personally this is a silly thing to do (unless you made it always on top like funky suggested) Have you ever mapped with the map editor outside the client? it's fucking hard.

Imo, just my opinion.


- Boo - 09-04-2007

its not outside client, it just loads an new form isntead of an picture box >.>


- Robin - 09-04-2007

http://www.animerealm.co.uk/uploads/tutorials/Temporary_Archive/Admin%20Panel%20Tut.html

:lol:


- Boo - 09-04-2007

what is that for?


- JokeofWeek - 09-04-2007

Boo Wrote:what is that for?

It's for making an admin panel, even though that has nothing to do with the map editor out in it's own form. :lol:


- Reece - 09-04-2007

Boo Wrote:its not outside client, it just loads an new form isntead of an picture box >.>

I know what it does. I'm just saying its much harder for mappers having the map editor on the outside.


- Boo - 09-04-2007

i guess it sorta gets in way but then u can expand it Smile


- Robin - 10-04-2007

Sorry, firefox crashed and I didn't re-read my post before I Restored my session and pressed post.

I was just saying what would be a nice addition, instead of having everything pop up everywhere, is if you have an admin panel, have the mapeditor picturebox in the same frame and load over everything else when it is called.

So one big "Admin" panel rather than lots of half-arsed spin-offs.


- Boo - 10-04-2007

hmm that just gave me an idea. I should put all the frm editors in the admin panel and just have it open in a blank spot :o!


- Boo - 10-04-2007

found a bug in tut, in...

Code:
Public Sub EditorInit()
frmMapEditor.Visible = True
    With frmMapEditor.Visible = True

It highlights 'With' for
Quote:With object must be user-defined type, Object, or Varient

Any idea? Smile


- Robin - 10-04-2007

Boo Wrote:found a bug in tut, in...

Code:
Public Sub EditorInit()
frmMapEditor.Visible = True
    With frmMapEditor.Visible = True

It highlights 'With' for
Quote:With object must be user-defined type, Object, or Varient

Any idea? Smile

Oh dead God you seriously are retarded.

You could split that up, and change it to

Code:
With frmMapEditor
  .Visible = True
end with

Or just delete the with

Code:
frmMapEditor.visible = true



- Boo - 10-04-2007

thats what i did, i was just making sure lol xD


- Styre - 10-04-2007

Oops did that wrong it the tut ,, I'll change it


- funkynut - 10-04-2007

Yep, maybe should try expand it with code to make it always stay hovering over the main window or whatever, because having it in a separate windows is annoying, when you select something, draw it on the main window, then have to search for the side window again to change


- Robin - 10-04-2007

funkynut Wrote:Yep, maybe should try expand it with code to make it always stay hovering over the main window or whatever, because having it in a separate windows is annoying, when you select something, draw it on the main window, then have to search for the side window again to change

I think there's a property to do that.


- Rian - 10-04-2007

Having the frmMapEditor on top is a must, it does get very annoying. My client is fitted perfectly for an 800x600 screen though, so unless your resolution is actually 800x600 (and I doubt many people still have screens that small) the frmMirage and frmMapEditor fit neatly beside each other.


- funkynut - 10-04-2007

Well I know when you open a window, you can set the window to have priority over the other by using vbmodal, but It doesn't allow you to use the window its staying on top of.

You could also use vbmodalless or something, but I think that just resets it to standard.

I do have an edited module from planetsourcecode that does it


- Styre - 10-04-2007

You cou;d also move it to the side of the window if you don't want to search :S And if you don't think it's handy then don't use it. No offense, I made it for poeple who wanted it, people like me Tongue


- funkynut - 10-04-2007

I'm not saying its useless, just suggesting its annoying for admin with low res screens, so maybe should add the ability to hook it so it always stays above main screen but in its own window..


- Styre - 12-04-2007

d'you think someone has a res lower then 800*600 these days?


- Reece - 12-04-2007

People who run text based games usually do Wink


- Styre - 12-04-2007

The text based game i play has a screen res, req. of 1024*sumthing


- funkynut - 12-04-2007

Do you think anyone who plays (no offence) crappy ms games, would have a computer good enough, worthwhile enough to have higher res? (perhaps its their parents computer, perhaps they have old monitor, perhaps their gfx card sucks, 100's of possibility's)

And what if they maximise the game? Then it covers the whole screen, and a lot of people do that...