Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
and now a button won`t work(solved thanks again) #137865
06/24/07 16:26
06/24/07 16:26
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
i got the mouse map working (had to add a bigger wait) but for some weird reason this button refuses to work, what am i missing here? this function works ok on mouse_right which i used for testing the weapon but i want to use a button to fire it,
Code:

panel phaser_pan
{
bmap = phaserpan_tga;
pos_x = 680;
pos_y = 580;
button 20, 30, but2_tga, but3_tga, but2_tga, null, null, fnct_phaser;
window = 20,56,268,14,charge_tga,0,null;
button 20, 90, but2_tga, but3_tga, but2_tga, null, null, null;
window = 20,116,268,14,charge_tga,0,null;
flags = overlay, refresh, visible;
}


the windows are were a recharge code will go, the fnct_phaser should fire what the button is clicked but it won`t.
any ideas guys?

Last edited by jigalypuff; 06/24/07 19:09.

Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: and now a button won`t work [Re: jigalypuff] #137866
06/24/07 16:51
06/24/07 16:51
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
You are assigning the fnct_phaser when the mouse is over the button and not when clicked.
button 20, 30, but2_tga, but3_tga, but2_tga, fnct_phaser, null, null;

Re: and now a button won`t work [Re: demiGod] #137867
06/24/07 18:02
06/24/07 18:02
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
i swapped that around but still not working, any other thoughts?


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: and now a button won`t work [Re: jigalypuff] #137868
06/24/07 18:22
06/24/07 18:22
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
If you say that the function is working ok i only can thought about a layer problem. Put a higher layer in the panel and test.

Re: and now a button won`t work [Re: demiGod] #137869
06/24/07 18:34
06/24/07 18:34
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
still no joy on that, here is the panel code as it now stands
Code:

panel phaser_pan
{
bmap = phaserpan_tga;
layer = 10;
pos_x = 680;
pos_y = 580;
button 20, 30, but2_tga, but3_tga, but2_tga, fnct_phaser, null, null;
window = 24,59,259,9,charge_tga,0,player.mana;
button 20, 90, but2_tga, but3_tga, but2_tga, null, null, null;
window = 24,119,259,9,charge_tga,0,null;
flags = overlay, refresh, visible;
}


it is strange, i`ve never had this problem before with a button


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: and now a button won`t work [Re: jigalypuff] #137870
06/24/07 18:47
06/24/07 18:47
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Do you have your mouse code working?
Simple example:

function mouseMove()
{
mouse_map = mouseBmp;
mouse_mode = 2;
while (mouse_mode > 0) // move it over the screen
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait(1);
}
}

You can call it in main function.

Re: and now a button won`t work [Re: demiGod] #137871
06/24/07 18:49
06/24/07 18:49
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
ya it would`nt work untill i out a wait(5) in there then it seems to, i mean the mouse map is there and moves around, here`s the main
Code:

function main
{
mouse_map = hempire_pcx;
mouse_mode = 1;
mouse_range = 1000;
level_load ("new_beginings.wmb");
wait(1);
ent_create (galor_mdl, vector(-1000, 0, 0), c_ship);
ent_create (excelsior_mdl, vector(1000,0,0), f_ship);
ent_create (excelsior_mdl, vector(1000,100,0), f_ship);
ent_create (stars_mdl, nullvector, stars);
ent_create (jungle_mdl, vector(1500, 5000, 0), planets);
ent_create (clouds_mdl, vector(1500, 5000, 0), clouds);
ent_create (swamp_mdl, vector(15000, 5000, 0), planets);
ent_create (clouds_mdl, vector(15000, 5000, 0), clouds);
ent_create (f_starbase_mdl, vector(1500, 3000, 0), starbase);
///wait(1);
while (1)
{
mouse_pos.x = pointer.x;
mouse_pos.y = pointer.y;
wait (5);
}
}




Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: and now a button won`t work [Re: jigalypuff] #137872
06/24/07 18:51
06/24/07 18:51
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
here`s something very weird, i assigned a function to another button and the cursor works, just not that button.


Why does everyone like dolphins? Never trust a species which smiles all the time!
Re: and now a button won`t work [Re: jigalypuff] #137873
06/24/07 19:10
06/24/07 19:10
Joined: Nov 2005
Posts: 1,007
jigalypuff Offline OP
Serious User
jigalypuff  Offline OP
Serious User

Joined: Nov 2005
Posts: 1,007
fixed it i had to comment out this line
///if(player != 0 && mouse_right ==1)
cheers for helping me out.


Why does everyone like dolphins? Never trust a species which smiles all the time!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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