Mirage Source

Free ORPG making software.
It is currently Thu Mar 28, 2024 5:00 pm

All times are UTC


Forum rules


Make sure your tutorials are kept up to date with the latest MS4 releases.



Post new topic Reply to topic  [ 1690 posts ]  Go to page 1, 2, 3, 4, 5 ... 68  Next
Author Message
PostPosted: Sat Aug 01, 2009 4:37 pm 
Offline
Knowledgeable
User avatar

Joined: Sun Nov 19, 2006 6:59 pm
Posts: 213
Map Editor In Its Own Form
Difficulty: 2/5 - This is a fairly easy tutorial, just make sure you follow the directions properly!
This is another thing that there used to be a tutorial for, but it is now gone. So I am re-writing a new tutorial for it! All this does is basically puts the map editor in a form, letting you move it around freely.

Client Side
First things first, make a new form called frmMapEditor

frmMirage
    Open up the code for frmMirage. Cut out the following code:
    Code:
    Private Sub optLayers_Click()
        If optLayers.Value Then
            fraLayers.Visible = True
            fraAttribs.Visible = False
        End If
    End Sub

    Private Sub optAttribs_Click()
        If optAttribs.Value 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)
        If Button = vbLeftButton Then
            Call MapEditorChooseTile(X, Y)
        End If
    End Sub
     
    Private Sub picBackSelect_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        shpLoc.Top = (Y \ PIC_Y) * PIC_Y
        shpLoc.Left = (X \ PIC_X) * PIC_X
       
        shpLoc.Visible = True
    End Sub

    Private Sub cmdSend_Click()
        Call MapEditorSend
    End Sub

    Private Sub cmdCancel_Click()
        Call MapEditorCancel
    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 MapEditorTileScroll
    End Sub

    Private Sub cmdFill_Click()
        MapEditorFillLayer
    End Sub

    Private Sub cmdClear_Click()
        Call MapEditorClearLayer
    End Sub

    Private Sub cmdClear2_Click()
        Call MapEditorClearAttribs
    End Sub

    Private Sub scrlTileSet_Change()
        Map.TileSet = scrlTileSet.Value
        lblTileset = scrlTileSet.Value
       
        Call InitTileSurf(scrlTileSet)
       
        Call BltMapEditor
        Call BltMapEditorTilePreview

        scrlPicture.Max = (picBackSelect.Height \ PIC_Y) - (picBack.Height \ PIC_Y)
    End Sub

    and paste it into the code for your new form! Then go back to the GUI editing mode (Where you can drag around the commands) and copy picMapEditor and all it's contents (the actual map editor) into the new form, then deleting them from frmMirage.

    IMPORTANT: Set the Visible property of picMapEditor to true!!!

    Now, look for sub picScreen_MouseMove and replace the following line :
    Code:
            shpLoc.Visible = False

    With :
    Code:
            frmMapEditor.shpLoc.Visible = False

modGameEditors
    First things first, go to the sub MapEditorInit. Look for the following snippet of code:
    Code:
        With frmMirage
            .Width = 14175
            .picMapEditor.Visible = True
            .lblTileset = Map.TileSet
            .scrlTileSet = Map.TileSet
            .scrlPicture.Max = (.picBackSelect.Height \ PIC_Y) - (.picBack.Height \ PIC_Y)
        End With

    And replace it with :
    Code:
       
        With frmMapEditor
            .Show
            .lblTileset = Map.TileSet
            .scrlTileSet = Map.TileSet
            .scrlPicture.Max = (.picBackSelect.Height \ PIC_Y) - (.picBack.Height \ PIC_Y)
        End With


    Now, go to sub MapEditorMouseDown, and replace every frmMirage.blablabla with frmMapEditor.blablabla. Do the same for the subs MapEditorChooseTile, MapEditorTileScroll. MapEditorClearLayer and MapEditorFillLayer.

    Now, go to sub MapEditorCancel and replace the following :
    Code:
        With frmMirage
            .Width = 10080
            .picMapEditor.Visible = False
        End With


    With :
    Code:
    frmMapEditor.Visible=false


modDirectDraw7
    Now, go to sub BltMapEditor and replace every frmMirage.blablabla with frmMapEditor.blablabla. Do the same for the sub BltMapEditorTilePreview.

    Now go to sub Render_Graphics and look for the following code :
    Code:
            If Editor = EDITOR_MAP Then
                If frmMirage.optAttribs.Value Then
                    Call DrawMapAttributes
                End If
            End If
           

    And replace it with :
    Code:
            If Editor = EDITOR_MAP Then
                If frmMapEditor.optAttribs.Value Then
                    Call DrawMapAttributes
                End If
            End If


modDatabase
    Look for sub CheckTiles. Replace the line :
    Code:
        frmMirage.scrlTileSet.Max = NumTileSets

    With :
    Code:
        frmMapEditor.scrlTileSet.Max = NumTileSets


modHandleData
    Now, look for sub HandleMapData. Look for the following line:
    Code:
            frmMirage.picMapEditor.Visible = False

    And replace it with :
    Code:
            frmMapEditor.Visible = False


And there you go! Enjoy :D If you have any problems, just ask! :)

_________________
Image


Top
 Profile  
 
PostPosted: Sat Aug 01, 2009 5:18 pm 
Offline
Persistant Poster
User avatar

Joined: Thu Jul 24, 2008 6:42 am
Posts: 703
Google Talk: infectiousbyte@gmail.com
Pretty sweet tutorial. Though, I must say it's not that great of an idea to have a lot of forms. If you can cut down and have as least forms as possible, that's the best. They take up memory/space, etc, etc. Though it can certaintly be more convenient.

_________________
Image
GIAKEN wrote:
Since I'm into men, not women

GIAKEN wrote:
I can't take these huge penises anymore! All that's left is shame! And blood


Top
 Profile  
 
PostPosted: Mon Aug 03, 2009 5:50 am 
Offline
Banned
User avatar

Joined: Mon Jun 05, 2006 9:22 pm
Posts: 394
Location: USA
Best thing to do is completely remove the mapeditor and make it a separate program for developers and then remove all that dev crap from the client. :)


Top
 Profile  
 
PostPosted: Tue Aug 04, 2009 9:10 pm 
Offline
Knowledgeable

Joined: Sun Jan 13, 2008 5:59 pm
Posts: 107
;D
I made a suckier version of this tutorial <3


Top
 Profile  
 
PostPosted: Sun Aug 09, 2009 1:46 pm 
Offline
Regular

Joined: Sun Sep 30, 2007 9:59 pm
Posts: 27
Here an idea. What about making the map editor as a different app?


Top
 Profile  
 
PostPosted: Wed Dec 01, 2021 9:25 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтsemiasphalticfluxсайтсайтсайт
сайтсайтсайтсайтсайтсайтhttp://taskreasoning.ruсайтсайтсайтинфосайтсайтtuchkasсайтсайт


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:12 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Econ


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:13 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
120.1


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:15 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:16 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Bett


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:17 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Thom


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:18 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Know


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:19 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Jane


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:20 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
June


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:21 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Gilb


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:22 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Zodi


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:24 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Clan


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:25 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Fisk


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:26 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Ruco


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:27 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Kara


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:28 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Thin


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:29 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Eleg


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:30 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Toni


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:31 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Eliz


Top
 Profile  
 
PostPosted: Sat Jan 08, 2022 3:32 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Vilo


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1690 posts ]  Go to page 1, 2, 3, 4, 5 ... 68  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group