Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,699 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 5 1 2 3 4 5
Re: switch player question? [Re: Claus_N] #79935
07/06/06 20:34
07/06/06 20:34
Joined: Jun 2006
Posts: 32
L
lomeniki Offline OP
Newbie
lomeniki  Offline OP
Newbie
L

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 Offline
Serious User
Claus_N  Offline
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: Claus_N] #79937
07/06/06 21:31
07/06/06 21:31
Joined: Jun 2006
Posts: 32
L
lomeniki Offline OP
Newbie
lomeniki  Offline OP
Newbie
L

Joined: Jun 2006
Posts: 32
Thanks Claus,
Please read "edit" in my previous post if you are still here.

Re: switch player question? [Re: lomeniki] #79938
07/06/06 21:52
07/06/06 21:52
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
No problem

Code:
/////////////////////////////////////////
function check_panel()
{
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;
}
}

function init_mouse()
{
check_panel();
wait(1);
mouse_toggle();
}
/////////////////////////////////////////

on_mouse_left = check_panel;



Re: switch player question? [Re: Claus_N] #79939
07/06/06 22:08
07/06/06 22:08
Joined: Jun 2006
Posts: 32
L
lomeniki Offline OP
Newbie
lomeniki  Offline OP
Newbie
L

Joined: Jun 2006
Posts: 32
I checked previous (now i`m checking this code)
About previous:Now one click works.
Oops,we lose mouse pointer when rmb on entity(panel apear but no pointer to
select)

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 Offline
Serious User
Claus_N  Offline
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
L
lomeniki Offline OP
Newbie
lomeniki  Offline OP
Newbie
L

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 Offline
Serious User
Claus_N  Offline
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: Claus_N] #79943
07/06/06 23:01
07/06/06 23:01
Joined: Jun 2006
Posts: 32
L
lomeniki Offline OP
Newbie
lomeniki  Offline OP
Newbie
L

Joined: Jun 2006
Posts: 32
Allmoust perfect!
Now only one problem:
Pointer stays on screen when (lmb) button click (select in panel).
We wont to desapier.

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 Offline
Serious User
Claus_N  Offline
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;

}



Page 4 of 5 1 2 3 4 5

Gamestudio download | 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