- 1) remove everything, then find the Base Coord:
Code: Select all
declare CBlockModel BMArenaSimpleBase;
BMArenaSimpleBase <=> BlockModels["ArenaSimpleBase"];
RemoveAllBlocksAndTerrain();
declare CoordYBaseSol = GetBlockGroundHeight(
BMArenaSimpleBase, 19, 19, ::CardinalDirections::East);
Code: Select all
PlaceBlock(BlockModels["RoadRaceToArenaMirror"], <3, CoordYBaseSol, 0>, ::CardinalDirections::East);
Code: Select all
declare CGameCtnBlock B;
B = GetBlock(<3, CoordYBaseSol-2, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol-1, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol+1, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol+2, 0>);
log(B == Null);
Code: Select all
#RequireContext CGameCtnEditorPluginScriptHandler
#Include "MapUnits" as MapUnits
#Include "MathLib" as MathLib
Text CreateManialink()
{
declare MLText =
"""
<script><!--
Void OnPlaceBlocks()
{
declare Boolean StartPlacing for Page;
if(!StartPlacing) {
StartPlacing = True;
}
}
main ()
{
while(True) {
yield;
foreach(Event in PendingEvents) {
if(Event.Type == CGameManialinkScriptEvent::Type::MouseClick) {
if (Event.ControlId == "PlaceQuad") {
OnPlaceBlocks();
}
}
}
}
}
--></script>
<frame>
<quad id="PluginTitleQuad" posn="-138 82 1" sizen="42 13" halign="center" valign="center" style="Bgs1InRace" substyle="BgTitle3_1"/>
<label id="PluginTitleLabel" text="Labyz" posn="-138 82 1" halign="center" valign="center" style="TextTitle3"/>
<quad id="PluginQuad" posn="-138 76 1" sizen="38 22" halign="center" valign="top" style="Bgs1" substyle="BgList" ScriptEvents="1"/>
<quad id="PlaceQuad" posn="-138 60 4" sizen="30 6" halign="center" valign="center" style="Bgs1InRace" substyle="BgCard" ScriptEvents="1"/>
<label id="PlaceLabel" text="Click me" posn="-138 60 4" halign="center" valign="center" style="TextButtonSmall" textsize="2"/>
</frame>
""";
return MLText;
}
Void PlaceBlocks()
{
declare CBlockModel BMArenaSimpleBase;
BMArenaSimpleBase <=> BlockModels["ArenaSimpleBase"];
RemoveAllBlocksAndTerrain();
declare CoordYBaseSol = GetBlockGroundHeight(
BMArenaSimpleBase, 19, 19, ::CardinalDirections::East);
declare CGameCtnBlock B;
PlaceBlock(BlockModels["RoadRaceToArenaMirror"], <3, CoordYBaseSol, 0>, ::CardinalDirections::East);
B = GetBlock(<3, CoordYBaseSol-2, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol-1, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol+1, 0>);
log(B == Null);
B = GetBlock(<3, CoordYBaseSol+2, 0>);
log(B == Null);
}
main()
{
declare Boolean StartPlacing for ManialinkPage;
ManialinkText = CreateManialink();
while(True) {
yield;
if(StartPlacing) {
PlaceBlocks();
StartPlacing = False;
}
}
}