A:
You need to change function particle_fade() in particle.wdl; use a bitmap
inside it and change its alpha parameter depending on particles' age.
Q: I have a snipe action in the main wdl of my game and i was wondering how to go about making it so you could only snipe if you have a gun number 5 or higher.
A: I am assuming that your sniper code is triggered by starting the function sniper_on (it can be an action, no problem). Open weapons.wdl and look for function gun_select(); change the code this way:
if(weapon_number
== 1)
{
ME = weapon1;
//
put a line that will stop the sniper_on() function here
}
if(weapon_number
== 2)
{
ME = weapon2;
//
put a line that will stop the sniper_on() function here
}
if(weapon_number
== 3)
{
ME = weapon3;
//
put a line that will stop the sniper_on() function here
}
if(weapon_number
== 4)
{
ME = weapon4;
//
put a line that will stop the sniper_on() function here
}
if(weapon_number
== 5)
{
ME = weapon5;
sniper_on();
}
if(weapon_number
== 6)
{
ME = weapon6;
sniper_on();
}
if(weapon_number
== 7)
{
ME = weapon7;
sniper_on();
}
Q: When I press the right mouse button I move forward. How can I get rid of this?
A: Open input.wdl and comment this line as indicated:
//
force.X += strength.X*MOUSE_RIGHT*mouseview;
Q: I want to add infrared vision to my game. How can I do this?
A:
Create a function that sets camera.ambient = 100 and add a green panel
over the screen (i wouldn't choose this method) or add green fog; play
with camera.fog = 1...100.
Q: Please help me animate an entity this way: when I press "J" the player would jump and play the jumping animation frames.
A: Here's an example:
action
player_moves
{
while (1)
{
if (key_j == 1)
{
my.skill10 = 0;
while (my.skill10 < 100)
{
ent_cycle("jump", my.skill10); // make sure that you name your jump frames
"jump"
my.skill10 += 5 * time; // play with this value
wait (1);
}
while (key_j == 1) {wait (1);}
}
if (key_c == 1) // crouch
{
....................
}
........................
wait (1);
}
}
Q: When I do a level change, the player does not bring his gun with him. How do i solve this?
A: Here's an example from one of my projects:
function
level_restore ()
{
while (player == null) {wait (1);}
if (weapon_1 == 1) {ent_create(weapon1_mdl, nullvector, gun1);}
if (weapon_2 == 1) {ent_create(weapon1_mdl, nullvector, gun2);}
if (weapon_3 == 1) {ent_create(weapon1_mdl, nullvector, gun3);}
if (weapon_4 == 1) {ent_create(weapon1_mdl, nullvector, gun4);}
if (weapon_5 == 1) {ent_create(weapon1_mdl, nullvector, gun5);}
if (weapon_6 == 1) {ent_create(weapon1_mdl, nullvector, gun6);}
if (weapon_7 == 1) {ent_create(weapon1_mdl, nullvector, gun7);}
gun_loaded = 1;
gun_select();
}
Q: Is it possible to have a enemy model blow up different then me? For example i blow up with flames and the enemy blows up with smoke.
A: You can write a function that looks like _gib and then modify this piece of code in war.wdl:
if((ME
!= player) && ((MY._HITMODE & MODE_HIT) == HIT_GIB))//(MY._HITMODE
& HIT_GIB))
{
_gib(25);
// use your _gib2() function here
actor_explode();
return;
}
Q: How can i create a traffic light that has green, yellow and red lights?
A: Here's an example from one of my projects:
entity*
red;
entity*
orange;
entity*
green;
action
red1 // attached to red wmb entity
{
red = me;
my.lightrange = 0;
}
action
orange1 // attached to yellow / orange wmb entity
{
orange = me;
my.lightrange = 0;
my.lightred = 255;
my.lightred = 155;
}
action
green1 // attached to green wmb entity
{
green = me;
my.lightrange = 0;
my.lightgreen = 255;
}
action
init_semaphore // an invisible entity placed anywhere in the level
{
my.invisible = on;
my.passable = on;
while (red == null || orange == null || green == null) {wait (1);}
while (1)
{
red.light = on;
red.lightred = 255;
red.ambient = 100;
orange.ambient = 0;
orange.light = off;
orange.lightred = 0;
green.ambient = 0;
green.light = off;
green.lightgreen = 0;
waitt (80);
red.ambient = 0;
red.light = off;
red.lightred = 0;
orange.light = on;
orange.ambient = 100;
orange.lightred = 255;
orange.lightred = 155;
green.ambient = 0;
green.light = off;
green.lightgreen = 0;
waitt (50);
red.ambient = 0;
red.light = off;
red.lightred = 0;
orange.ambient = 0;
orange.light = off;
orange.lightred = 0;
orange.lightred = 0;
green.ambient = 100;
green.light = on;
green.lightgreen = 255;
waitt (80);
red.ambient = 0;
red.light = off;
red.lightred = 0;
orange.light = on;
orange.ambient = 100;
orange.lightred = 255;
orange.lightred = 155;
green.ambient = 0;
green.light = off;
green.lightgreen = 0;
waitt (50);
}
}
Q:
Which is a better format to save textures and panel bitmaps as - BMP or
PCX? Is there any display speed difference at all?
A:
PCX files are smaller; you can use PCX or BMP for your textures and panels
- they'll eat the same quantity of vidfeo memory.
Q: I am pretty new at panels; what is a window? I have read the manual over and over and i still do not understand what a window is.
A:
A window is a rectangular surface that is being cut from a panel and lets
you see what's behind that panel. You can specify window's position and
size.