User Tag List

Results 1 to 2 of 2

Thread: Instanced active objects

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Instanced active objects

    I sometimes get a little confused working with instanced active objects, and I'm hoping that any answers to the question below will help shed some light on the subject.

    I have a single active object called "card". There are 52 of these on the screen. The bottom row has an alterable value called "BottomRow" that is set to 1 for all cards on the bottom row. The cards have another alterable value called "Rank" with numbers ranging from 0 to 12. (Ace through King.)

    There is a separate active object at the bottom of the screen (the foundation card) that also has a "Rank".

    I need to know if there are ANY playable cards. (Cards must be on the bottom row, and the rank must be 1 greater or 1 less than the foundation card.)

    These conditions do not seem to be working:

    + Card(BottomRow) = 1
    + Abs(Foundation - Card(Rank)) = 1
    - Set counter to 1

    I assumed that "Card(BottomRow) = 1" would essentially eliminate all cards except the bottom row, and then the second condition would check to see if any of the remaining cards were 1 rank higher or lower than the foundation rank.

    Why isn't this working? (Do I need to use a fastloop to reference each card individually? I tried that, but it doesn't seem to be working either, for some reason.)

  2. #2
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Instanced active objects

    Calculations don't select objects, so the second condition won't work properly.
    Do:
    Rank("Card") = Rank("Foundation") - 1
    OR
    Rank("Card") = Rank("Foundation") + 1
    (using the compare to alterable value condition on the card object)
    (You need the latest build installed to be able to use OR conditions, or you can just use two events and duplicate the actions)

    This will test and select any "card" objects that pass the test, because the card object is not only used in a calculation. The foundation object(s) will not be tested/selected based on the result, because it is only used inside a calculation. As long as you only have one foundation object (at all, or that was selected by earlier conditions), this will work correctly.

Similar Threads

  1. Re: life counters for instanced enemies
    By jchristiansen in forum File Archive
    Replies: 9
    Last Post: 26th October 2009, 01:08 AM
  2. life counters for instanced enemies
    By jchristiansen in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd October 2009, 12:52 AM
  3. Collisions Between Active Objects & Image Objects?
    By mkj5025 in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 18th February 2009, 08:58 PM
  4. Instanced Events
    By artician in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 20th May 2008, 01:07 PM
  5. Sound Volume from Instanced Source Objects?
    By Caiman in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 11th July 2007, 04:12 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
  •