text LOD_warning_message
{
pos_x = 8; // warning appears near the upper left corner down a ways
pos_y = 128;
font = _a4font; // the default font
layer = 15;
// string and flags defined through functions
}
action use_some_LOD
{
/*
To choose the entity, set the my.skill1 variable to what you'd like. We'll use 1 for the
room decorations (the beds, nightstands, lamps, etc.) and 2 for the interior rooms
(including the interior walls).
*/
if (my.skill1 == 1) // the room decor
{
while(1)
{
if (((camera.x < -1024) || (camera.x > 1024)) && ((camera.y > 3840) && (camera.y < 3072)))
{
my.invisible = on; // if on the sides outside the building regardless of height
}
if (((camera.x > -1024) && (camera.x < 1024)) && ((camera.y < 3840) && (camera.y > 3072)) && (camera.z > 208))
{
my.invisible = on; // if above the building on the roof (or directly above it)
}
if (((camera.y > 3840) || (camera.y < 3072)) && (camera.z < 208))
{
my.invisible = on; // if just outside the entrances (the beds in the big rooms are hidden behind a closed door)
}
if (((camera.x > -1024) && (camera.x < 1024)) && ((camera.y < 3840) && (camera.y > 3072)) && (camera.z < 208))
{
my.invisible = off; // if inside the building, everything is visible
}
wait(1);
}
}
if (my.skill1 == 2) // the interior rooms
{
while(1)
{
if (((camera.x < -1024) || (camera.x > 1024)) && ((camera.y > 3840) && (camera.y < 3072)))
{
my.invisible = on; // if on the sides outside the building regardless of height
}
if (((camera.x > -1024) && (camera.x < 1024)) && ((camera.y < 3840) && (camera.y > 3072)) && (camera.z > 208))
{
my.invisible = on; // if above the building on the roof (or directly above it)
}
if ((camera.y > 3840) && (camera.y < 3072))
{
my.invisible = on; // if north or south of the sides regardless of east-west position and height
}
if (((camera.x > -1024) && (camera.x < 1024)) && ((camera.y < 3840) && (camera.y > 3072)) && (camera.z < 208))
{
my.invisible = off; // if inside the building, everything is visible
}
wait(1);
}
}
if (my.skill1 == 0) // if you forgot to change it
{
LOD_warning_message.string = "You forgot to specify the entity number (use skill1)!";
LOD_warning_message.visible = on; // always remain on for a sturdy reminder
while(1)
{
my.pan += 15*time; // rotates the object to give a warning on what object is at fault
if (my.pan >= 360)
{
my.pan -= 360; // if the pan is too high, set it back in range
}
}
}
}