A: You can use separate batch files for client, server, etc or you can use the engine itself (load a dummy level and use "exec").
Q: I like your footprint code in Aum9; how can I change it to create footprints only when the player is outdoors?
A: Add scan_texture to trace_mode and compare the name of the texture with “your_snow_texture”. If these names are the same, create the footprints.
Q: How can I make that my enemy hear sounds and attack me?
A: Check the distance between the player and your enemy (or use scan) and if the player makes a certain "noise" (opens a door, etc) set a variable and then check its value in enemy's action.
Q: How can you define a variable for a certain entity and then change its properties?
A: You need to use pointers for that. Here's a sample:
entity* golden_fish;
action my_fish // attach this action to your fish model
{
golden_fish = me;
.......................
}
Now you can type golden_fish.ambient = 100 at the console (or put it in any
function / action) and your fish will become brighter
Q: I have started to play a wave file by pressing the space button in my action. The wave file plays once from beginning to end. Can I stop it somehow before it ends?
A: Yes, you can. Here's the code:
var sound_handle;
action your_action
{
...........
sound_handle = snd_play (my_great_music, 40, 0);
...........
while (something)
{
if (key_s == 1) // press S to stop the sound
{
snd_stop (sound_handle);
}
}
}
Q: I am trying to create a speedo for my game. I would like to use 2 panels; the first is the clock, and the second is the needle that indicates the speed. I need to make the needle rotate or 'roll'. Is this possible with a panel?
A: Use two entities; their
definitions should be similar to the bow entity in this Aum edition. This way
you will be able to change the roll angle.
Q: Can you change a Map entities texture by script?
A: Yes, you can use morph or use
u and v to shift the texture (it should be twice the original size) until you
see the new one.
Q: I was wondering if there is a
way, instead of deleting the particle when the particle life expires, but to
delete the particle when it passes a certain position or becomes X far away from
where it started?
A: Yes, you can use particle's skill_x ... skill_z.
Q: I'm using Geometricks' attach_entity function. I did a generic attach statement, but my models were scaled, so the guns did not line up correctly. Can I scale the guns via script to match a model scaled in WED?
A: The answer is easy if you know
the scale in Wed:
function attach_prop_entity()
{
// new stuff from here on
my.scale_x = 0.3; // if you have scaled the original model to
0.3 in Wed
my.scale_y = 0.3;
my.scale_z = 0.3;
// new stuff ends here
my.passable = on;
while(you) // prevent empty synoym error if parent entity was
removed
{
if(your.shadow == on) { my.shadow =
on; }
vec_set(my.x,you.x);
vec_set(my.pan,you.pan);
// increment _ANIMDIST by elapsed
time
my._ANIMDIST += 50*TIME; // replace
50 with engine speed in game
while(my._ANIMDIST > 100)
{
my._ANIMDIST
-= 100;
}
ent_frame("Frame",my._ANIMDIST);
wait(1);
}
remove(my);
}
Q: Is there a way for a (template) enemy to slowly fade from existence after a certain time and then remove itself?
A: First of all, comment a line
in action robot2:
ACTION robot2
{
MY._FORCE = 2;
MY._FIREMODE = DAMAGE_SHOOT+FIRE_PARTICLE+HIT_FLASH+0.05;
// MY._HITMODE = HIT_GIB;//HIT_EXPLO; // comment this line
MY._WALKSOUND = _SOUND_ROBOT;
anim_init();
drop_shadow(); // attach shadow to robot
actor_fight();
// if(MY.FLAG4 == ON) { patrol(); }
// create(<arrow.pcx>,MY.POS,_ROBOT_TEST_WATCHER); // used to
activate watcher drone
}
Attach this piece of code at the end of the state_die function:
// If entity 'gibs' after death
if((ME != player) && ((MY._HITMODE & MODE_HIT) == HIT_GIB))//(MY._HITMODE
& HIT_GIB))
{
_gib(25); // use new "gib" function
actor_explode(); // ends with the
removal of this entity
return;
}
MY.PASSABLE = ON; // body remains
// new stuff from here on
my.transparent = on;
my.alpha = 100;
while (my.alpha > 0)
{
my.alpha -= 2 * time;
wait (1);
}
ent_remove (me);
// new stuff ends here
}