User Tag List

Results 1 to 10 of 10

Thread: Help With Mouse Clicking In Game and shooting

  1. #1
    No Products Registered

    Join Date
    Sep 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help With Mouse Clicking In Game and shooting

    Alright i dont get it, i dont know if this is a glitch in the program or im doing something wrong, I have a guy moving with the mouse. I want him to shoot down a crystal when the mouse button is clicked. So i go to events, and do when the left mouse button is clicked, have the guy shoot the crystal down at 30 speed, in the direction of down, but he does not shoot at all, and also i dont want the shooting to be rapid, i want it to only allow it to shoot every 2 seconds. What i thought you had to do was to insert a another event with the one you already had and then do restrict actions for 2 seconds, but that doesnt work that just makes the shooting not work at all, or only like every 10 seconds or so. Anyone know how to fix the problem im having?

    Anything would help.. thanks

  2. #2
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,824
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    Do you have mouse movement on your player?

    If so you need to use the play fire button conditions under the player icon.

    With mouse movements it overrides the clicks.

    I don't understand your question on the second problem might need to upload your file if you want some help with that. Its hard to say without knowing more about your code.


  3. #3
    No Products Registered

    Join Date
    Sep 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    Alright i see what your saying thats why it didnt work, but when i click on the player icon and go to set key, i cant make the fire button on the mouse, only the keyboard

  4. #4
    No Products Registered

    Join Date
    Oct 2008
    Location
    Germany
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    When you have a condition like:

    Code:
    + left mouse button clicked
    + every 2 seconds
        shoot object
    this means that the player has to click EXACTLY every two seconds to fire. Better use a flag or a value to enable/disable shooting:
    Code:
    + left mouse button clicked
    + canShoot == ON
        shoot object
        set canShoot = OFF
    
    + every two seconds
        set canShoot = ON


  5. #5
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,824
    Mentioned
    8 Post(s)
    Tagged
    2 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    You need to use the [Player 1] - joystick - Read joystick state

    Yes its confusing since its a mouse but when you use the built in mouse control it hooks the clicks to the joystick fire buttons.

  6. #6
    No Products Registered

    Join Date
    Sep 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    Thanks man

  7. #7
    No Products Registered

    Join Date
    Sep 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    alright i get what your saying but i dont know how to do it, how do i create a flag, or value of canshoot == on
    and canshoot == off

    thx

  8. #8
    No Products Registered

    Join Date
    Oct 2008
    Location
    Germany
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    you can either use a global value, or alterable values/flags of an object. I prefer using the player's sprite (your "guy") to store such data. Select your guy, click on the "values" tab in the property window and add a new alterable value. Double click on "Alterable Value A" to give it a suitable name (like "canShoot" etc.). You can access this alterable value in the event list editor.
    To assign a value to canShoot, go to the event list editor and add a new action. Rightclick on your guy and select "Alterable Values->Set" from the context menu. Instead of on and off use 1 and 0, since alterable values can only handle numbers.

    Flags are basically like switches, they can be on or off. Every active has 32 flags (from 0 to 31) that you can use. The only problem is that flags can not have names. Flags are also available in the event editor.

    If you haven't done so already, I suggest that you try the mmf2 tutorial (Click on Help and then Tutorial).

    This is my solution:



    lincore

  9. #9
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    As a workaround to make this very simple, use a
    Mouse is within zone (specify zone size)
    ---set x player to xmouse
    ---set y player to ymouse

  10. #10
    No Products Registered

    Join Date
    Sep 2008
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Help With Mouse Clicking In Game and shooting

    Thank you lincore, i never thought i was actually going to figure that out. i really appreciate it.

Similar Threads

  1. Can't launch object when clicking mouse button
    By delta9857 in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 28th August 2011, 07:47 AM
  2. Clicking the left mouse btton
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 13th January 2009, 03:49 PM
  3. TGF2 - Clicking when something is moved by mouse
    By kremuwa in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 23rd November 2008, 09:05 PM
  4. Problems with mouse clicking
    By marten in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 14th October 2008, 09:54 PM
  5. Mouse controll and clicking
    By Gameguy94 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 22nd September 2008, 01:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •