Why doesn't the MTNS macro work any longer?
I have the macro mtns, which I gleaned from somewhere ages ago, and it worked well until the Update 14. It now recognizes the command, but does nothing - it is supposed to come up with a dialogue. I use this often, especially for cliffs on big overland maps.
Can anyone tell me why it doesn't work any longer.
Here is the macro
MACRO MTNS1
ECOFF
SELSAVE
LWIDTH 0;LSTYLE solid;FSTYLE solid
GOLAYER TMPMOUNTAINS
GOLAYER TMPPATH
GOLAYER MOUNTAINS
SHEET MOUNTAINS
ASKBOX DEFAULT VALUES
Step 5
Steep side length 5
Smooth side length 10
Color 0
Line width 0
IFERR Choose
GO NoChoose
:Choose
GV RV 5
GV RV ^DEnter step value (5)
GV SL 5
GV SL ^DEnter steep side length (5)
GV SS 10
GV SS ^DEnter smooth side length (10)
GN CL 0
GN CL ^DEnter color: (0)
GV LW 0
GV LW ^DEnter line width: (0)
GO Selection
:NoChoose
GV RV 5
GV SL 5
GV SS 10
GN CL 0
Gv LW 0
:Selection
GE FL ^DSelect smooth line
IFERR MacroDone
COLOR CL
SELBY1
CHANGEL FL TMPMOUNTAINS
GV RANDOM 1234
LWIDTH LW
GLEN LV FL
GN LN LV/RV
GV PSTEP 100/LN
GV PRCV PSTEP
GP P0 % 0 FL
:DrawSide
GV LFC (1-(PRCV-50)*(PRCV-50)*0.8/2500)
IFN 100-PRCV-PSTEP/2 DrawBackBone
GP P1 % PRCV FL
GP P2 % PRCV+(PSTEP/100) FL
GBRNG BR P1 P2
GSIN RD1 RANDOM
GV RANDOM RANDOM+200
GSIN RD2 RANDOM
GV RANDOM RANDOM+200
GP P2 ref P1 <BR+90*(1+0.1*RD1),(SL*(LFC+0.1*RD2))
FPATH P1 P2;
GSIN RD1 RANDOM
GV RANDOM RANDOM+200
GSIN RD2 RANDOM
GV RANDOM RANDOM+200
GP P2 ref P1 <BR-90*(1+0.1*RD1),(SS*(LFC+0.1*RD2))
FPATH P1 P2;
GV PRCV PRCV+PSTEP
GO DrawSide
:DrawBackBone
GV PRCV PSTEP
:Loop
IFN 100-PRCV-PSTEP/2 EndLoop
GP P1 % PRCV FL
FPATH P0 P1;
GP P0 P1
GV PRCV PRCV+PSTEP
GO Loop
:EndLoop
FPATH P1 % 100 FL;
GOLAYER TMPMOUNTAINS
HIDE MOUNTAINS
ERA FL
SHOWA
GOLAYER MOUNTAINS
:MacroDone
SELREST
COLOR 0
ECON
ENDM
Can anyone tell me why it doesn't work any longer.
Here is the macro
MACRO MTNS1
ECOFF
SELSAVE
LWIDTH 0;LSTYLE solid;FSTYLE solid
GOLAYER TMPMOUNTAINS
GOLAYER TMPPATH
GOLAYER MOUNTAINS
SHEET MOUNTAINS
ASKBOX DEFAULT VALUES
Step 5
Steep side length 5
Smooth side length 10
Color 0
Line width 0
IFERR Choose
GO NoChoose
:Choose
GV RV 5
GV RV ^DEnter step value (5)
GV SL 5
GV SL ^DEnter steep side length (5)
GV SS 10
GV SS ^DEnter smooth side length (10)
GN CL 0
GN CL ^DEnter color: (0)
GV LW 0
GV LW ^DEnter line width: (0)
GO Selection
:NoChoose
GV RV 5
GV SL 5
GV SS 10
GN CL 0
Gv LW 0
:Selection
GE FL ^DSelect smooth line
IFERR MacroDone
COLOR CL
SELBY1
CHANGEL FL TMPMOUNTAINS
GV RANDOM 1234
LWIDTH LW
GLEN LV FL
GN LN LV/RV
GV PSTEP 100/LN
GV PRCV PSTEP
GP P0 % 0 FL
:DrawSide
GV LFC (1-(PRCV-50)*(PRCV-50)*0.8/2500)
IFN 100-PRCV-PSTEP/2 DrawBackBone
GP P1 % PRCV FL
GP P2 % PRCV+(PSTEP/100) FL
GBRNG BR P1 P2
GSIN RD1 RANDOM
GV RANDOM RANDOM+200
GSIN RD2 RANDOM
GV RANDOM RANDOM+200
GP P2 ref P1 <BR+90*(1+0.1*RD1),(SL*(LFC+0.1*RD2))
FPATH P1 P2;
GSIN RD1 RANDOM
GV RANDOM RANDOM+200
GSIN RD2 RANDOM
GV RANDOM RANDOM+200
GP P2 ref P1 <BR-90*(1+0.1*RD1),(SS*(LFC+0.1*RD2))
FPATH P1 P2;
GV PRCV PRCV+PSTEP
GO DrawSide
:DrawBackBone
GV PRCV PSTEP
:Loop
IFN 100-PRCV-PSTEP/2 EndLoop
GP P1 % PRCV FL
FPATH P0 P1;
GP P0 P1
GV PRCV PRCV+PSTEP
GO Loop
:EndLoop
FPATH P1 % 100 FL;
GOLAYER TMPMOUNTAINS
HIDE MOUNTAINS
ERA FL
SHOWA
GOLAYER MOUNTAINS
:MacroDone
SELREST
COLOR 0
ECON
ENDM
Comments
I don't tend to use many macros. Only the ones that are mentioned a lot publicly, like EDITSHADING, or FLIPSHADING (the later of which doesn't seem to be necessary any more since about update 13). Maybe the same thing has happened with this one (which I've not heard of before).
I also remember that updates and re-installations can sometimes overwrite macros written by users (which is one of the reasons I don't tend to bother with them - too much to worry about when life is so busy). Maybe that is what has happened here? Maybe its been updated and given a slightly different name?
One thing I'm guilty of.... well, two things actually, is that I haven't yet done update 14, and I don't tend to read the update notes all that thoroughly. Its like a blind spot of mine - looking at but not managing to take in a page of text...
Hmmmm... I assume its still physically there, or you wouldn't have been able to reproduce it above?
But it works fine if you change the line
Line width 0
to
Line width 0;
The ; properly terminates the input to the askbox command, otherwise CC3+ doesn't know when the lines with text to put in the box ends and where the next command begins.
(Note that when the macro crashes, it may mess up some settings, so make sure to restart CC3+, then issue the selbyd command to revert selection method to the normal one)
This macro comes from here.
The file works fine with update 14 on my computer.