Mirage Source

Free ORPG making software.
It is currently Sat Apr 27, 2024 5:07 pm

All times are UTC




Post new topic Reply to topic  [ 65 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Mon Apr 09, 2007 4:54 pm 
Offline
Regular

Joined: Thu Mar 22, 2007 3:32 pm
Posts: 31
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 <= MAX_MAPX) And (y1 >= 0) And (y1 <= MAX_MAPY) Then
            If frmMapeditor.optLayers.Value = True Then
                With Map.Tile(x1, y1)
                    If frmMapeditor.optGround.Value = True Then .Ground = EditorTileY * 7 + EditorTileX
                    If frmMapeditor.optMask.Value = True Then .Mask = EditorTileY * 7 + EditorTileX
                    If frmMapeditor.optAnim.Value = True Then .Anim = EditorTileY * 7 + EditorTileX
                    If frmMapeditor.optFringe.Value = True Then .Fringe = EditorTileY * 7 + EditorTileX
                End With
            Else
                With Map.Tile(x1, y1)
                    If frmMapeditor.optBlocked.Value = True Then .Type = TILE_TYPE_BLOCKED
                    If frmMapeditor.optWarp.Value = True Then
                        .Type = TILE_TYPE_WARP
                        .Data1 = EditorWarpMap
                        .Data2 = EditorWarpX
                        .Data3 = EditorWarpY
                    End If
                    If frmMapeditor.optItem.Value = True Then
                        .Type = TILE_TYPE_ITEM
                        .Data1 = ItemEditorNum
                        .Data2 = ItemEditorValue
                        .Data3 = 0
                    End If
                    If frmMapeditor.optNpcAvoid.Value = True Then
                        .Type = TILE_TYPE_NPCAVOID
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                    End If
                    If frmMapeditor.optKey.Value = True Then
                        .Type = TILE_TYPE_KEY
                        .Data1 = KeyEditorNum
                        .Data2 = KeyEditorTake
                        .Data3 = 0
                    End If
                    If frmMapeditor.optKeyOpen.Value = True Then
                        .Type = TILE_TYPE_KEYOPEN
                        .Data1 = KeyOpenEditorX
                        .Data2 = KeyOpenEditorY
                        .Data3 = 0
                    End If
                End With
            End If
        End If
       
        If (Button = 2) And (x1 >= 0) And (x1 <= MAX_MAPX) And (y1 >= 0) And (y1 <= MAX_MAPY) Then
            If frmMapeditor.optLayers.Value = True Then
                With Map.Tile(x1, y1)
                  If frmMapeditor.optGround.Value = True Then .Ground = 0
                  If frmMapeditor.optMask.Value = True Then .Mask = 0
                  If frmMapeditor.optAnim.Value = True Then .Anim = 0
                  If frmMapeditor.optFringe.Value = True Then .Fringe = 0
                End With
            Else
                With Map.Tile(x1, y1)
                    .Type = 0
                    .Data1 = 0
                    .Data2 = 0
                    .Data3 = 0
                End With
            End If
        End If
    End If
End Sub


Replace whole sub:

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


With:

Code:
Public Sub EditorChooseTile(Button As Integer, Shift As Integer, x As Single, y As Single)
    If Button = 1 Then
        EditorTileX = Int(x / PIC_X)
        EditorTileY = Int(y / PIC_Y)
    End If
    Call BitBlt(frmMapeditor.picSelect.hdc, 0, 0, PIC_X, PIC_Y, frmMapeditor.picBackSelect.hdc, EditorTileX * PIC_X, EditorTileY * PIC_Y, SRCCOPY)
End Sub


Replace whole sub:

Code:
Public Sub EditorTileScroll()


With:

Code:
Public Sub EditorTileScroll()
    frmMapeditor.picBackSelect.top = (frmMapeditor.scrlPicture.Value * PIC_Y) * -1
End Sub


Replace whole sub:

Code:
Public Sub EditorCancel()


With:

Code:
Public Sub EditorCancel()
    Map = SaveMap
    InEditor = False
    frmMapeditor.Visible = False
End Sub


Replace whole sub:

Code:
Public Sub EditorClearLayer()


with:

Code:
Public Sub EditorClearLayer()
Dim YesNo As Long, x As Long, y As Long

    ' Ground layer
    If frmMapeditor.optGround.Value = True Then
        YesNo = MsgBox("Are you sure you wish to clear the ground layer?", vbYesNo, GAME_NAME)
       
        If YesNo = vbYes Then
            For y = 0 To MAX_MAPY
                For x = 0 To MAX_MAPX
                    Map.Tile(x, y).Ground = 0
                Next x
            Next y
        End If
    End If

    ' Mask layer
    If frmMapeditor.optMask.Value = True Then
        YesNo = MsgBox("Are you sure you wish to clear the mask layer?", vbYesNo, GAME_NAME)
       
        If YesNo = vbYes Then
            For y = 0 To MAX_MAPY
                For x = 0 To MAX_MAPX
                    Map.Tile(x, y).Mask = 0
                Next x
            Next y
        End If
    End If

    ' Animation layer
    If frmMapeditor.optAnim.Value = True Then
        YesNo = MsgBox("Are you sure you wish to clear the animation layer?", vbYesNo, GAME_NAME)
       
        If YesNo = vbYes Then
            For y = 0 To MAX_MAPY
                For x = 0 To MAX_MAPX
                    Map.Tile(x, y).Anim = 0
                Next x
            Next y
        End If
    End If

    ' Fringe layer
    If frmMapeditor.optFringe.Value = True Then
        YesNo = MsgBox("Are you sure you wish to clear the fringe layer?", vbYesNo, GAME_NAME)
       
        If YesNo = vbYes Then
            For y = 0 To MAX_MAPY
                For x = 0 To MAX_MAPX
                    Map.Tile(x, y).Fringe = 0
                Next x
            Next y
        End If
    End If
End Sub


And That's it realy, Have fun.

--Cheers Styre

EDIT: Typo pointed out by boo


Last edited by Styre on Tue Apr 10, 2007 2:19 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 6:56 pm 
Offline
Knowledgeable
User avatar

Joined: Sun Nov 19, 2006 6:59 pm
Posts: 213
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 :D


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 8:18 pm 
Offline
Knowledgeable
User avatar

Joined: Mon May 29, 2006 11:38 am
Posts: 293
Location: Cambridge, UK
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.

_________________
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 9:41 pm 
its not outside client, it just loads an new form isntead of an picture box >.>


Top
  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 9:43 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
http://www.animerealm.co.uk/uploads/tutorials/Temporary_Archive/Admin%20Panel%20Tut.html

:lol:

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 9:47 pm 
what is that for?


Top
  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 10:06 pm 
Offline
Knowledgeable
User avatar

Joined: Sun Nov 19, 2006 6:59 pm
Posts: 213
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:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 10:08 pm 
Offline
Knowledgeable
User avatar

Joined: Mon May 29, 2006 11:38 am
Posts: 293
Location: Cambridge, UK
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.

_________________
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 09, 2007 10:12 pm 
i guess it sorta gets in way but then u can expand it :)


Top
  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 1:18 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 2:10 am 
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!


Top
  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 2:28 am 
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? :)


Top
  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 2:34 am 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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? :)


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

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 2:41 am 
thats what i did, i was just making sure lol xD


Top
  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 2:17 pm 
Offline
Regular

Joined: Thu Mar 22, 2007 3:32 pm
Posts: 31
Oops did that wrong it the tut ,, I'll change it


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 3:25 pm 
Offline
Knowledgeable

Joined: Wed May 31, 2006 8:00 pm
Posts: 142
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

_________________
xFire:- funkynut


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 4:03 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
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.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 4:42 pm 
Offline
Persistant Poster
User avatar

Joined: Tue May 30, 2006 2:07 am
Posts: 836
Location: Nashville, Tennessee, USA
Google Talk: rs.ruggles@gmail.com
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.

_________________
I'm on Facebook! Google Plus My Youtube Channel My Steam Profile

Image


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 6:14 pm 
Offline
Knowledgeable

Joined: Wed May 31, 2006 8:00 pm
Posts: 142
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

_________________
xFire:- funkynut


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 7:23 pm 
Offline
Regular

Joined: Thu Mar 22, 2007 3:32 pm
Posts: 31
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 :P


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 10, 2007 9:41 pm 
Offline
Knowledgeable

Joined: Wed May 31, 2006 8:00 pm
Posts: 142
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..

_________________
xFire:- funkynut


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 8:28 pm 
Offline
Regular

Joined: Thu Mar 22, 2007 3:32 pm
Posts: 31
d'you think someone has a res lower then 800*600 these days?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 8:59 pm 
Offline
Knowledgeable
User avatar

Joined: Mon May 29, 2006 11:38 am
Posts: 293
Location: Cambridge, UK
People who run text based games usually do ;)

_________________
Image
Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 9:02 pm 
Offline
Regular

Joined: Thu Mar 22, 2007 3:32 pm
Posts: 31
The text based game i play has a screen res, req. of 1024*sumthing


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 11:30 pm 
Offline
Knowledgeable

Joined: Wed May 31, 2006 8:00 pm
Posts: 142
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...

_________________
xFire:- funkynut


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 65 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 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:  
Powered by phpBB® Forum Software © phpBB Group