Most asked questions

Top  Previous  Next

Q: I read Aum 26 and really enjoyed the force field code, but I can't figure out how to move the particles up and down, just like the lift in the office level.

A: Replace two functions inside forcefield.wdl with the ones below:

 

function particle_barrier()

{

    my.bmap = redflare_pcx;

    my.flare = on;

    my.bright = on;

    my.size = 10;

    my.function = keep_particles;

    my.skill_x = 0;

}

function keep_particles()

{

    my.lifespan = 10; // keep the particle alive

    my.alpha = 30 + random(70); // show some activity

    if ((my.z < 200) && (my.skill_x == 0))

    {

         my.z += 1;

    }

    else

    {

         my.skill_x = 1;

    }

    if ((my.z > 0) && (my.skill_x == 1))

    {

         my.z -= 1;

    }

    else

    {

         my.skill_x = 0;

    }

}

Q: Trying to set up a simple fire effect for torches is beyond my comprehension. Can you help?

A: Sure. Use the code below:

 

bmap fire_map = <flame.tga>;

 

function fire_init();

function fade_away();

 

action fire_generator

{

    my.invisible = on;

    my.passable = on;

    while (1)

    {

         effect(fire_init, 1, my.pos, normal);

         wait (1);

    }

}

 

function fire_init()

{

    my.bmap = fire_map;

    my.alpha = 12; // play with this value

    my.size = 5;

    my.flare = on;

    my.bright = on;

    my.move = on;

    my.x += 2 - random (4);

    my.y += 2 - random (4);

    my.z += 1 + random (1);

    my.function = fade_away;

}

 

function fade_away()

{

    my.alpha -= 0.5 * time;

    if (my.alpha <= 0)

    {

         my.lifespan = 0;

    }

}

 

aum31_shot17

 

 

Q: Can I have a simple health pack code, please?

A: Here's a simple example:

 

action simple_health

{

   my.passable = on;

   while (player == null) {wait (1);}

   while (vec_dist (my.x, player.x) > 100) {wait (1);}

   player._health += 25; // add 25 health points

   ent_remove (me);

}

 

 

Q: In your Shoot 3rd project (Aum14), after enemy's death, the player and the bullet can move through the corpse easily. I want to do the same thing in my project, but it isn't working, even after setting "passable" for my enemies in Wed! What I am doing wrong?

A: Add this line of code in front of every line that uses the ent_move instruction:

 

move_mode = ignore_you + ignore_passable

 

Q: My game uses several wad files. I'd like to have a single wad file that contains all the textures used in my game; if it possible to do that without extracting the textures manually?

A: Yes, it is possible. Build your level and you will see a level.$$w file inside your game folder - that's the wad file that contains only the textures that are used in the level. Rename it to level.wad, copy it inside the \wads folder and add it to your project. Don't forget to remove all the other wad files; you won't need them from now on. Oh, and level.$$w and level.wad were given as examples; the files can have any other name.

 

Q: I have built two sky spheres for my level. I'd like to be able to control their rotation speed and transparency under "Properties" in Wed.

A: Paste the code below inside one of your wdl files:

 

define transparency skill1;

define speed_pan skill2;

define speed_tilt skill3;

define speed_roll skill4;

 

// uses transparency, speed_pan, speed_tilt, speed_roll

action spheres

{

    my.passable = on;

    my.transparent = on;

    my.alpha = my.transparency;

    while (1)

    {

         my.pan += my.speed_pan * time;

         my.tilt += my.speed_tilt * time;

         my.roll += my.speed_roll * time;

         wait (1);

    }

}

 

aum31_shot18

 

 

Q: I can't seem to get "exec" to work; can you show me an example?

A: Use the code below; press "N" to run Notepad. Make sure that you have copied notepad.exe from your windows folder to your game folder first.

 

function test_exec()

{

    exec("notepad.exe", "");

}

 

on_n test_exec;

 

Q: I like the sword combat code in AUM12 but I'm having a hard time making it first person. I've altered the camera so that it rests inside the player but when you attack the model lunges forward and you can see it.

A: Add this line to action player_fight:

 

player.invisible = on;

 

Q: I have an animated sprite of an explosion, but I need it to cycle thru the animations slower... how do i do this?

A: Change "2" to a smaller value in the example below:

 

var explo_pos;

string explosion_pcx = <explo+6.pcx>;

 

function animate_explosion()

{

    wait (1);

    my.passable = on;

    my.ambient = 100;

    while (my.frame < 7)

    {

         my.frame += 2 * time;

         wait (1);

    }

    ent_remove (me);

}

 

action exploder // this is where the explosion will appear

{

   vec_set (explo_pos, my.pos);

}

 

function explosion()

{

   while (key_x == 1) {wait (1);}

   ent_create(explosion_pcx, explo_pos, animate_explosion);

}

 

on_x = explosion;