Most asked questions

Top  Previous  Next

Q: I want to use a multi frame gun in my game like in Deus Ex or Soldier of Fortune but I don`t know how to do it. In default weapon.wdl I can only use a one frame gun.

A: Heres a wdl snippet that will solve the problem:

 

var weapon_delay = 1; // pause between animation cycles

function _gun_anim () // CALL this from within your standard gun action
{
       WHILE (1)
       {
               IF (KEY_CTRL == 1)
               {
                       MY.FRAME = 1;
                       WHILE (MY.FRAME < 16)
                       {
                               MY.FRAME += TIME;
                               IF (MY.FRAME > 15)
                               {
                                       MY.FRAME = 16;
                               }
                               WAITT weapon_delay;
                       }
               }
               WAIT 1;

       }
}
 

 

Q: My problem is that after the game starts the sound resets to zero so that the MIDI-file is not usable.

A: Some sound cards (especially older Creative Labs models) have problems with their internal mixer or the drivers. If you have a Creative AWE 64, try upgrading the drivers. To test the problem, start the engine then press Alt+Tab to get back to the Windows desktop. Double click the speaker icon and check the midi volume slider; by increasing the volume you should hear the midi sound.

 

 

Q: I need a wdl code for an enemy that dies and leaves a health pick-up behind. Like the enemy goes through his death and as he disappears a health pick-up generates were the enemy was laying.
A: You have to modify war.wdl

function state_die()
{
       …………..
       MY.PASSABLE = ON; // body remains
}

will look like this:

SKILL temp_robot {} // robot coordinates, add it at the beginning of the file

function state_die()
{
       …………..
       //MY.PASSABLE = ON; // comment this line!

       // new code from here on
       temp_robot.X = MY.X;
       temp_robot.Y = MY.Y;
       temp_robot.Z = MY.Z;
       REMOVE MY;
       CREATE <health.mdl>, temp_robot, add_health; // don't forget to add your health.mdl file
}

function _hincrease () // executed when the player runs into the health
{
       YOU = PLAYER;
       YOUR._HEALTH += 50; // player's health is increased by 50
       REMOVE ME; // removes the health model
}

function add_health () // will run when the health model is created
{
       MY.ENABLE_IMPACT = ON; // sensitive to impact
       MY.EVENT = _hincrease;
}

 

Q: When I am following the tutorial and select a cylinder I just added, if I am in rotate mode, it rotates when the object is selected. When I am in scale mode, it rotates too! Is this a bug?

A: This will happen if one or more keys on your keyboard are stuck shift, for example. If this is a bug, simply minimize Weds window, then maximize it and you should be able to scale the object.

 

Q: Is it possible to make it so that if the player touches something he gets hurt and is there a way to effect how much you get hurt?

A: Place a model / sprite / wmb in your level, then attach it the ACTION add_health above (replace function with action to see it in Weds action list). You will have to use function _hincrease () to decrease players health; change this line as shown:

 

YOUR._HEALTH -= 50; // will decrease the health by 50

 

Q: Does anyone know of a good way to make rain / snow in levels, so that it will only be raining outside, so if you go in a building it isn't hitting you but you can see it thru a window or something?

A: Place an entity in wed outside the building, then attach it the snow action:

 

var temp_snow = 0;

 
BMAP snow_map, <snow.pcx>; // your rain / snow bitmap here

ACTION snow
{
       MY.INVISIBLE = ON;
       WHILE (1)
       {
               temp_snow.X = MY.X + 200 - RANDOM(400); // 400 quants square area
               temp_snow.Y = MY.Y + 200 - RANDOM(400);
               temp_snow.Z = MY.Z;
               EMIT 1, temp_snow, _snow;
               WAIT 1;
       }
}

function _snow ()
{
       IF (MY_AGE == 0)
       {
               MY_FLARE = ON;
               MY_MAP = snow_map;
               MY_SPEED.X = 0;
               MY_SPEED.Y = 0;
               MY_SPEED.Z = -10; // snowing speed
               MY_SIZE = 50 + RANDOM(30);
       }
       IF (MY_AGE >= 200) // remove the snow flakes that aren't visible
       {
               SET MY_ACTION, NULL;
       }
}

 

Q: When I place my model into the WED it will sink into the floor. I place the origin in the mid-section of the model as shown in the sample mdl. When I remove my script from the model it will not sink I wonder what may be wrong.

A: Your action contains something like this:

 

MY.Z -= A; // A is a value, skill or expression.

 

This will make the entity sink into the floor because no collision detection is performed. Try to MOVE the entity in your action instead of changing its Z coordinate, or subtract something from A to make your entity look ok:

 

MY.Z -= A - 2; // choose the value that fits your needs.

 

Q: If I have building with several rooms, does overlapping the walls with one another help or shall I try to keep them exactly on the same grid line?

A: If you overlap the walls, you can count on a portal count decrease by 3-10% depending on your level geometry.

 

Q: How do I increase the walking and running speed of my player as in Q2 or Unreal? I'm using the template scripts for my player action.

A: Look at the beginning of movement.wdl and increase one or more values:

var strength[3] = 5,4,75; // default ahead, side, jump strength

You can type strength.X += 5 at the console to double the (ahead) speed before modifying movement.wdl; this goes for strength.Y and strength.Z too. Find the best values, then modify the script.