User Tag List

Results 1 to 4 of 4

Thread: How to use copys of an active in different places

  1. #1
    No Products Registered

    Join Date
    Jun 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to use copys of an active in different places

    I am building a mega man style game.
    One of the enemies is a bat, the bat is activated when the player gets close, once activated the bat will follow the player around.

    I have attempted to set up the following event that will activate the bat.

    XPosition"player" < XPosition"bat" +70
    XPosition"player" > XPosition"bat" -70
    YPosition"player" < YPosition"bat" +70
    YPosition"player" > YPosition"bat" -70

    This sets up an invisible box 140x140 around the bat that if the player steps into the bat will activate.
    It works fine with one bat on screen.

    The problem I am having is when I try to use multiple bats as seen in the following screen shot. When the player gets close to one of the bats all of them activate.

    Is there a way to use copies of the same active, but get them to act at different times or will I need to create a separate active for every bat I want to use.

    This is the screen with all the bats inactive.


    This screen is once the player has gotten close to one of the bats. The bat at the top has still activated despite the player being far away. One bat activates all.


    I hope that all makes sense.

  2. #2
    mojofltr
    Guest

    Re: How to use copys of an active in different places

    I believe the reason it is not working for you is because the event is not selecting which bat to test the distance from.

    Try setting an alterable value for x and y within each of the bats... and then rewrite your events. ie:

    ALWAYS set an alterable value to X("bat")-X("megaman") and another to Y("bat") - Y("megaman")

    Then make your activation conditions something like:

    abs(Alterable Value A( "bat" ))<70
    abs(Alterable Value B( "bat" ))<70


    //edit//

    Oops, I just tried that and I led you astray. Apparently comparing two general values didn't work. Instead, set the alterable values to abs(X("bat")-X("megaman")) and abs(Y("bat")-Y("megaman")) and make your activation conditions:

    alterable value A < 70
    alterable value B < 70...

    I've made a quick example: http://mfa.aquadasoft.com/view/1310229095-move2

  3. #3
    No Products Registered

    Join Date
    Jun 2010
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use copys of an active in different places

    Worked like a charm.
    Now all of the bats move individually.

    Thanks for the help.


  4. #4
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: How to use copys of an active in different places

    The simple alternative is to use your original events, but rewrite the conditions so the bat is on the left.

    eg.
    XPosition"bat" > XPosition"player" -70
    XPosition"bat" < XPosition"player" +70
    YPosition"bat" > YPosition"player" -70
    YPosition"bat" < YPosition"player" +70

    It's *very* important to understand that this makes a big difference to the way MMF2 interprets your events.

    Have a read of this:
    http://www.create-games.com/article.asp?id=1975

Similar Threads

  1. Decimal places?
    By ChrisBurrows in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd October 2011, 08:07 PM
  2. Course de voiture: places du joueur
    By conceptgame in forum File Archive
    Replies: 1
    Last Post: 13th July 2011, 11:50 PM
  3. Where has the extension DL places gone?
    By Tiny in forum Extension Development
    Replies: 4
    Last Post: 29th June 2011, 05:10 PM
  4. Too many Edit places in MMF2
    By OldGuy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th October 2008, 03:10 PM
  5. Decimal Places
    By SharpS in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 18th December 2007, 01:06 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
  •