User Tag List

Results 1 to 9 of 9

Thread: Regarding a limited shot system

  1. #1
    No Products Registered

    Join Date
    Sep 2007
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Regarding a limited shot system

    Alright, in my game, I currently have a code setup as follows:

    Upon Pressing " S "
    + PlayerGround = 1

    THEN

    Shoot Object at 100
    Play SFX
    Change Animation to Shooting

    Now, this system works well enough, using the PlayerGround Variable to decide what animation to play in the air, or onm the ground.

    My question is: How can I limit the amount of times a player can shoot at once? For example, if you spam the " S " key in this case, the player will fire rapidly. I want to limit how often they can shoot per second, sort of deal.


  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    There's actually a condition that is designed for just that purpose. Look under the special object, and it's called 'restrict actions for (time)'.

    Also, that part of your code, does that mean you won't be able to shoot when you jump? PLEAAAASSSEEE don't do that!

  3. #3
    No Products Registered

    Join Date
    Sep 2007
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    No, the game is not designed to limit his shooting abilities to the ground. It merely decides whether to play his ground-stance animation, or jumping-stance shooting animation.

    So, I see this Restrict Action object you mentioned, and added it to the code... but this has limited him to a single shot. :/ I set it to 00'05 seconds for the Restrict for Time setup, but it doesn't seem to reset itself.

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    Heres a quick set up that I'd use.

    Some alterable value on the player, maybe named RateOfFire

    RateOfFire > 0
    - Subtract 1 from Rate of Fire

    Player Shoots
    RateOfFire = 0
    - Set RateOfFire to *your value here*
    - *whatever shoot events you need*

  5. #5
    No Products Registered

    Join Date
    Sep 2007
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    Well, I tried the Rate of Fire suggestion, but that came up blank; didn't restrict his rate of fire at all, even when I forced it to set rate of fire to 3, 5, or 10.

    And the Restrict Action command suggested before continues to elude my understanding of its working; it does stop him from shooting, but it never allows him to shoot again as a result.

  6. #6
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    If you PM me the file I could fix it for you.

  7. #7
    No Products Registered

    Join Date
    Sep 2007
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    I appreciate the offer to fix it for me, but I'm one of those folks where if someone does it for me, I don't learn how to do it myself. And I am rather determined to learn this stuff.

    Since the Rate Of Fire suggestion gave little result, here is a screenshot of my code exactly according to Fusion 2.



    At this point, it restricts the amount of bullets able to be fired to one.

  8. #8
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2007
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    The way I control rate of fire is to use an alterable value which represents the delay between shots:

    Alterable Value F("Player") > 0: Subtract 1 from Alterable Value F("Player")

    (Your shooting event conditions)
    +Alterable Value F("Player") = 0: (Your shooting event actions) + Set Alterable Value F("Player" to 10

    It's always best to try to not use the timer-based events if you can help it, because while they will work on most machines, on faster or slower ones, they can muck stuff up.

  9. #9
    No Products Registered

    Join Date
    Jun 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Regarding a limited shot system

    I made an example of what I meant: http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=68413#Post68413

Similar Threads

  1. 3 shot limit?
    By Zambaku in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 15th March 2009, 04:39 PM
  2. Charge shot
    By bunnyonion in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th October 2008, 10:53 AM
  3. Screen Shot Extension?
    By MikeB in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th August 2008, 08:32 PM
  4. Limited Shot System Example
    By xerus in forum File Archive
    Replies: 1
    Last Post: 18th December 2007, 01:55 AM
  5. Timed shot
    By Nickydude in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 3rd April 2007, 07:09 PM

Posting Permissions

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