Q: I made a terrain in med, but my model will only move about 1/2 way across it and either stop or act like it is against a wall or something.
A: If your model looks like this in Med, it will not be able to climb anything steeper than max_height, not even a stair! Place the origin of your model at a higher position.

Q: How do I make good textures without borders?
A: Download the freeware tool named sTile from here:
http://harmware.com/stile.htm

Q: I know that you can change the values of color depth and the video resolution using " video_switch ", but how can I restore the initials values of the system?
A: There aren't initial values - you set them at game start using video_mode and video_depth. If your game has started with video_mode = 7 (800x600 pixels) and video_depth = 16 (16 bits = 65,536 colors) you can restore these values later using the code below:

function restore_settings()
{
video_swith (7, 16, 0);
}

on_r = restore_settings;

Q: How can I create a level block that has a specified size in quants, for example 20 x 30 x 40?
A: Start Wed and add a small cube to the level - it has 64 x 64 x 64 quants. Divide 20 : 64 = 0.31, 30 : 64 = 0.47 and 40 : 64 = 0.62. Right click the cube, click "Properties", and then "position". Type in the new "Scale" values and you will get your 20 x 30 x 40 quants cube.

Q: Could you please give me a draw_textmode example?
A: Take a look at the code below:

starter init_text()
{
draw_textmode("Times", 2, 30, 40); // choose the font "Times New Roman", italic, 30 points, transparency factor = 40
while (1)
{
draw_text("Geronimo!", 300, 200, vector(250, 250, 250)); // draw white text (rgb = 250, 250, 250) at (300,200) pixels
wait (1);
}
}

Q: I have a skysphere model that follows the player around as he walks. Since the sphere is smaller than the level, the player can't see objects that are farther away than the edge of the skysphere model. Will this allow the computer to run faster, or is everything outside of the skysphere still rendered?
A: All the objects outside the sky sphere are rendered, but you can set clip_range to a value that will remove them. If your sphere model has a diameter of 20,000 quants, place a line that looks like this in your main function:

clip_range = 12000; // sphere_diameter * 0.6

Q: Is it possible to have one model react to fog #1 and another model react to fog#2?
A: No, it isn't possible. However, you can add colored light to one of the models in order to change its color:

action color_changer
{
my.ambient = 100;
my.light = on;
my.bright = on;
my.lightrange = 0;
my.lightgreen = 0;
my.lightblue = 0;
while (1)
{
my.lightred = 230 + random(25); // small red flicker
wait (1);
}
}

Q: How do you make the player move to the next level when he has accomplished all the mission objectives?
A: The code below takes you to the next level only if you have collected 5 or more boxes by running into them:

var boxes_collected = 0;

string office2_wmb = <office2.wmb>; // next level

action get_ammoboxes
{
while (player == null) {wait (1);}
my.passable = on;
while (vec_dist (player.x, my.x) > 100) {wait (1);}
my.invisible = on;
boxes_collected += 1;
}

starter next_level()
{
while (boxes_collected < 5) {wait (1);} // need to get at least 5 boxes
while (key_any) {wait (1);} // wait until all the keys are released on the keyboard
level_load (office2_wmb);
}

Q: How can I activate something with several triggers? Let's say I want to open a door and the first button needs to be off, the second button on, and the third button off to open the door.
A: Use a model with two skins and the code below; attach button_on to the buttons that need to be set to "on" and button_off to the buttons that need to be set to "off". Click a button to change its status from "on" to "off".

var number_of_buttons = 0;
var button_status = 0;

function change_status()
{
my.skin %= 2;
my.skin += 1; // my.skin should be 1 or 2
if (my.skill1 == 1) // this button should be set to "on"
{
if (my.skin == 2) // if it is set to on
{
button_status += 1; // add 1 to button_status
}
else // if it is set to off
{
button_status -= 1; // subtract 1 from button_status
}
}
if (my.skill1 == 1000) // this button should be set to off
{
if (my.skin == 1) // if it is set to off
{
button_status += 1; // add 1 to button_status
}
else // if it is set to on
{
button_status -= 1; // subtract 1 from button_status
}
}
}

starter check_status()
{
sleep (1);
while (button_status != number_of_buttons) {wait (1);}
// call the function that opens your door here
beep;
}

action button_on
{
number_of_buttons += 1;
my.skin = 1; // set to "off" at game start
my.skill1 = 1; // that's a button that needs to be set to on
my.enable_click = on; // click it to change its status
my.event = change_status;
}

action button_off
{
number_of_buttons += 1;
button_status += 1; // "off" is ok for this button
my.skin = 1; // set to "off" at game start
my.skill1 = 1000; // that's a button that needs to be set to off
my.enable_click = on; // click it to change its status
my.event = change_status;
}