User Tag List

Results 1 to 4 of 4

Thread: Events and Range?

  1. #1
    No Products Registered

    Join Date
    Feb 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Events and Range?

    I have two questions. Is there any way to make it if an object gets within a certain amount of pixels of another object it will shoot an object at that object. Also is there a way to make an event happen even if the screen isn't on it.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    658
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Events and Range?

    The easiest way to make an object shoot at another is to set up a detection object. When the object to be shot at collides with the detection object, make the object shoot it by setting a flag on or whatever.

    If the object has to shoot in an infinite number of directions (i.e. in a circular radius instead of strictly left/right, up/down, etc.), you will want to look into Fusion's trigonometry functions, specifically the ATan2 function, which will essentially allow you to pinpoint the angle at which to make your AI shoot the incoming object. The trig functions can also be used to detect the distance between the two objects without the need for a detection box.

    As for making events happen if the screen isn't on it, you'll need to be specific. Are we talking about an event on a separate frame, or in the same frame but far away? Either way, one thing to do would be to trigger a variable, either global or otherwise, for that specific event and when the player gets to where that event is supposed to happen, trigger it.

    For instance, let's say the variable is "everything is on fire." If you didn't set off the event that triggers it, the variable would be 0. If you did do that, though, set it to one, and then specify in the code what happens when "everything is on fire" = 0, and what happens when "everything is on fire" = 1. If you do this as a Global Variable/Event/Object, you can have it affect multiple frames, or you can keep it within one frame.

  3. #3
    No Products Registered

    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Events and Range?

    All you would need is some triginometry.
    Work out what radius the other object needs to be from your object for it to be within range.
    Use an extension called Advanced Direction Calculator. It should do what you want no worries.

  4. #4
    No Products Registered

    Join Date
    Feb 2010
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Events and Range?

    Thank You

Similar Threads

  1. Performance of behavior events vs frame events
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th July 2013, 05:24 AM
  2. Range of an Alterable Value
    By LB in forum Articles
    Replies: 9
    Last Post: 25th June 2011, 02:07 AM
  3. Range Handler
    By Phi in forum Widgets
    Replies: 1
    Last Post: 12th May 2011, 02:02 AM
  4. Group of events & global events - performance?
    By Leander in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 9th June 2010, 03:00 PM
  5. set global value range
    By rhoymand in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 4th December 2006, 04:16 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
  •