Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, NeoDumont), 761 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Aum 35 context #177585
01/12/08 08:51
01/12/08 08:51
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Hi there,
How can i change the Aum 35 Context code to make it so that when i click an entity/model/player/object it gives me a menu ? not just click anywhere.
And every thing has its own menu.

(example: Tree gives me an option to examine, take leaves, cut tree. Player gives me the options Settings, Make Blade, etc.)

And that when i don't have the things to for example make blade the text just turns grey and is not selectable.

Thanks allready. Hope you can help me.


-The Dragon's Eye is alway's watching you!-
Re: Aum 35 context [Re: SurudoiRyu] #177586
01/13/08 09:39
01/13/08 09:39
Joined: Jul 2003
Posts: 85
France
Gandalf Offline
Junior Member
Gandalf  Offline
Junior Member

Joined: Jul 2003
Posts: 85
France
Look for a base:

function show_menu (id_objet)
{
.........
if (id_objet ==1){pan1.visible =1;}
if (id_objet ==2){pan2.visible =1;}
if (id_objet ==3){pan3.visible =1;}
.......
}

function objet_event()
{
if (event_type == EVENT_CLICK)
{
if (my.skill1 ==1){show_menu(1);}
if (my.skill1 ==2){show_menu(2);}
.......
}
}

function menu_on_click()
{
my.ENABLE_CLICK = ON; // A6
my.emask |= ENABLE_CLICK; // A7
my.event = mouse_event;
}

action objet ()
{
menu_on_click();
....
....
}

Re: Aum 35 context [Re: Gandalf] #177587
01/14/08 17:19
01/14/08 17:19
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
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 :)



Last edited by SurudoiRyu; 01/14/08 18:01.

-The Dragon's Eye is alway's watching you!-
Re: Aum 35 context [Re: SurudoiRyu] #177588
01/14/08 20:01
01/14/08 20:01
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
The first problem I'm seeing is this:
"my.event = show_menu_player();"
should be
"my.event = show_menu_player;"

Re: Aum 35 context [Re: George] #177589
01/14/08 20:57
01/14/08 20:57
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
Allready got it up and running ^^
If someone is curius pm me and ill post it here.

Greetzzz, and thnx.


-The Dragon's Eye is alway's watching you!-
Re: Aum 35 context [Re: SurudoiRyu] #177590
01/15/08 03:46
01/15/08 03:46
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Yeah, it would be good to see a screenie of it working please.

Re: Aum 35 context [Re: Nems] #177591
01/15/08 14:37
01/15/08 14:37
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
This screenshot when i clicked right mouse on the player.



This screenshot when i activated it.



This screenshot when i clicked somewhere else right mouse.



If you not believe it try it yourself
Downloaded the file here


-The Dragon's Eye is alway's watching you!-
Re: Aum 35 context [Re: SurudoiRyu] #177592
01/15/08 19:24
01/15/08 19:24
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
Thanks and good work

Re: Aum 35 context [Re: Nems] #177593
01/15/08 21:39
01/15/08 21:39
Joined: May 2007
Posts: 185
Netherlands
SurudoiRyu Offline OP
Member
SurudoiRyu  Offline OP
Member

Joined: May 2007
Posts: 185
Netherlands
No problem ^-^ it is now easy to insert more i got 2 seperate menu's now
one for item pickup and one for the player it scans now on id's
only one thing isn't wprking maybe someone can explain me why it isn't

Code:

ENTITY* tmpItm;

function ground_pickup_event
{
if (event_type == EVENT_SCAN)
{
tmpItm = my;
player.MuisKlik = my.id;
}
}

ACTION Grass_Action
{
my.id = 2;
my.enable_scan = on;
my.event = ground_pickup_event;
}

function pickup_menu_choice(button_number)
{
if (button_number == 1) //Pick Up
{
if(tmpItm)
{
ent_remove(tmpItm);
incTxt("You picked up some grass.");
}
wait(1);
}
if (button_number == 2) // Options
{
incTxt("This grass is drying in the sun.");
}
}




It doesn't remove the object.
Also it won't display the the text
so i think the tmpItm is empty but i define it ? :S


-The Dragon's Eye is alway's watching you!-

Moderated by  George 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1