Compiling a macro with $continue gives a macro expand overflow

So I’ve pinpointed an issue I was having some time ago involving this error. Any time a macro has a $continue at the end, the compilation fails with the error “Macro expand overflow”

Here is an example from the Prone Mod github from gmod:



$definemacro MakeAimLayer layername filename \\
$animation a_$layername$_neutral $filename$ frame 4 4 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_down_left $filename$ frame 0 0 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_down_center $filename$ frame 1 1 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_down_right $filename$ frame 2 2 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_mid_left $filename$ frame 3 3 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_mid_center $filename$ frame 4 4 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_mid_right $filename$ frame 5 5 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_up_left $filename$ frame 6 6 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_up_center $filename$ frame 7 7 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$animation a_$layername$_up_right $filename$ frame 8 8 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
// $animation a_$layername$_straight_up $filename$ frame 7 7 subtract a_$layername$_neutral 0 weightlist AimLayerWL ikrule lhand touch "ValveBiped.Bip01_R_Hand" usesource \\
$sequence $layername$ { \\
    // a_$layername$_straight_up a_$layername$_straight_up a_$layername$_straight_up \\
    a_$layername$_up_right a_$layername$_up_center a_$layername$_up_left \\
    a_$layername$_mid_right a_$layername$_mid_center a_$layername$_mid_left \\
    a_$layername$_down_right a_$layername$_down_center a_$layername$_down_left \\
    blendref a_$layername$_neutral \\
    blendcenter a_$layername$_mid_center \\
    blendwidth 3 calcblend aim_yaw "anim_attachment_RH" ZR calcblend aim_pitch "anim_attachment_RH" YR \\
    delta \\
    iklock rfoot 1 0 iklock lfoot 1 0 \\
    hidden \\
    } \\
$continue $layername$


Compiling without the $continue works but leads to negative effects like rotating the player model by 90 degrees during all animations.

Here are the settings being used on the latest version of Crowbar:


"E:\Program Files\Steam\steamapps\common\GarrysMod\bin\studiomdl.exe" -game "E:\Program Files\Steam\steamapps\common\GarrysMod\garrysmod" -nop4 -verbose "player_male_anims_m_anm.qc"

Any help would be appreciated

Macro expand overflow is when you try to run a macro in a macro.

$continue allows the line to continue so you can add other features. Issue is studiomdl relies on line breaks for its compiles. I’ve found that manually retyping the lines helps fixes it. the ($makeaimlayer lines in the other qc)

Didn’t solve the issue, but more information for people looking at this thread:

Compiling the gmod animation source works without editing it, but female models will still appear 90 degrees to the side.

Gmod:https://github.com/robotboy655/gmod-animations

Prone: [https://github.com/gspetrou/Prone-Mod/tree/master/Model Source/gmod_animations](https://github.com/gspetrou/Prone-Mod/tree/master/Model Source/gmod_animations)
Attempting to use the $continue macro outside of the gmod animations does end with the same macro expand overflow