Is it me or do mouse down events not work?

Non-platform specific questions.

Is it me or do mouse down events not work?

Postby Guardian69 » Sun May 29, 2011 7:49 pm

Hi all,

This is most probably me making a silly mistake and I have only just started using this tool.

I followed the moon defender tutorial (found here, http://game-editor.com/tutorials/moonde ... l_eng.html) and decided to change the fire button from right ctrl to the LMB.

So I added the Mouse Down Event, registered the left click, added the script editor action and put in the following script.

tempmeter = tempmeter + .12;
if(tempmeter < .95)
{
CreateActor("shot", "shot1", "(none)", "(none)", -35, -15, false);

}

The Key Down Event contains exactly the same lines of script.

The problem is that the key down fires the left mouse button doesn't.

I expect it’s just me being dumb but if you can open my eyes I would really appreciate it.

Thank you in advance,
Mat
User avatar
Guardian69
 
Posts: 17
Joined: Thu May 26, 2011 9:05 pm
Location: United Kingdom
Score: 0 Give a positive score

Re: Is it me or do mouse down events not work?

Postby savvy » Sun May 29, 2011 7:58 pm

its adding .12 a single time, in order for it to work you must have a variable on the mouse down: shoot=1; then shoot=0; on the mouse up, or something like that.
then in a draw event have the code you put inside:
if(shoot==1)
{
}
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: Is it me or do mouse down events not work?

Postby schnellboot » Sun May 29, 2011 8:11 pm

and also you have to mouse click the actor in which you specified the mouse button event
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Is it me or do mouse down events not work?

Postby Guardian69 » Sun May 29, 2011 8:26 pm

Thank you very much, that sorted it firing when I click on the actor.

However, I don't really want to have to click on the actor.

Is there anyway to change it to work by clicking anywhere in the window?
User avatar
Guardian69
 
Posts: 17
Joined: Thu May 26, 2011 9:05 pm
Location: United Kingdom
Score: 0 Give a positive score

Re: Is it me or do mouse down events not work?

Postby schnellboot » Sun May 29, 2011 8:38 pm

make a filled region over the view and make it parented to view
then you make an activation event on mouse click and select the actor
then you make activation event instead of mouse button down
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: Is it me or do mouse down events not work?

Postby Guardian69 » Sun May 29, 2011 8:47 pm

Ace!
Thank you. That worked a treat! :)

I will +1 when I earn another point.
User avatar
Guardian69
 
Posts: 17
Joined: Thu May 26, 2011 9:05 pm
Location: United Kingdom
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest