|
Re: switch player question?
[Re: Claus_N]
#79935
07/06/06 20:34
07/06/06 20:34
|
Joined: Jun 2006
Posts: 32
lomeniki
OP
Newbie
|
OP
Newbie
Joined: Jun 2006
Posts: 32
|
Thanks man,i`ll test it in a minute. I noticed one more thing. When start level,click rmb (mouse pointer apear),then click(rmb) on entity= nothing happen. When click rmb on entity again = panell apear. Why must click two time? Can it be only one click on entity for panel apearing? Can you please add animation run (for example) for button "e" with some sound for it.(like for "q" button,so i can add latter more buttons for diferent animations ) I tried to do it by myself ,but got errors. Edit: I tested your script.Everything works.One more thing: When rmb click "enywhere else" (when panel is allready present) panel disapear=you do great job. Is the same thing posible with left mouse button click ("enywhere else")? To be more precise,can left and right mouse buton have the same function in "pannel situation"? Thanks again
Last edited by lomeniki; 07/06/06 21:26.
|
|
|
Re: switch player question?
[Re: lomeniki]
#79936
07/06/06 21:19
07/06/06 21:19
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Quote:
I noticed one more thing. When start level,click rmb (mouse pointer apear),then click(rmb) on entity= nothing happen. When click rmb on entity again = panell apear. Why must click two time? Can it be only one click on entity for panel apearing?
Yeah, I know :/ I tried inserting a "wait(1);" in the beginning of function init_mouse, but that didn't work very well... I'll tell you if I find a solution 
EDIT: Got it! Here ya go  Code:
function init_mouse() { if((mouse_pos.x < selectionPan.pos_x || mouse_pos.x > selectionPan.pos_x + bmap_width(selectionPan.bmap)) || (mouse_pos.y < selectionPan.pos_y || mouse_pos.y > selectionPan.pos_y + bmap_height(selectionPan.bmap))) { selectionPan.visible = off; } wait(1); mouse_toggle(); }
Quote:
Can you please add animation run (for example) for button "e" with some sound for it.(like for "q" button,so i can add latter more buttons for diferent animations ) I tried to do it by myself ,but got errors.
Sure 
Code:
action plActor { my.material=mtl_xzmaterijal; animateMe(); my.enable_click = on; my.enable_rightclick = on; my.event = actorClicked; while(my) { if(my.active) { my.ambient = 100; my.anim_state = state_stand; if(key_q) { my.anim_state = state_spin; snd_stop(my.skill22); if(!snd_playing(my.skill32)) { my.skill32 = snd_loop(sound_on_q,100,10); } } else { if(key_e) { my.anim_state = state_bounce; snd_stop(my.skill22); if(!snd_playing(my.skill32)) { my.skill32 = snd_loop(sound_on_e,100,10); } } else { snd_stop(my.skill32); if(!snd_playing(my.skill22)) { my.skill22 = snd_loop(sound_on_idle,100,10); } } } } else { snd_stop(my.skill22); snd_stop(my.skill32); my.ambient = 0; my.anim_state = state_stand; } wait(1); } }
Last edited by Claus_N; 07/06/06 21:21.
|
|
|
Re: switch player question?
[Re: lomeniki]
#79940
07/06/06 22:14
07/06/06 22:14
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Code:
function actorClicked { if(snd_handle != 0) { snd_stop(snd_handle); } if(event_type == event_rightclick) { snd_handle = snd_play(ent_rightclick,100,10); selPan_Show(handle(my)); wait(1); mouse_mode = 2; mouse_on(); } if(event_type == event_click) { snd_handle = snd_play(ent_leftclick,100,10); while(mouse_left) {wait(1);} my.active = on; while(!mouse_left) {wait(1);} my.active = off; } }

|
|
|
Re: switch player question?
[Re: Claus_N]
#79941
07/06/06 22:32
07/06/06 22:32
|
Joined: Jun 2006
Posts: 32
lomeniki
OP
Newbie
|
OP
Newbie
Joined: Jun 2006
Posts: 32
|
Checked: Now we have mouse (ok) 1.Is it posible pointer to desapier when click on buuton(select in panel) 2.Pointer stay on screen when cick lmb "enywhere else" (when panel is on screen) Is it posible pointer(lmb click) to desapier in that situation allso?  Thanks man 
|
|
|
Re: switch player question?
[Re: lomeniki]
#79942
07/06/06 22:43
07/06/06 22:43
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Code:
function butClick(but,pan) { mouse_mode = 0; if(actorHandle == 0) {return;} you = ptr_for_handle(actorHandle); actorHandle = 0; if(!you) {return;} if(snd_handle != 0) { snd_stop(snd_handle); } if(but == 1) {snd_handle = snd_play(pl1_snd,100,10);ent_morph(you,pl1_mdl);} if(but == 2) {snd_handle = snd_play(pl2_snd,100,10);ent_morph(you,pl2_mdl);} if(but == 3) {snd_handle = snd_play(pl3_snd,100,10);ent_morph(you,pl3_mdl);} if(but == 4) {snd_handle = snd_play(pl4_snd,100,10);ent_morph(you,pl4_mdl);} if(but == 5) {snd_handle = snd_play(pl5_snd,100,10);ent_morph(you,pl5_mdl);} if(but == 6) {snd_handle = snd_play(cancel_snd,100,10);} selectionPan.visible = off; }
Change the event of the left mouse button: Code:
on_mouse_left = init_mouse;
Was that how u meant? 
|
|
|
Re: switch player question?
[Re: lomeniki]
#79944
07/06/06 23:04
07/06/06 23:04
|
Joined: May 2004
Posts: 1,510 Denmark
Claus_N
Serious User
|
Serious User
Joined: May 2004
Posts: 1,510
Denmark
|
Okay, this does the job Code:
function butClick(but,pan) { if(actorHandle == 0) {return;} you = ptr_for_handle(actorHandle); actorHandle = 0; if(!you) {return;} if(snd_handle != 0) { snd_stop(snd_handle); } if(but == 1) {snd_handle = snd_play(pl1_snd,100,10);ent_morph(you,pl1_mdl);} if(but == 2) {snd_handle = snd_play(pl2_snd,100,10);ent_morph(you,pl2_mdl);} if(but == 3) {snd_handle = snd_play(pl3_snd,100,10);ent_morph(you,pl3_mdl);} if(but == 4) {snd_handle = snd_play(pl4_snd,100,10);ent_morph(you,pl4_mdl);} if(but == 5) {snd_handle = snd_play(pl5_snd,100,10);ent_morph(you,pl5_mdl);} if(but == 6) {snd_handle = snd_play(cancel_snd,100,10);} selectionPan.visible = off; wait(2); mouse_mode = 0; }
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|