User Tag List

Results 1 to 5 of 5

Thread: check qualifier of an object at runtime?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,241
    Mentioned
    86 Post(s)
    Tagged
    0 Thread(s)

    check qualifier of an object at runtime?

    Is there a way to determine what an object's qualifier is, at runtime? I'd like to be able to do something like this, to prevent having to have many events that poll for collisions each frame:

    Everything the player can collide with has the qualifier "physical object". In addition, these same objects have further qualifiers that specify more precisely what they are, such as "bad", "npc", "rockets" etc. Then I'd like to do something like this:
    Code:
    ==player collides with "physical object"
    ---------set rememberWhichObject("valueHolder") to fixed value of "physical object"
    ---------start fastloop "we collided with something. What now?"
    
    ==on loop "we collided with something. What now?"
    ==fixed value of "physical object" = rememberWhichObject("valueHolder")
    =="physical object" also has the qualifier "npc"
    -----------make npc yell at player
    
    ==on loop "we collided with something. What now?"
    ==fixed value of "physical object" = rememberWhichObject("valueHolder")
    =="physical object" also has the qualifier "rockets"
    -----------blow up player
    
    ==on loop "we collided with something. What now?"
    ==fixed value of "physical object" = rememberWhichObject("valueHolder")
    =="physical object" also has the qualifier "bad"
    -----------play player's frowning animation
    So is there a way to make the conditions shown in bold? I know I could achieve a similar result using Alterable Values instead of qualifiers, but that would require reworking a fair bit of code, so I'm curious whether I can just test for qualifiers

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Hi Volnaiskra,
    as far as I know, it's not possible to test for qualifiers.

    However, as you said, it is doable with Alterable Value/Strings.
    It shouldn't require too much code reworking: you could just add one single event in which you create an association between a type of Qualifier and an Alterable String (or a Value). Then, you test for Alterable Strings (instead of qualifiers) within each loop.

    I've attached a small example for better clarity. Hope this helps you in some way!
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,241
    Mentioned
    86 Post(s)
    Tagged
    0 Thread(s)
    Great idea! I'll do it this way. Thanks

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,155
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    I think you should be able to do it in this way:
    (seem to remember I used this solution a couple times)


    ==on loop "we collided with something. What now?"
    ==fixed value of "physical object" = rememberWhichObject("valueHolder")
    =="fixed value(physical object)" = "fixed value (npc)"
    -----------make npc yell at player


    Or in your case also:


    ==on loop "we collided with something. What now?"
    ==fixed value of "physical object" = rememberWhichObject("valueHolder")
    =="fixed value(npc)" = rememberWhichObject("valueHolder")
    -----------make npc yell at player

  5. #5
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,241
    Mentioned
    86 Post(s)
    Tagged
    0 Thread(s)
    Yes! Of course! That sounds like it would work perfectly. Thanks schrodinger! I love this forum

Similar Threads

  1. Impossibe to check overlap of objects of the same kind/qualifier?
    By GrayFace in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th November 2013, 08:04 AM
  2. Qualifier change on runtime
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 15th February 2013, 08:33 PM
  3. Way to add or remove qualifier during runtime?
    By ZayLong in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 15th September 2010, 01:26 AM
  4. Object within a qualifier overlapping another?
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd July 2010, 07:36 PM
  5. Object folder and Object qualifier in Global event
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 27th December 2009, 04:28 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
  •