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
4 registered members (TipmyPip, Quad, alibaba, izorro), 545 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
HELP: Using the mouse to trigger events ? #217745
07/24/08 16:49
07/24/08 16:49
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
In C Sript I have:

while (my.health > 0)
{
// move the player using the "W", "S", "A" and "D" keys; "10" = movement speed, "6" = strafing speed
c_move (my, vector(20 * (key_w - key_s) * time_step, 6 * (key_a - key_d) * time_step, 0), nullvector, GLIDE);
if (mouse_left == on) // if the player presses the left mouse button
{
wait(-0.1);
fire_bullets(); // call this function
}


If I replace if(mouse_left == on) with if(mouse_left)

as the manual suggests, my function, fire_bullets() doesn't run. If I replace it with if(1), the gun fires continously, so I know the code around it is good.

Any ideas please ?

Thanks


Re: HELP: Using the mouse to trigger events ? [Re: dracula] #217749
07/24/08 17:08
07/24/08 17:08
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
wait, are you using c-script or lite-c? anyway, it should work. if you're using c-script then i dont why it happens but with lite-c i have all working fine. just continue using if(mouse_left == ON) if you're still having that problem.



Ubi bene, ibi Patria.
Re: HELP: Using the mouse to trigger events ? [Re: croman] #217772
07/24/08 19:00
07/24/08 19:00
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
In Lite C

if (mouse_left == ON) works

if (mouse_left == on) doesn't work

I had forgotten case sensitivity

Thanks !


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