Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Right and left click

Author
Message
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 23rd May 2009 22:36
Hi i was wondering how you would do it so that when you press right mouse the sight appears but also when you press left mouse button whilst the sight is up it will shoot.

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 23rd May 2009 23:37
Take a look at dbMouseClick:



Here is a quick sudo-code example of what to do:



------------------------------------
Currently 1500+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 23rd May 2009 23:49
im doing this at the moment

This stops me from even opening up the scope have you got any ideas how to fix this ? Please post

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 23rd May 2009 23:54
Sorry for double post but ive changed to this and now it opens but it doesnt play the sound when its open.

Ill check back tommorow morning thanks !

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 24th May 2009 00:23 Edited at: 24th May 2009 00:24
Maybe its playing the sound over and over? try:


edit: added code tags
dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 24th May 2009 16:43
Instead of checking if the mouseclick result is 1, 2, 4 etc you should mask the value to check for each button. For example: if ( dbMouseClick() & 0x02 ), that would be trus whenever mouse 2 is pressed, this includes when 1 and 2 are pressed etc.

xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 27th May 2009 10:46
Ok thanks darkcoder only one problem, when i do this :

It Works fine except that the muzzle flash still shows when the sight is up so is there a way to not show the muzzle flash only when the sight is up?

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"
xiva
15
Years of Service
User Offline
Joined: 16th Apr 2009
Location:
Posted: 27th May 2009 10:56
sorry for double post
but i got it working ! YAY thanks all !

"Lifes like a box of chocolates, you never know which one you get" Forest Gump
Unless you read the leaflet, thats why hes so "different"

Login to post a reply

Server time is: 2024-10-06 15:33:19
Your offset time is: 2024-10-06 15:33:19