F:
Ich verwende Ihre Sicherheitskamera aus AUM 22. Wie kann ich einmal pro
Sekunde nach Entities scannen und nicht zufällig?
A: Ersetzen Sie die security_camera
Action mit dieser:
action security_camera
{
my.ambient = -100;
my.skill1 = my.pan;
init_alarm();
while (1)
{
while (my.pan < my.skill1 + rotating_angle)
{
my.pan += 1 * time; // rotating speed
my.skill2 += 3 * time;
if (my.skill2 > 50)
{
start_scanning();
my.skill2 = 0;
}
wait (1);
}
while (my.pan > my.skill1 - rotating_angle)
{
my.pan -= 1 * time; // rotating speed
my.skill2 += 3 * time;
if (my.skill2 > 50)
{
start_scanning();
my.skill2 = 0;
}
wait (1);
}
wait (1);
}
}
F: Ich
verwende Ihre Sicherheitskamera (AUM 22). Wie kann ich erreichen, dass an
der Kamera jedes Mal, wenn sie nach Entities scannt, ein kleines rotes Licht
aufleuchtet?
A: Geben Sie dem Kameramodel einen zweiten Skin mit
dem roten Licht an der korrekten Stelle und fügen Sie eine solche Funktion
am Anfang des Skriptes ein:
function blinker()
{
my.skin = 2;
sleep (0.5);
my.skin = 1;
}
Rufen Sie diese Funktion direkt nach jedem Aufruf von start_scanning() auf:
action security_camera
{
.............................
start_scanning();
blinker();
.............................
start_scanning();
blinker();
.............................
}
F:
Könnten Sie bitte Ihr Kraftfeld aus AUM 26 modifizieren? Wenn man
im WED Skill3 auf 5 setzt, soll das Kraftfeld für 5 Sekunden aktiv
sein, dann wieder 5 Sekunden inaktiv usw.
A:
Klicken Sie hier um die geänderte forcefield.wdl
herunterzuladen.
F:
Können Sie mir sagen, wie ich für den Spieler aus dem Schwertkampf-Beispiel
(AUM 12) Gesundheitsitems nutzen kann?(Aum12)?
A: Mit diesem Code:
action sword_combat_medic
{
my.passable = on;
while (player == null) {wait (1);}
while (vec_dist(my.x, player.x) > 70)
{
my.pan += 2 * time;
wait (1);
}
ent_remove(my);
player.healthpoints = min(200, player.healthpoints + 100); // limit healthpoints to 200
}
F:
Wie kann ich eine Schlucht erstellen, die den Spieler tötet, wenn
er hineinfällt?
A: Erstellen Sie eine unsichtbare WMB-Entity
mit der Form der Schlucht (etwas kleiner) und nutzuen Sie diesen Code:
function kill_player();
define health skill30; // use your own skill here
sound scream_wav = <scream.wav>;
function kill_player()
{
snd_play(scream_wav, 100, 0);
while (player.z > -1000) // the player will fall until it goes 1000 quants below the origin in my example
{
player.z -= 50 * time;
wait (1);
}
player.health = 0; // the player is dead
}
starter player_abyss()
{
while (player == null) {wait (1);}
while (1)
{
vec_set (temp.x, player.x);
temp.z -= 10000;
trace_mode = ignore_me + ignore_passable + ignore_models + ignore_sprites + scan_texture;
trace (player.x, temp);
if (str_cmpi ("brickdark", tex_name)) // use this texture for your wmb abyss
{
kill_player();
return; // get out of here
}
wait (1);
}
}
action abyss // attach this simple action to your abyss wmb entity to make it invisible
{
my.invisible = on;
}
F:
Ich habe mich gefragt, ob man einem Model ein Sprite zuordnen kann und
dieses je nach Entfernung zur Kamera sichtbar machen kann oder auch nicht.
A: Dieser Code leistet
dies:
function set_sprite();
string sprite_pcx = <sprite.pcx>;
action my_model
{
ent_create (sprite_pcx, my.x, set_sprite);
// put the rest of the code for your model here
}
function set_sprite()
{
while (1)
{
my.x = you.x;
my.y = you.y;
my.z = you.z + 50; // place the sprite 50 quants above the origin of the model
if (vec_dist (camera.x, my.x) < 100)
{
my.invisible = off; // show the sprite
}
else
{
my.invisible = on; // hide the sprite
}
wait (1);
}
}
F: Ich
hätte gern ein blinkendes Fadenkreuz: weiß – rot – weiß ...
Können Sie helfen?
A: Hier ist der Codeschnipsel, den Sie
suchen:
bmap whitecross_pcx = <whitecross.pcx>; bmap redcross_pcx = <redcross.pcx>;
starter pulsing_crosshair()
{
while (1)
{
mouse_map = whitecross_pcx;
sleep (1); // play with this value
mouse_map = redcross_pcx;
sleep (1); // play with this value
}
}
F:
Wie erstelle ich ein Ziel, auf das man schießen kann und das sich
dreht, wenn es getroffen wird?
A: Hier ist ein Beispiel:
function rotate_me();
action shootable_target
{
my.oriented = on;
my.enable_impact = on;
my.enable_entity = on;
my.enable_shoot = on;
my.event = rotate_me;
}
function rotate_me()
{
var rot_speed = 40;
while (rot_speed > 0.5)
{
my.tilt += 2 * rot_speed * time;
rot_speed -= 3 * time;
wait (1);
}
}

F:
Wie erzeuge ich einen Schwarm Partikel (Bienen oder was auch immer), die um den
Spieler herumschwirren?
A: Hier ein Beispiel:
bmap bees_map = <bees.tga>;
function remove_bees()
{
my.x = player.x + 100 * cos(my.lifespan);
my.y = player.y + 100 * sin(my.lifespan);
my.lifespan -= 5 * time;
}
function swarm_init()
{
my.lifespan = 500;
my.alpha = 50 + random(50);
my.bmap = bees_map;
my.flare = on;
my.move = on;
my.size = 10;
my.z = player.z + (100 - random(200));
my.function = remove_bees;
}
starter swarm()
{
while (player == null) {wait (1);}
while (1)
{
effect(swarm_init, 10 * time, player.x, normal);
wait (1);
}
}