Context: CTmMlScriptIngame or CSmMlScriptIngame (= $RequiredContext) aka MT clip containing a Manialink. That Manialink returns a ManiaScript. We'll take a simple example, the script i shared here to show your position while mapping. Here the script:
Code: Select all
<manialink version="2">
<frame>
<label id="Position" pos="-27.0 53.2" size="53.8 8.8" textprefix="$o$s" textcolor="FFF" valign="top" halign="center"/>
</frame>
<script><!--
#RequireContext '.$RequiredContext.'
#Include "TextLib" as TextLib
main() {
declare CMlLabel LblPosition = (Page.GetFirstChild("Position") as CMlLabel);
declare Boolean Continue = True;
declare Integer DisplayFrame = 10;
declare Integer CurrentFrame = 0;
while(Continue) {
if (DisplayFrame < CurrentFrame) {
LblPosition.SetText(TextLib::ToText(GUIPlayer.Position));
CurrentFrame = 0;
}
CurrentFrame += 1;
foreach (Event in PendingEvents)
{
if (Event.KeyCode == 20 || Event.KeyCode == 109)
{
Continue = False;
LblPosition.SetText("");
log("DisplayPositionScript stopped.");
}
}
yield;
}
}
--></script>
</manialink>
Now this is on a simple script. But if i try that on the main script, going from v2 to v3 with the proper manialink frame edited, +/- half of the elements will be displayed while others won't. Close / Right and Left don't appear.
Version 2 frame for this one:
Code: Select all
<frame id="Window" hidden="0">
<quad id="Background" hidden="0" sizen="160 120" posn="0 80 1" valign="top" bgcolor="'.$BgColor.'" halign="center"/>
<quad id="TitleBackground" hidden="0" sizen="160 10" posn="0 80 2" valign="top" bgcolor="000F" halign="center"/>
<label id="Close" style="TextValueBig" hidden="0" sizen="30 10" posn="73 78.5 3" text="x" textcolor="F30F" scriptevents="1" valign="top" halign="center"/>
<label id="Title" hidden="0" text="" sizen="160 90" posn="0 77.5 3" textprefix="$o$s" textcolor="FFFF" valign="top" halign="center"/>
<label id="Message" hidden="0" text="" sizen="130 90" posn="-60 60 3" textcolor="FF0F" maxline="25" autonewline="1" valign="top" halign="left"/>
<label id="StartQuest" style="CardButtonMedium" hidden="1" sizen="100 10" posn="0 -30 3" text="Start Quest" textcolor="FF0F" scriptevents="1" valign="top" halign="center"/>
<label id="Left" style="TextValueBig" hidden="0" sizen="30 10" posn="-30 -20 3" text="<" scriptevents="1" valign="top" halign="center"/>
<label id="Right" style="TextValueBig" hidden="0" sizen="30 10" posn="30 -20 3" text=">" scriptevents="1" valign="top" halign="center"/>
</frame>
Code: Select all
<frame id="Window" hidden="0">
<label id="Close" style="TextValueBig" hidden="0" size="30 10" pos="73 78.5" text="x" textcolor="F30F" scriptevents="1" valign="top" halign="center"/>
<label id="Left" style="TextValueBig" hidden="0" size="30 10" pos="-30 -20" text="<" scriptevents="1" valign="top" halign="center"/>
<label id="Right" style="TextValueBig" hidden="0" size="30 10" pos="30 -20" text=">" scriptevents="1" valign="top" halign="center"/>
<label id="StartQuest" style="CardButtonMedium" hidden="1" size="100 10" pos="0 -30" text="Start Quest" textcolor="FF0F" scriptevents="1" valign="top" halign="center"/>
<label id="Message" hidden="0" text="" size="130 90" pos="-60 60" textcolor="FF0F" maxline="25" autonewline="1" valign="top" halign="left"/>
<label id="Title" hidden="0" text="" size="160 90" pos="0 77.5" textprefix="$o$s" textcolor="FFFF" valign="top" halign="center"/>
<quad id="TitleBackground" hidden="0" size="160 10" pos="0 80" valign="top" bgcolor="000F" halign="center"/>
<quad id="Background" hidden="0" size="160 120" pos="0 80" valign="top" bgcolor="'.$BgColor.'" halign="center"/>
</frame>