Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sequential Numbering Script?

Hi folks,
Pardon me for being too lazy to open up the scripting pdf, but is there a plugin that will place sequential numbers on a map?

I've got the map, and now I would just like to click ->1, click-> 2, etc.

thanks,
J

Comments

  • No, not that I'm aware of.

    Here's a very quick and hacky custom tool (extra emphasis on very and hacky) based on the Random City Name tool that places an incremented label every time the map is clicked. You'd need to tweak the font size to whatever is appropriate for your map. So try it on a blank map of the same size first.

    Save this as LabelCounter.FMScript in the /Plugins directory and restart FM. It'll show up on the Custom Tools palette (though it uses the same icon as the random city name, so you'll have to hover over the tools to see which is which).

    #author             NBOS Software
    #desc               Increments a label as the map is clicked
    #customtool         Label Counter
    #toolbase           Circle
    #toolset            Custom Tools
    #button         RandomCityName.bmp
    
    Dim o, oT
    Dim n, m
    Dim CitySize
    Dim x, y
    Dim sLang, sFont
    Dim GroupID
    
    sFont = "Times New Roman" 
    
    o = GetLastMapObject()
    
    map = GetCurrentMap()
    
    sCnt = map.GetField( "LastCount")
    nCnt = 0
    If Len( sCnt) < 1 Then
        nCnt = 0
    Else
        nCnt = CInt( sCnt)
    End If
    
    nCnt = nCnt + 1
    
    oT = CreateMapObject( "Text")
    oT.Text = CStr( nCnt)
    
    map.SetField "LastCount", CStr( nCnt)
    
    oT.FontSize = 72 * 4000
    oT.BrushColor = rgb( 0, 0, 0)
    oT.PenColor = Rgb( 0, 0, 0)
    
    '----- Add the objects to the map
    
    oT.AddPoint o.GetPointX(1), o.GetPointY(1)
    oT.AddPoint o.GetPointX(1), o.GetPointY(1)+ 200
    
    oT.AddPoint o.GetPointX(1)+600000, o.GetPointY(1)
    oT.AddPoint o.GetPointX(1)+600000, o.GetPointY(1)+200000
    oT.FontName =  sFont
    
    '----- Delete the circle because we no longer need it
    map.DeleteObject( map.ObjectCount)
    
    '----- Add the text
    n = map.AddObject( oT)
    
  • Thanks, very much - will try this tonight!

  • Yep, works great. I adjusted the font and the pen color to suit.

    On a large dungeon map, this is a great time saver.

Leave a Comment