20-08-2006, 05:31 AM
Tutorial/Code by: DarkX
(Refrence for this code is from the second part of the tutorial)
Ok this is my first actual tutorial, ONLY the first half is mine, here is the tutorial for any one who hasn't already figured it out: Attribute fill button!
open frmMirage and find your mapeditor then the attributes part, then make a new command button name it cmdFill2 with the caption Fill then double click it and the code below.
If you have the TILE_TYPE_KILL and TILE_TYPE_HEAL in your version then take out the ' behind each of them. to add more of them just add another line of code like this(do be sure to add the names of the option buttons you have). Thats all, now test it out, you should now have a working attrib fill button.
-------------------------------------------------------------------------------------
Ok here's the 2nd part for the map editor fill button
Tutorial/Code by: Lucidar
'make a button called cmdFill
'put the following code inside it:
'
'If you have the extra layers added, just remove the ' from each tile you have.
'With a little editting you can do the same for attributes
'and thaTS ALLL!!!!!!
(Refrence for this code is from the second part of the tutorial)
Ok this is my first actual tutorial, ONLY the first half is mine, here is the tutorial for any one who hasn't already figured it out: Attribute fill button!
open frmMirage and find your mapeditor then the attributes part, then make a new command button name it cmdFill2 with the caption Fill then double click it and the code below.
Code:
Private Sub cmdFill2_Click()
Dim y As Long
Dim x As Long
For y = 0 To MAX_MAPY
For x = 0 To MAX_MAPX
If frmMirage.optAttribs.Value = True Then
With Map.Tile(x, y)
If frmMirage.optBlocked.Value = True Then .Type = TILE_TYPE_BLOCKED
If frmMirage.optWarp.Value = True Then .Type = TILE_TYPE_WARP
'If frmMirage.optKill.Value = True Then .Type = TILE_TYPE_KILL
If frmMirage.optItem.Value = True Then .Type = TILE_TYPE_ITEM
'If frmMirage.optHeal.Value = True Then .Type = TILE_TYPE_HEAL
If frmMirage.optNpcAvoid.Value = True Then .Type = TILE_TYPE_NPCAVOID
If frmMirage.optKey.Value = True Then .Type = TILE_TYPE_KEY
If frmMirage.optKeyOpen.Value = True Then .Type = TILE_TYPE_KEYOPEN
End With
End If
Next x
Next y
End Sub
Code:
If frmMirage.optW/E.Value = True Then .Type = TILE_TYPE_W/E
-------------------------------------------------------------------------------------
Ok here's the 2nd part for the map editor fill button
Tutorial/Code by: Lucidar
'make a button called cmdFill
'put the following code inside it:
'
Code:
Dim y As Long
Dim x As Long
For y = 0 To MAX_MAPY
For x = 0 To MAX_MAPX
If frmMirage.optLayers.Value = True Then
With Map.Tile(x, y)
If frmMirage.optGround.Value = True Then .Ground = EditorTileY * 7 + EditorTileX
If frmMirage.optMask.Value = True Then .Mask = EditorTileY * 7 + EditorTileX
If frmMirage.optAnim.Value = True Then .Anim = EditorTileY * 7 + EditorTileX
'If frmMirage.optMask2.Value = True Then .Mask2 = EditorTileY * 7 + EditorTileX
'If frmMirage.optM2Anim.Value = True Then .M2Anim = EditorTileY * 7 + EditorTileX
If frmMirage.optFringe.Value = True Then .Fringe = EditorTileY * 7 + EditorTileX
'If frmMirage.optFAnim.Value = True Then .FAnim = EditorTileY * 7 + EditorTileX
'If frmMirage.optFringe2.Value = True Then .Fringe2 = EditorTileY * 7 + EditorTileX
'If frmMirage.optF2Anim.Value = True Then .F2Anim = EditorTileY * 7 + EditorTileX
End With
End If
Next x
Next y
'With a little editting you can do the same for attributes
'and thaTS ALLL!!!!!!