User Tag List

Results 1 to 6 of 6

Thread: Restrict Actions

  1. #1
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Restrict Actions

    Does anyone have a clever way of replicating this condition, as it bugs out after about 10 minutes of play time.

    It's for shooting a variety of weapons, so the every condition is ruled out as it adds a delay to firing depending on when you pull the trigger. The weapon rates of fire varied from 00:05 to 00:60 when I used restrict actions.

    I've tried creating counters which always add 1 and then reset every 100, then I tried adding some calculations to try and get the weapons to fire according to that counter being divisible by the original number, but I couldn't get it to work very well.

    Can anyone help with that, or provide a neater solution to replacing the restrict action?

    I want projectiles to shoot when the trigger is pulled, and then count timers from that point - so it's a shame restrict actions is bugged, but Francois has confirmed this can't be sorted until MMF3 in a previous thread.

    Thanks

  2. #2
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,009
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Hey Asholay,

    Your method with the counters is much more efficient and you'll get a kind of 'Delta-Time' to work with as opposed to the internal timer.

    There are a number of ways you can achieve it but I tend to use Always:Add 1 to Counter then when you want just MOD the counter at the time it's required and compare the mod value to give you an exact remainder.

    Example:
    +User presses any key:
    -Set Global Value A: (Counter MOD 10)

    Then you can use that throughout your events to control intervals such as:

    +User Presses 'Spacebar'
    +Global Value A = Counter MOD 10:
    -Do Stuff

    There are a couple of other ways you can achieve different effects using the standard frame loop, however that above will give you a 'delay' between each press, so it works exactly as 'Restrict Actions By' would... you just change the 10 in both events to however many frames you want to delay by.

  3. #3
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Danny, I think I understand, but having real difficulty getting a practical version to work.

    The delay is causing a problem, because when I implement something which resets the counters (to ensure a shot is fired straight away) it allows players to tap buttons rather than hold, and this will keep firing the weapon, ignoring the whole restrict actions effect.

    Maybe I'm not doing it properly, but it seems like I'm needing lots of extra counters and code to do this. I tried putting yours into action, but was unsuccessful

    This is how I've got my code laid out:

    2 counters per player.
    1st one is always counting up
    2nd one is getting set to a MOD of the first counter while the trigger is held, depending on the weapon and level of that weapon, so it essentially just loops through a certain amount of numbers.

    shooting button pressed once - set 1st counter to 0 (to reset the shot)

    shooting button held - set 2nd counter to a mod of the 1st - as noted above)

    shooting button held - shoot projectile when 2nd counter = 1


    This seems like a poor way of coding so I've definitely not understood your method properly - plus this is quite buggy, as it sometimes shoots 2 shots (plus the aforementioned problem of button mashing!)

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    452
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can easily make an event for firerate using only one value, either alt, global or a counter, instead of using restrict action.

    -value A > 0
    =substract 1 from value A


    -repeat while fire key is pressed
    -value A = 0
    =set value A to Weapons cooldown

  5. #5
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,009
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Ash I'll post some source for you before Sunday. I'm working away until then... D:
    Want to learn Clickteam Fusion 2.5?




  6. #6
    Clicker Multimedia Fusion 2iOS Export ModuleXNA Export Module
    Asholay's Avatar
    Join Date
    Nov 2008
    Location
    England
    Posts
    360
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Danny - it would be great to get to grips with the MOD function once and for all.

    Skyhunter - elegantly simple and just perfect really. I knew I was massively overcomplicating things, but always good to learn!

Similar Threads

  1. Restrict Actions
    By Keyboarder in forum Multimedia Fusion 2 - Technical Support
    Replies: 17
    Last Post: 9th December 2011, 10:50 PM
  2. Restrict Actions Breaks
    By Pkeod in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th May 2008, 04:50 PM
  3. 'restrict actions' bug
    By moomoo in forum Multimedia Fusion 2 - Technical Support
    Replies: 19
    Last Post: 12th July 2006, 08:56 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
  •