F: Wie kann ich den Status einer Flag mit dem Instant Debugger
aus AUM25 abfragen?
A:
Klicken Sie hier um die modifizierte idebug.wdl Datei
herunterzuladen.
F:
Ich hätte gern eine größere Ziffern-Anzeige für
mein Ammo / Health / Armor Panel (mit der digfont.pcx). Wie kann
ich das anstellen?
A: Ändern Sie
die Bildgröße in einem beliebigen Malprogramm
von 384 X 64 auf 1536 x 256 Pixel (400 %), speichern
Sie es als digfont2.pcx und schreiben Sie diesen Code
in messages.wdl.
font digitbig_font = <digfont2.pcx>, 48, 64;
panel my_panel
{
pos_x = 20;
pos_y = 20;
digits = 0, 380, 3, digitbig_font, 1, show_ammo;
digits = 200, 380, 3, digitbig_font, 1, show_health;
digits = 400, 380, 3, digitbig_font, 1, show_armor;
flags = transparent, refresh, visible;
}
starter hide_old_panel()
{
while (1)
{
game_panel.visible = off;
wait (1);
}
}

F:
Wie kann ich zwischen zwei Kamerasichten weich umblenden?
A: Sie brauchen eine
neue “view”. Plazieren Sie irgendein Model in
Ihr Level, setzen Sie Winkel und Position entsprechend und
geben Sie ihm die “new_view” Action. Mit “S” wechseln
Sie die Kameras.

view second_camera
{
layer = 10;
pos_x = 0;
pos_y = 0;
}
action new_view
{
my.invisible = on;
my.passable = on;
second_camera.x = my.x;
second_camera.y = my.y;
second_camera.z = my.z;
second_camera.pan = my.pan;
second_camera.tilt = my.tilt;
second_camera.roll = my.roll;
}
function switch_cameras()
{
camera.alpha = 100; // no transparency for this camera yet
second_camera.alpha = 0; // completely transparent
camera.transparent = on;
second_camera.transparent = on;
second_camera.size_x = screen_size.x;
second_camera.size_y = screen_size.y;
second_camera.visible = on;
while (camera.alpha > 5)
{
camera.alpha -= 3 * time;
second_camera.alpha += 3 * time;
wait (1);
}
camera.visible = off;
second_camera.transparent = off;
}
on_s = switch_cameras;
F:
Ich habe einen Game Over Bildschirm, der im Moment ein- und ausfaded,
bis der Spieler eine Taste drückt. Ich habe mich gefragt,
ob es möglich ist, die Bitmap dynamisch zu skalieren, um
den Eindruck entstehen zu lassen, dass sie wächst und schrumpft.
A: Sie brauchen A6.21 oder
eine neuere Engineversion für dieses Feature. Benutzen Sie
dann diesen Code.
bmap gameover_pcx = <gameover.pcx>;
panel gameover_pan
{
bmap = gameover_pcx;
pos_x = 0;
pos_y = 0;
flags = overlay, refresh, visible;
}
starter adjust_panel()
{
while (1)
{
while (gameover_pan.scale_x > 0.2)
{
gameover_pan.scale_x
-= 0.01 * time;
gameover_pan.scale_y
-= 0.01 * time;
gameover_pan.pos_x
= (1 - gameover_pan.scale_x) * bmap_width (gameover_pcx) / 2;
gameover_pan.pos_y
= (1 - gameover_pan.scale_y) * bmap_height (gameover_pcx) / 2;
wait (1);
}
while (gameover_pan.scale_x < 1)
{
gameover_pan.scale_x
+= 0.01 * time;
gameover_pan.scale_y
+= 0.01 * time;
gameover_pan.pos_x
= (1 - gameover_pan.scale_x) * bmap_width (gameover_pcx) / 2;
gameover_pan.pos_y
= (1 - gameover_pan.scale_y) * bmap_height (gameover_pcx) / 2;
wait (1);
}
wait (1);
}
}

F:
Gibt es ein funktionierendes Beispiel einer AVI Datei, die auf
einem Model abgespielt wird?
A: Geben Sie Ihrem Model
die Action “movie_on_model”. Drücken Sie “M” zum
Abspielen.
action
movie_on_model
{
while (key_m == 0) {wait (1);} // press "M" to play the
movie
media_play ("highway.avi", bmap_for_entity (my, 0), 100);
}

F: Wie
kann ich den Cursor auf einem Panel einblenden und den Benutzer Text
eingeben lassen?
A: Sie brauchen einen Text und ein
Panel, wie im Beispiel unten.
bmap input_pcx = <input.pcx>;
string temp_str = " "; // 20 characters
function input_text();
panel input_pan
{
bmap = input_pcx;
pos_x = 0;
pos_y = 0;
layer = 10;
on_click = input_text;
flags = refresh, d3d, visible;
}
text my_txt
{
layer = 20;
pos_x = 30;
pos_y = 35;
font = standard_font;
string = temp_str;
}
text dummy_txt // displays the text that was input
{
layer = 20;
pos_x = 15;
pos_y = 450;
font = standard_font;
flags = visible;
}
function input_text()
{
if ((mouse_pos.x > 7) && (mouse_pos.x < 215) && (mouse_pos.y > 20) && (mouse_pos.y < 45))
{
my_txt.visible = on;
str_cpy (temp_str, "");
inkey temp_str;
my_txt.visible = off;
// got the text in temp_str here
dummy_txt.string = temp_str; // show the input
text
// .................
}
}

F:
Ich hätte gern einen Code für alle dekorativen Entities
(Pflanzen, Bäume, etc.), der mir erlaubt, diese im WED zu plazieren
und der Code bewegt sie vertikal nach unten, so dass sie auf dem
Terrain stehen.
A: Geben Sie jeder Pflanze, jedem
Baum, etc. diese Action.
action
smart_vegetation
{
my.skill1 = random (5) + 1;
wait (my.skill1);
vec_set (temp, my.pos);
temp.z -= 3000;
trace_mode = ignore_me + ignore_sprites + ignore_models + use_box;
my.z -= trace (my.pos, temp) + 10; // set the correct height (the
bottom of the
model will sink 10 quants into the soil).
}
F: Wie
kann ich ein Licht durch das Level wandern lassen? Ich möchte es
einen bestimmten Pfad entlangschicken.
A: Erstellen Sie einen Pfad namens “lightpath”,
plazieren Sie ein Model in der Nähe und geben Sie diesem die “moving_light” Action.
action moving_light
{
d3d_lightres = 1;
var light_pos;
var current_speed;
var distance;
var acc_speed;
var init_speed = 3; // movement speed
ent_path("lightpath"); // walk on this path
ent_waypoint(light_pos, 1);
while (1)
{
my.lightrange = 300;
my.lightred = 200;
my.lightgreen = 200;
my.lightblue = 200;
temp.x = light_pos.x - my.x;
temp.y = light_pos.y - my.y;
temp.z = 0;
if (vec_to_angle (my_angle, temp) < 20)
{
ent_nextpoint(light_pos);
}
my.z += 0.1 * (light_pos.z - my.z) * time;
current_speed = init_speed;
my_angle.pan = ang(my_angle.pan - my.pan);
if (abs(my_angle.pan > 10))
{
temp = sign(my_angle.pan) * current_speed
* 0.1;
}
else
{
temp = current_speed * my_angle *
0.01;
}
my.pan += temp * min(1, time);
acc_speed = acc_speed * max ((1 - time * 0.03), 0) + 0.2 * current_speed
* time;
distance = acc_speed * time;
move_mode = ignore_you + ignore_push + activate_trigger + glide;
ent_move (distance, nullskill);
wait(1);
}
}
F: Ich
möchte, dass der Spieler seine Position im Level laden und speichern
kann. Es ist ein kurzes Spiel, also ein einfaches Quick Save / Quick
Load reicht.
A: Benutzen Sie die eingebauten Quick
Load und Quick Save Funktionen unten.
on_s = _save(); // quick save, press "S" to save the game
on_l = _load(); // quick load, press "L" to load the game