Page 1 of 1

Is it me or do mouse down events not work?

PostPosted: Sun May 29, 2011 7:49 pm
by Guardian69
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

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

PostPosted: Sun May 29, 2011 7:58 pm
by savvy
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)
{
}

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

PostPosted: Sun May 29, 2011 8:11 pm
by schnellboot
and also you have to mouse click the actor in which you specified the mouse button event

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

PostPosted: Sun May 29, 2011 8:26 pm
by Guardian69
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?

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

PostPosted: Sun May 29, 2011 8:38 pm
by schnellboot
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

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

PostPosted: Sun May 29, 2011 8:47 pm
by Guardian69
Ace!
Thank you. That worked a treat! :)

I will +1 when I earn another point.