It doesn't work what is wrong ?
Menu.wdl
Code:
bmap menu_pcx = <playermenu.pcx>;
//bmap b1_Examine_pcx = <b1_examine.pcx>;
//bmap b2_Examine_pcx = <b2_examine.pcx>;
bmap b1_MakeBlade_pcx = <b1_makeblade.pcx>;
bmap b2_MakeBlade_pcx = <b2_makeblade.pcx>;
//bmap b1_PickUp_pcx = <b1_pickup.pcx>;
//bmap b2_PickUp_pcx = <b2_pickup.pcx>;
bmap b1_Options_pcx = <b1_options.pcx>;
bmap b2_Options_pcx = <b2_options.pcx>;
function player_menu_choice(button_number);
function show_menu_player();
function hide_menu();
////////////////////////////////////////////////////////////////////////
panel pan_Player_WithBlade
{
bmap = menu_pcx;
pos_x = 0;
pos_y = 0;
layer = 10;
button = 2, 2, b1_MakeBlade_pcx, b2_MakeBlade_pcx, b1_MakeBlade_pcx, player_menu_choice, null, null;
button = 2, 22, b1_Options_pcx, b2_Options_pcx, b1_Options_pcx, player_menu_choice, null, null;
//button = 2, 42, b1_1024_pcx, b2_1024_pcx, b1_1024_pcx, player_menu_choice, null, null;
flags = overlay, refresh;
}
panel pan_Player_WithoutBlade
{
bmap = menu_pcx;
pos_x = 0;
pos_y = 0;
layer = 10;
//button = 2, 2, b1_MakeBlade_pcx, b2_MakeBlade_pcx, b1_MakeBlade_pcx, player_menu_choice, null, null;
button = 2, 22, b1_Options_pcx, b2_Options_pcx, b1_Options_pcx, player_menu_choice, null, null;
//button = 2, 42, b1_1024_pcx, b2_1024_pcx, b1_1024_pcx, player_menu_choice, null, null;
flags = overlay, refresh;
}
function player_menu_choice(button_number)
{
if (button_number == 1) //Make Blade
{
incTxt("You made a Blade.");
}
// if (button_number == 2) // Options
// {
// incTxt("Options.");
// }
//if (button_number == 3) //
//{
//
//}
}
function show_menu_player()
{
if (event_type == EVENT_CLICK)
{
if(mouse_right)
{
if (my.Blades == 0)
{
pan_Player_WithoutBlade.pos_x = pointer.x;
pan_Player_WithoutBlade.pos_y = pointer.y;
pan_Player_WithoutBlade.visible = on;
}
else
{
pan_Player_WithBlade.pos_x = pointer.x;
pan_Player_WithBlade.pos_y = pointer.y;
pan_Player_WithBlade.visible = on;
}
}
else
{
hide_menu();
}
}
}
function hide_menu()
{
pan_Player_WithBlade.visible = off;
pan_Player_WithoutBlade.visible = off;
wait (1);
}
Player.wdl
Code:
//skill1: Health 100
//skill2: WalkingSpeed 10
//skill3: TurningSpeed 8
//skill4: JumpHeight 10
//skill5: AttackSpeed 10
//skill10: Blades 0
//defines
define Health, skill1;
define WSpeed, skill2;
define TSpeed, skill3;
define JumpHeight, skill4;
define AttackSpeed, skill5;
define Blades, skill10;
//Vars
var move_vec[3] = 0,0,0;
var idle_percent = 0;
var walk_percent = 0;
//Debug Tekst
BMAP bmp_type1 = "Gras.jpg"; // Grass Grond
BMAP bmp_type1C = "GrasC.jpg"; // Grass Grond Ingedrukt
BMAP bmp_type2 = "Zand.jpg"; // Zand Grond
BMAP bmp_type2C = "ZandC.jpg"; // Zand Grond Ingedrukt
BMAP bmp_type3 = "Water.jpg"; // Water Grond
BMAP bmp_type4 = "Metaal.jpg"; // Metaal Grond
BMAP bmp_type4C = "MetaalC.jpg"; // Metaal Grond Ingedrukt
//string str_debug = "debuglijn";
//Modder Grond
//Lettertype
font fnt_century12 = <Centur12.pcx>,16,20; // Century12 font
//Grond Panels
PANEL pnl_Grond1
{
layer = 15;
BUTTON=0,0,bmp_type1C,bmp_type1,bmp_type1,Take_Gras,NULL,NULL;
}
PANEL pnl_Grond2
{
layer = 15;
BUTTON=0,0,bmp_type2C,bmp_type2,bmp_type2,Take_Zand,NULL,NULL;
}
PANEL pnl_metaal
{
layer = 15;
BUTTON=111,0,bmp_type4C,bmp_type4,bmp_type4,Take_Metaal,NULL,NULL;
}
///Einde Debug Scripts
function check_keys()
{
move_vec[0] = (key_w - key_s)*MY.WSpeed *time;
if(key_a)
{
my.pan += my.TSpeed*time_step;
}
if(key_d)
{
my.pan -= my.TSpeed*time_step;
}
If (move_vec[0] == 0 && move_vec[1] == 0)
{
idle_percent = (idle_percent +5*time)%100;
ent_animate(me,"idle",idle_percent,ANM_CYCLE);
}
else
{
walk_percent = (walk_percent + sign(move_vec[0])*5*time)%100;
ent_animate(player,"walk",walk_percent,ANM_CYCLE);
}
c_move(me,vector(0,0,0),nullvector, IGNORE_YOU | IGNORE_PASSABLE | IGNORE_PUSH | IGNORE_MODELS | ACTIVATE_TRIGGER | GLIDE);
ent_move(move_vec,NULLVECTOR);
}
function Check_Ground()
{
if(me)
{
pnl_Grond1.visible = off;
pnl_Grond2.visible = off;
pnl_metaal.visible = off;
c_trace(my.x, vector(my.x, my.y, my.z -5000), IGNORE_ME | USE_BOX | ACTIVATE_SONAR);
if(str_stri(tex_name, "grass") != 0)
{
pnl_Grond1.visible = on;
}
if(str_stri(tex_name, "sand") != 0)
{
pnl_Grond2.visible = on;
}
}
}
action Speler_Beweging()
{
player = my;
camera.genius = my;
c_setminmax(me);
my.ENABLE_CLICK = ON;
my.event = show_menu_player();
while(1)
{
if(my.Health > 0)
{
check_keys();
check_ground();
}
wait(1);
}
}
I included both scripts in main.wdl
hope u can help me :)