Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Map Editor Modification Help…


KDawg08
 Share

Recommended Posts

Hey I modified my Map Editor in VB6…
But I'm getting a couple errors, No error codes or anything but i know something isn't right. My Attributes aren't showing up, And My tilesheet is only showing 1 tile wide by about 10 in height, which the height is perfect the tile width is not...

Here is a screenshot of the edit in vb6

![](http://img.photobucket.com/albums/v453/Touchmynonospot/Delirium%202D/MapEditorVB1.png)

Here is an image in game…

![](http://img.photobucket.com/albums/v453/Touchmynonospot/Delirium%202D/MapEditorInGame1.png)

The vbp frm codes are EXACTLY the same aside of the resizes…
Link to comment
Share on other sites

```
[cide]Option Explicit

Dim KeyShift As Boolean

Private Sub cmdED_Click()
    If Me.MousePointer = 2 Or frmMirage.MousePointer = 2 Then
        Me.MousePointer = 1
        frmMirage.MousePointer = 1
    Else
        Me.MousePointer = 2
        frmMirage.MousePointer = 2
    End If
End Sub

Private Sub cmdExit_Click()
    Dim X As Long

    X = MsgBox("Are you sure you want to discard your changes?", vbYesNo)
    If X = vbNo Then
        Exit Sub
    End If

    Call EditorCancel
End Sub

Private Sub cmdFill_Click()
    Dim y As Long
    Dim X As Long

    X = MsgBox("Are you sure you want to fill the map?", vbYesNo)
    If X = vbNo Then
        Exit Sub
    End If

    If MapEditorSelectedType = 1 Then
        For y = 0 To MAX_MAPY
            For X = 0 To MAX_MAPX
                With Map(GetPlayerMap(MyIndex)).Tile(X, y)
                    If Me.optGround.Value Then
                        .Ground = EditorTileY * TilesInSheets + EditorTileX
                        .GroundSet = EditorSet
                    End If
                    If Me.optMask.Value Then
                        .Mask = EditorTileY * TilesInSheets + EditorTileX
                        .MaskSet = EditorSet
                    End If
                    If Me.optAnim.Value Then
                        .Anim = EditorTileY * TilesInSheets + EditorTileX
                        .AnimSet = EditorSet
                    End If
                    If Me.optMask2.Value Then
                        .Mask2 = EditorTileY * TilesInSheets + EditorTileX
                        .Mask2Set = EditorSet
                    End If
                    If Me.optM2Anim.Value Then
                        .M2Anim = EditorTileY * TilesInSheets + EditorTileX
                        .M2AnimSet = EditorSet
                    End If
                    If Me.optFringe.Value Then
                        .Fringe = EditorTileY * TilesInSheets + EditorTileX
                        .FringeSet = EditorSet
                    End If
                    If Me.optFAnim.Value Then
                        .FAnim = EditorTileY * TilesInSheets + EditorTileX
                        .FAnimSet = EditorSet
                    End If
                    If Me.optFringe2.Value Then
                        .Fringe2 = EditorTileY * TilesInSheets + EditorTileX
                        .Fringe2Set = EditorSet
                    End If
                    If Me.optF2Anim.Value Then
                        .F2Anim = EditorTileY * TilesInSheets + EditorTileX
                        .F2AnimSet = EditorSet
                    End If
                End With
            Next X
        Next y
    ElseIf MapEditorSelectedType = 2 Then
        For y = 0 To MAX_MAPY
            For X = 0 To MAX_MAPX
                With Map(GetPlayerMap(MyIndex)).Tile(X, y)
                    If Me.optBlocked.Value Then
                        .Type = TILE_TYPE_BLOCKED
                    End If
                    If Me.optWarp.Value Then
                        .Type = TILE_TYPE_WARP
                        .Data1 = EditorWarpMap
                        .Data2 = EditorWarpX
                        .Data3 = EditorWarpY
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optHeal.Value Then
                        .Type = TILE_TYPE_HEAL
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optKill.Value Then
                        .Type = TILE_TYPE_KILL
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optItem.Value Then
                        .Type = TILE_TYPE_ITEM
                        .Data1 = ItemEditorNum
                        .Data2 = ItemEditorValue
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optNpcAvoid.Value Then
                        .Type = TILE_TYPE_NPCAVOID
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optKey.Value Then
                        .Type = TILE_TYPE_KEY
                        .Data1 = KeyEditorNum
                        .Data2 = KeyEditorTake
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optKeyOpen.Value Then
                        .Type = TILE_TYPE_KEYOPEN
                        .Data1 = KeyOpenEditorX
                        .Data2 = KeyOpenEditorY
                        .Data3 = 0
                        .String1 = KeyOpenEditorMsg
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optShop.Value Then
                        .Type = TILE_TYPE_SHOP
                        .Data1 = EditorShopNum
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optCBlock.Value Then
                        .Type = TILE_TYPE_CBLOCK
                        .Data1 = EditorItemNum1
                        .Data2 = EditorItemNum2
                        .Data3 = EditorItemNum3
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optArena.Value Then
                        .Type = TILE_TYPE_ARENA
                        .Data1 = Arena1
                        .Data2 = Arena2
                        .Data3 = Arena3
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optSound.Value Then
                        .Type = TILE_TYPE_SOUND
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = SoundFileName
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optSprite.Value Then
                        .Type = TILE_TYPE_SPRITE_CHANGE
                        .Data1 = SpritePic
                        .Data2 = SpriteItem
                        .Data3 = SpritePrice
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optSign.Value Then
                        .Type = TILE_TYPE_SIGN
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = SignLine1
                        .String2 = SignLine2
                        .String3 = SignLine3
                    End If
                    If Me.optDoor.Value Then
                        .Type = TILE_TYPE_DOOR
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optNotice.Value Then
                        .Type = TILE_TYPE_NOTICE
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = NoticeTitle
                        .String2 = NoticeText
                        .String3 = NoticeSound
                    End If
                    If Me.optChest.Value Then
                        .Type = TILE_TYPE_CHEST
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optClassChange.Value Then
                        .Type = TILE_TYPE_CLASS_CHANGE
                        .Data1 = ClassChange
                        .Data2 = ClassChangeReq
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optScripted.Value Then
                        .Type = TILE_TYPE_SCRIPTED
                        .Data1 = ScriptNum
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optGuildBlock.Value Then
                        .Type = TILE_TYPE_GUILDBLOCK
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = GuildBlock
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.optBank.Value Then
                        .Type = TILE_TYPE_BANK
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                    If Me.OptGHook.Value Then
                        .Type = TILE_TYPE_HOOKSHOT
                        .Data1 = 0
                        .Data2 = 0
                        .Data3 = 0
                        .String1 = vbNullString
                        .String2 = vbNullString
                        .String3 = vbNullString
                    End If
                End With
            Next X
        Next y
    ElseIf MapEditorSelectedType = 3 Then
        For y = 0 To MAX_MAPY
            For X = 0 To MAX_MAPX
                Map(GetPlayerMap(MyIndex)).Tile(X, y).light = EditorTileY * TilesInSheets + EditorTileX
            Next X
        Next y
    End If
End Sub

Private Sub cmdGrid_Click()
    If GridMode = 0 Then
        GridMode = 1
    Else
        GridMode = 0
    End If
End Sub

Private Sub cmdScreeny_Click()
    If ScreenMode = 0 Then
        ScreenMode = 1
    Else
        ScreenMode = 0
    End If
End Sub

Private Sub cmddaynight_Click()
    If NightMode = 0 Then
        NightMode = 1
    Else
        NightMode = 0
    End If
End Sub

Private Sub cmdProp_Click()
    frmMapProperties.Show vbModal
End Sub

Private Sub cmdSave_Click()
    Dim X As Long

    X = MsgBox("Are you sure you want to make these changes?", vbYesNo)
    If X = vbNo Then
        Exit Sub
    End If

    Call EditorSend
End Sub

Private Sub cmdtype_Click(Index As Integer)
    If Index = 1 Then
        MapEditorSelectedType = 1

        Me.fraAttribs.Visible = False
        Me.fraLayers.Visible = True
        Me.frmtile.Visible = True
    ElseIf Index = 2 Then
        MapEditorSelectedType = 2

        Me.shpSelected.Width = 32
        Me.shpSelected.Height = 32

        Me.fraLayers.Visible = False
        Me.frmtile.Visible = False
        Me.fraAttribs.Visible = True
    Else
        MapEditorSelectedType = 3

        Me.fraAttribs.Visible = False
        Me.fraLayers.Visible = False
        Me.frmtile.Visible = False
        Me.Option1(10).Value = True

        Me.picBackSelect.Picture = LoadPicture(App.Path & "\GFX\Tiles10.bmp")

        EditorSet = 10

        scrlPicture.Max = Int((picBackSelect.Height - picBack.Height) / PIC_Y)
    End If
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyShift Then
        KeyShift = True
    End If
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyShift Then
        KeyShift = False
    End If
End Sub

Private Sub optClick_Click()
    frmClick.Show vbModal
End Sub

Private Sub optGuildBlock_Click()
    frmGuildBlock.Show vbModal
    frmGuildBlock.txtGuild.Text = vbNullString
End Sub

Private Sub Option1_Click(Index As Integer)
    Option1(Index).Value = True

    Me.picBackSelect.Picture = LoadPicture(App.Path & "\GFX\Tiles" & Index & ".bmp")

    EditorSet = Index

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

Private Sub optMinusStat_Click()
    frmMinusStat.Show
    frmMinusStat.scrlNum1.Value = MinusHp
    frmMinusStat.lblNum1.Caption = MinusHp
    frmMinusStat.scrlNum2.Value = MinusMp
    frmMinusStat.lblNum2.Caption = MinusMp
    frmMinusStat.scrlNum3.Value = MinusSp
    frmMinusStat.lblNum3.Caption = MinusSp
    frmMinusStat.Text1.Text = MessageMinus
End Sub

Private Sub optRoof_Click()
    frmRoofTile.Show vbModal
End Sub

Private Sub picBackSelect_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyShift Then
        KeyShift = True
    End If
End Sub

Private Sub picBackSelect_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyShift Then
        KeyShift = False
    End If
End Sub

Private Sub picBackSelect_MouseDown(Button As Integer, Shift As Integer, X As Single, y As Single)
    If Button = 1 Then
        If Not KeyShift Then
            Call EditorChooseTile(Button, Shift, X, y)

            shpSelected.Width = 32
            shpSelected.Height = 32
        Else
            EditorTileX = Int(X / PIC_X)
            EditorTileY = Int(y / PIC_Y)

            If Int(EditorTileX * PIC_X) >= shpSelected.Left + shpSelected.Width Then
                EditorTileX = Int(EditorTileX * PIC_X + PIC_X) - (shpSelected.Left + shpSelected.Width)
                shpSelected.Width = shpSelected.Width + Int(EditorTileX)
            Else
                If shpSelected.Width > PIC_X Then
                    If Int(EditorTileX * PIC_X) >= shpSelected.Left Then
                        EditorTileX = (EditorTileX * PIC_X + PIC_X) - (shpSelected.Left + shpSelected.Width)
                        shpSelected.Width = shpSelected.Width + Int(EditorTileX)
                    End If
                End If
            End If

            If Int(EditorTileY * PIC_Y) >= shpSelected.Top + shpSelected.Height Then
                EditorTileY = Int(EditorTileY * PIC_Y + PIC_Y) - (shpSelected.Top + shpSelected.Height)
                shpSelected.Height = shpSelected.Height + Int(EditorTileY)
            Else
                If shpSelected.Height > PIC_Y Then
                    If Int(EditorTileY * PIC_Y) >= shpSelected.Top Then
                        EditorTileY = (EditorTileY * PIC_Y + PIC_Y) - (shpSelected.Top + shpSelected.Height)
                        shpSelected.Height = shpSelected.Height + Int(EditorTileY)
                    End If
                End If
            End If
        End If
    End If

    If MapEditorSelectedType = 2 Then
        shpSelected.Width = 32
        shpSelected.Height = 32
    End If

    EditorTileX = Int((shpSelected.Left + PIC_X) / PIC_X)
    EditorTileY = Int((shpSelected.Top + PIC_Y) / PIC_Y)
End Sub

Private Sub picBackSelect_MouseMove(Button As Integer, Shift As Integer, X As Single, y As Single)
    If Button = 1 Then
        If Not KeyShift Then
            Call EditorChooseTile(Button, Shift, X, y)

            shpSelected.Width = 32
            shpSelected.Height = 32
        Else
            EditorTileX = Int(X / PIC_X)
            EditorTileY = Int(y / PIC_Y)

            If Int(EditorTileX * PIC_X) >= shpSelected.Left + shpSelected.Width Then
                EditorTileX = Int(EditorTileX * PIC_X + PIC_X) - (shpSelected.Left + shpSelected.Width)
                shpSelected.Width = shpSelected.Width + Int(EditorTileX)
            Else
                If shpSelected.Width > PIC_X Then
                    If Int(EditorTileX * PIC_X) >= shpSelected.Left Then
                        EditorTileX = (EditorTileX * PIC_X + PIC_X) - (shpSelected.Left + shpSelected.Width)
                        shpSelected.Width = shpSelected.Width + Int(EditorTileX)
                    End If
                End If
            End If

            If Int(EditorTileY * PIC_Y) >= shpSelected.Top + shpSelected.Height Then
                EditorTileY = Int(EditorTileY * PIC_Y + PIC_Y) - (shpSelected.Top + shpSelected.Height)
                shpSelected.Height = shpSelected.Height + Int(EditorTileY)
            Else
                If shpSelected.Height > PIC_Y Then
                    If Int(EditorTileY * PIC_Y) >= shpSelected.Top Then
                        EditorTileY = (EditorTileY * PIC_Y + PIC_Y) - (shpSelected.Top + shpSelected.Height)
                        shpSelected.Height = shpSelected.Height + Int(EditorTileY)
                    End If
                End If
            End If
        End If
    End If

    If MapEditorSelectedType = 2 Then
        shpSelected.Width = 32
        shpSelected.Height = 32
    End If

    EditorTileX = Int(shpSelected.Left / PIC_X)
    EditorTileY = Int(shpSelected.Top / PIC_Y)
End Sub

Private Sub scrlPicture_Change()
    Call EditorTileScroll
End Sub

Private Sub optArena_Click()
    frmArena.Show vbModal
End Sub

Private Sub optCBlock_Click()
    frmBClass.scrlNum1.Max = Max_Classes
    frmBClass.scrlNum2.Max = Max_Classes
    frmBClass.scrlNum3.Max = Max_Classes
    frmBClass.Show vbModal
End Sub

Private Sub optClassChange_Click()
    frmClassChange.scrlClass.Max = Max_Classes
    frmClassChange.scrlReqClass.Max = Max_Classes
    frmClassChange.Show vbModal
End Sub

Private Sub optWarp_Click()
    frmMapWarp.Show vbModal
End Sub

Private Sub optItem_Click()
    frmMapItem.scrlItem.Value = 1
    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 optNotice_Click()
    frmNotice.Show vbModal
End Sub

Private Sub optScripted_Click()
    frmScript.Show vbModal
End Sub

Private Sub optShop_Click()
    frmShop.scrlNum.Max = MAX_SHOPS
    frmShop.Show vbModal
End Sub

Private Sub optSign_Click()
    frmSign.Show vbModal
End Sub

Private Sub optSound_Click()
    frmSound.Show vbModal
End Sub

Private Sub optSprite_Click()
    If SpriteSize = 1 Then
        frmSpriteChange.picSprite.Height = 960
    End If

    frmSpriteChange.scrlItem.Max = MAX_ITEMS
    frmSpriteChange.Show vbModal
End Sub

Private Sub cmdClear_Click()
    Call EditorClearLayer
End Sub

Private Sub cmdClear2_Click()
    Call EditorClearAttribs
End Sub

Private Sub optHouse_Click()
    frmHouse.scrlItem.Max = MAX_ITEMS
    frmHouse.Show vbModal
End Sub

```
And here is a link to my newest Map Editor Form: [Thanks for taking the time to help. :)](http://rapidshare.com/files/172036998/frmMapEditor.frm.html=Custom)
Link to comment
Share on other sites

@Lenton:

> Maybe search for what the black box is called in your frmMpEditor.
>
> You might find where it resizes it.

it's called picBACK
sizes on it are weird…
Height:3600
Width:3960
ScaleHeight:240
ScaleWidth:264

I'm not sure what i'd remake these into...
Link to comment
Share on other sites

If that's just the properties of picBACK it won't make a difference to what you change them to.

picBACK's size gets changed somewhere in the source.. You need to find where it gets changed (searching is the best option) and remove that code so it stays the same to what you set it to.
Link to comment
Share on other sites

I think this would be it but the width is pretty wide for something that isn't working out…

```
    frmMapEditor.scrlPicture.Max = Int((frmMapEditor.picBackSelect.Height - frmMapEditor.picBack.Height) / PIC_Y)
    frmMapEditor.picBack.Width = 448
```
Link to comment
Share on other sites

@Tyr:

> Width:3960
> vs
> picBack.Width = 448
>
> its pretty small lol, change 488 to 3960.

Okay now what about the attributes on the bottom? That isn't a width problem it just disappears completely…

[Edit]Fixed, i clicked on it and it was set to Visible=False

Awesome, Thanks for all the help everyone, this is finally starting to make sense and work out :D

**New issue!!!!!!!!!!!**
When i try to change layers/attributes or any of that, it won't work as they're all on the same page now… Any suggestions how to fix that? it's stuck on ground layer.

**Also!!!!!!!!!!!**
When editting the map… It doesn't choose the parts that I am really clicking on to post, i click on grass and a tree trunk shows up on the ground, i click no the tree and roof tile shows up on ground...
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
@The:

> You most likely moved picBACK around. I suggest unzipping frmMapEditor to your source folder. That will set things back to default.

sorry for the late response… I did move picBACK around intentionally to match the rest to set everything up as planned but something still isn't working properly
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...