I had to fight to get this working, so I thought I would put it here once and for all.
I have a Flashforge Creator Pro, and for years, I have just been using the front control to pause the print to change filament - this works fine, but then you forget about it and suddenly it's too late..
I had no idea that Sailfish gcode was so different to other types. For other machines, I saw that you need to pause, move the head away, play a sound... and I thought I needed to do this on my FFCP, and kept tying and failing!
I finally got round to using the M322 code, which does all this for you on Sailfish... Simples.
So, rather than issuing a pause at as specific layer in the gcode (like other machines / gcodes), you set a threshold value, and as soon as the Z value is greater than the value you set, the system pauses, a sound plays, the bed drops and the print head returns home. Then you can access the front panel menu and change the filament before 'unpausing'.
So, I wanted to print this vBuck, with a colour change at layer 15 and one at 25. printing at .2mm later height, you multiply this up to get the heights: 0.2*15 = 3 and 0.2*25 = 5.
You can only have one of these set at a time, so on layer 10 I set the pause at 3mm (which will be about layer 15), then at layer 20 I set the 5mm pause (which will be about layer 25). To do this go to the scripts tab in the settings, and add the following to the bottom box:
{REPLACE "; layer 10," "M322 Z3.0\n; layer 10,"}
{REPLACE "; layer 25," "M322 Z5.0\n; layer 25,"}
This is a post processing command, which means that after the gcode is created, it's changed, This REPLACES '; layer 10,' with:
M322 Z3.0
; layer 10,
This pauses when the Z axis gets to 3mm.
Look here for all the G and M codes supported: http://replicat.org/mcodes