User Tag List

Results 1 to 4 of 4

Thread: Objec t Selection / Spread Value Question

  1. #1
    No Products Registered

    Join Date
    May 2007
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Objec t Selection / Spread Value Question

    I'm surpremely frustrated trying to get my simple enemy behaviors working.

    I have an enemy that walks towards the player and shoots at him, and avoids stepping off the edge of platforms. All well and good.

    And for multiple incarnations, I do a Spread Value, and a fast loop to handle each instances events. But if I added more than say 3 or 4, spread out through a big scrolling frame, the first enemies I see will behave properly, but when i come to another one later on in the frame, big chunks of his events just won't execute. He won't move to you or shoot.

    I think the crux is I have it set to only walk/fire at you if you're close to it Abs(Player(x)-Enemy(x) + Player(y) - Enemy(y)) < 250 or somesuch. I can't seem to get this to work, and it's really frustrating.

    I've even tried using the Object Selection Extension to spread 1 on Enemies that meet that criteria and fast loop for that, but it's also buggy.

    Can anyone give me some tips on how to have multiple instances of an active object only perform events when close to the player?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module

    Join Date
    Jun 2006
    Posts
    1,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Objec t Selection / Spread Value Question

    http://www.bbc.co.uk/schools/gcsebitesize/maths/shapeih/pythagorastheoremrev2.shtml

  3. #3
    No Products Registered

    Join Date
    Oct 2006
    Location
    Uruguay
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Objec t Selection / Spread Value Question

    Just in case Sarah's answer was a little "short"... your problem is probably the way you're calculating the distance between the player and the enemy...

    Check out that link, and use the proper equation for it...
    And tell us if that solved the problem!!

  4. #4
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    California, USA
    Posts
    1,247
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: Objec t Selection / Spread Value Question

    Pythagoras Theorem is "a^2 + b^2 = c^2"

    In MMF2 this can be calculated using the Specials Object / Compare Two General Values. Something like this:

    Sqr( Abs(X( "Active 1" )-X( "Active 1" )) )+Sqr( Abs(X( "Active 2" )-X( "Active 2" )) )

    :for the first value and 250 (from the example above) for the second value. I would use the =< comparison just in case the object is moving faster than the event loops speed.
    DT
    Special Projects Director

Similar Threads

  1. Spread value question
    By Stefan in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th March 2012, 01:00 PM
  2. Another spread value question
    By ionside in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th February 2009, 09:00 PM
  3. yet another spread value question
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 15th June 2008, 01:17 PM
  4. Spread value and object selection, part II
    By gum in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 19th September 2007, 06:26 PM
  5. Problem with spread ID and object selection
    By gum in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 14th September 2007, 05:32 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
  •