i'm sorry, but I have another problem:
when i go in level02 with "next level" script i dont have more the objects,
all scripts work fine but when i've put the script "oggetti_random" all the objects that in level01 have the actions in level02 dont appear
where is my error?
thx
here my code:
///////////////////////////////////////////////////////////////
////////prendi_e_passa.wdl
bmap screen_pcx = <livello2a.pcx>;
panel screen_pan
{
bmap = screen_pcx;
//layer = 4;
//pos_x = 0;
//pos_y = 0;
flags = refresh,d3d;
}
string office2_wmb = <livello02.wmb>; // next level
var boxes_collected = 0;
FONT passa_garfield, <Orbit_48a.bmp>, 73, 74;
bmap ammobox_pcx = <collezzione.pcx>;
sound passa = <suoni14.wav>;
sound livello = <LoraDelMistero.wav>;
panel ammobox_pan
{
bmap = ammobox_pcx;
layer = 4;
pos_x = 50;
pos_y = 640;
flags = d3d, visible, overlay, refresh;
}
panel ammoboxes_panel
{
layer = 7;
pos_x = 0;
pos_y = 0;
flags = refresh;
digits -150, 670, 4,passa_garfield,1,boxes_collected;
}
action get_ammoboxes
{
while (player == null) {wait (1);}
my.passable = on;
oggetti_random2();
entity_rotate();
while (vec_dist (player.x, my.x) > 30) {wait (1);}
my.invisible = on;
boxes_collected += 1;
ammoboxes_panel.visible = on;
play_sound passa,60; // Play a sound
FXb();
remove(me);
}
}
action entity_rotate
{
while (1)
{
my.PAN+= 1;
wait(1);
}
}
function next_level()
{
while (boxes_collected < 5) {wait (1);} // need to get at least 5 boxes
while (key_any) {wait (1);} // wait until all the keys are released on the keyboard
level_load (office2_wmb);
play_sound livello,60; // Play a sound
ammoboxes_panel.visible = off;
screen_pan.pos_x = (screen_size.x - bmap_width(screen_pcx))/2;
screen_pan.pos_y = (screen_size.y - bmap_height(screen_pcx))/2;
screen_pan.visible = on;
wait(3);
sleep(4);
screen_pan.visible = off;
bmap_purge(screen_pcx);
}
}
///////////////////////////////////////////////////////////////
//cura_fx.wdl
function puro_fxc();
function puro_fx1c();
function fadex_fxc();
bmap fx1c_pcx = <cura.pcx>;
bmap fx2c_pcx = <ornflare.tga>;
var _health = 100; // The Health
var particle_emmittente1 = 3;
var particle_emmitt1 = 50;
var min_radius1 = 45;
var angle_step1 = 5;
var radius_step1 = 0.1;
var up_step1 = 0.05;
sound curando = <suoni26.wav>;
function puro_fxc()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(2) + 1;
vec_add (my.vel_x, temp);
my.flare = on;
my.bright = on;
my.alpha = 100;
my.bmap = fx1c_pcx;
my.size = 70;
my.move = on;
my.lifespan = 100;
my.function = fadex_fxc;
}
function puro_fx1c()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(2) + 1;
vec_add (my.vel_x, temp);
my.flare = on;
my.bright = on;
my.alpha = 100;
my.bmap = fx2c_pcx;
my.size = 50;
my.move = on;
my.lifespan = 70;
my.function = fadex_fxc;
}
function fadex_fxc()
{
my.alpha -= 2 * time;
if (my.alpha < 0) {my.lifespan = 0;}
}
action prendi_cura_fx
{
while (player == null) {wait (1);}
my.passable = on;
oggetti_random1();
entity_rotate1();
while (vec_dist (player.x, my.x) > 30) {wait (1);}
my.invisible = on;
play_sound curando,60; // Play a sound
_HEALTH += 60;
FXc();
remove(me);
}
action FXc
{
while (player == null) {wait (1);}
while (1)
{
temp.z = my.z;
my.skill10 = particle_emmittente1;
my.skill9 = particle_emmitt1;
my.skill11 = min_radius1;
while (my.skill10 > 0)
{
temp.x = player.x + min_radius1 * cos(my.skill12);
temp.y = player.y + min_radius1 * sin(my.skill12);
temp.z += up_step1;
my.skill12 += angle_step1;
min_radius1 += radius_step1;
effect (puro_fxc, 1, temp.x, normal);
effect (puro_fx1c, 5, temp.x, normal);
my.skill10 -= 1;
my.skill9 -= 2;
}
min_radius1 = my.skill11;
wait (1);
}
}
action entity_rotate1
{
while (1)
{
my.PAN+= 1.2;
my.tilt+= 1;
//my.roll+= 1;
wait(1);
}
}
///////////////////////////////////////////////////////////////
//danno_fx.wdl
function puro_fxa();
function puro_fx1a();
function fadex_fxa();
bmap fx1a_pcx = <teschio.pcx>;
bmap fx2a_pcx = <flame000.tga>;
var _health = 100; // The Health
var particle_emmittente = 3;
var particle_emmitt = 50;
var min_radius = 25;
var angle_step = 5;
var radius_step = 0.1;
var up_step = 0.05;
font danno_font, <Orbit_48.bmp>, 73, 74;
sound danneggio = <suoni06.wav>;
panel health_panel
{
pos_x = 0;
pos_y = 0;
digits 680, 670, 4, danno_font, 1, _health;
flags = refresh, visible;
}
bmap mascher = <puntivita.pcx>;
panel maschera
{
bmap = mascher;
layer = 4;
pos_x = 820;
pos_y = 640;
flags = d3d, visible, overlay, refresh;
}
function puro_fxa()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(2) + 0.5;
vec_add (my.vel_x, temp);
my.flare = on;
my.bright = on;
my.alpha = 100;
my.bmap = fx1a_pcx;
my.size = 50;
my.move = on;
my.lifespan = 100;
my.function = fadex_fxa;
}
function puro_fx1a()
{
temp.x = random(2) - 1;
temp.y = random(2) - 1;
temp.z = random(2) - 1;
vec_add (my.vel_x, temp);
my.flare = on;
my.bright = on;
my.alpha = 100;
my.bmap = fx2a_pcx;
my.size = 50;
my.move = on;
my.lifespan = 70;
my.function = fadex_fxa;
}
function fadex_fxa()
{
my.alpha -= 2 * time;
if (my.alpha < 0) {my.lifespan = 0;}
}
action prendi_danno_fx
{
while (player == null) {wait (1);}
my.passable = on;
oggetti_random();
entity_rotate2();
while (vec_dist (player.x, my.x) > 30) {wait (1);}
my.invisible = on;
play_sound danneggio,60; // Play a sound
_HEALTH -= 60;
FXa();
remove(me);
}
action FXa
{
while (player == null) {wait (1);}
while (1)
{
temp.z = my.z;
my.skill10 = particle_emmittente;
my.skill9 = particle_emmitt;
my.skill11 = min_radius;
while (my.skill10 > 0)
{
temp.x = player.x + min_radius * cos(my.skill12);
temp.y = player.y + min_radius * sin(my.skill12);
temp.z += up_step;
my.skill12 += angle_step;
min_radius += radius_step;
effect (puro_fxa, 1, temp.x, normal);
effect (puro_fx1a, 5, temp.x, normal);
my.skill10 -= 1;
my.skill9 -= 2;
}
min_radius = my.skill11;
wait (1);
}
}
action entity_rotate2
{
while (1)
{
my.PAN+= 0.3;
//my.tilt+= 0.5;
my.roll+= 0.3;
wait(1);
}
}
///////////////////////////////////////////////////////////
//oggetti_random.wdl
/////////////////////////////////
/////danno_fx
var objects_placed = 0;
starter randomize_numbers()
{
randomize();
}
action oggetti_random//three_objects_only
{
my.skill1 = random(1) + 0.1; // generate a random number between 0.1 and 1.1
sleep (my.skill1); // wait 0.1 to 1.1 seconds
objects_placed += 1;
if (objects_placed > 6)
{
ent_remove(my);
}
}
/////////////////////////////////////////////////
////// cura_fx
var objects_placed1 = 0;
action oggetti_random1//three_objects_only
{
my.skill1 = random(1) + 0.1; // generate a random number between 0.1 and 1.1
sleep (my.skill1); // wait 0.1 to 1.1 seconds
objects_placed1 += 1;
if (objects_placed1 > 6)
{
ent_remove(my);
}
}
////////////////////////////////////////////
/////prendi_e_passa
var objects_placed2 = 0;
action oggetti_random2//three_objects_only
{
my.skill1 = random(1) + 0.1; // generate a random number between 0.1 and 1.1
sleep (my.skill1); // wait 0.1 to 1.1 seconds
my.passable = on;
objects_placed2 += 1;
if (objects_placed2 > 5)//3
{
ent_remove(my);
}
}