Posted By: Davetheave
Poison/Camera Effect WDL - 01/14/05 07:28
Well after much time spent on the fourms i found that people need codes that involved the cameras. So i looked around more and found how easy it was to make some camera code. Any feedback will be great i don't care if it's bad. Also i will take ideas. Note: I belive the camera.alpha code needs pro edition to run currectly.
Code:
Edit: I belive i had used the alpha values wrong so i just fixed them. Also so small improvments on the poison code and the pain code.
Edit: Thank you Snake67 for the "* time" help.
Code:
/* Poison/Camera effect Coded by David Branco a.k.a DaveTheAve
Note: This code was made for use with the templates.
To use:
Include this .WDL last in the main script
Call the function of the effect you want.
To shutoff:
Camera effects: Call the function "normal_camera"
Other Effects: Call the function "shutdown_effects" */
bmap poison_pan = "poison.bmp"; //Fullscreen poison bmp file
bmap pain_pan = "pain.bmp"; //Fullscreen pain bmp file
var poison_stat, 0; //Keep at 0 Needed to reset effect is more poison is taken
var poison_speed, 1; //Speed the poison effect decreases by
var pain_stat, 0; //Keep at 0 Needed to reset effect is more poison is taken
var pain_speed, 1; //Speed the poison effect decreases by
var drugged_working, 0; //Keep at 0 Needed for the drug camera
panel poison_panel
{
alpha = 0;
bmap = poison_pan;
flags = transparent, refresh, d3d;
}
panel pain_panel
{
alpha = 0;
bmap = pain_pan;
flags = transparent, refresh, d3d;
}
function poison_effect()
{
poison_panel.alpha = 80;
poison_stat = 1;
poison_panel.visible = on;
while(poison_panel.alpha > 0)
{
poison_panel.alpha -= poison_speed * time;
wait(1);
}
poison_panel.alpha = 0;
poison_panel.visible = off;
poison_stat = 0;
}
function pain_effect()
{
pain_panel.alpha = 80;
pain_stat = 1;
pain_panel.visible = on;
while(pain_panel.alpha > 0)
{
pain_panel.alpha -= pain_speed * time;
wait(1);
}
pain_panel.alpha = 0;
pain_panel.visible = off;
pain_stat = 0;
}
function pain_remain_on_screen_effect()
{
pain_stat = 1;
pain_panel.visible = on;
wait(5);
while(pain_stat == 1)
{
pain_panel.alpha = 100 - player._HEALTH;
wait(1);
}
pain_panel.alpha = 0;
pain_panel.visible = off;
pain_stat = 0;
}
function shutdown_effects()
{
pain_stat = 0;
poison_stat = 0;
}
function normal_camera()
{
camera.alpha = 50;
camera.transparent = off;
drugged_working = 0;
}
function slowmo_camera()
{
camera.transparent = on;
camera.alpha = 30;
}
function drugged_camera()
{
camera.transparent = on;
camera.alpha = 8;
drugged_working = 1;
while (drugged_working == 1)
{
camera.x += 10 * time;
wait(1);
camera.x -= 10 * time;
wait(1);
}
}
function nos_camera()
{
camera.transparent = on;
camera.alpha = 20;
}
Edit: I belive i had used the alpha values wrong so i just fixed them. Also so small improvments on the poison code and the pain code.
Edit: Thank you Snake67 for the "* time" help.