User Tag List

Results 1 to 6 of 6

Thread: Same object in event

  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)Mac Export Module (Steam)

    Join Date
    Jan 2021
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Same object in event

    Is it posible to make event with the same object?
    Something like:

    Alterable Value A of "Group.Enemy" = Alterable Value A of "Group.Enemy"

    But scope it so that the first value was from one object, and the second from another.
    Also i trying to use two groups in one object, like:

    Alterable Value A of "Group.Enemy" = Alterable Value A of "Group.Bullets"
    Fixed value of "Group.Enemy" <> Fixed value of "Group.Bullets"

    But it doesn't seems to work.
    Are there any alternatives to this method?

  2. #2
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,384
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    The rule is that when conditions are evaluated, expressions don't scan the objects' scope, they only take the first object of the current object scope (if this object is not the one from the condition itself). The condition will scan only the instances of the object the condition is applied to.

    The Compare Alterable Value condition compares the alterable value of all (selected) objects A with an expression, the expression evaluator only takes the first selected instance of object B.

    To solve your problem you have to use a For Each loop, with 2 qualifiers for the same objects, and in the On Each Loop of Object A, compare Object B values with Object A:

    * Some conditions
    Start loop for each one of Group.Enemies, loop name "xxx"

    * On each one of Group.Enemies, loop name "xxx"
    + Alterable Value A of Group.Bullets = Alterable Value A( "Group.Enemies" )
    Do something

    (well, maybe someone will have a better solution for what you want to achieve, but at least this explains how it works - hopefully this explanation is clear :p)

  3. #3
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,123
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Something I do when comparing 2 objects is to run a For Each loop and store both values and the object's fixed and compare those at the end

  4. #4
    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)Mac Export Module (Steam)

    Join Date
    Jan 2021
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If i use:

    * Always
    Start loop for each one of Group.Enemies, loop name "xxx"

    *On each one of Group.Enemies, loop name "xxx"
    + Alterable Value A of Group.Bullets = Alterable Value A( "Group.Enemies" )
    Group.Enemy:Set RGB coefficient to GetRGB(200,0,0)

    It will apply on every single Group.Enemies object, even if event doesn't true.
    I think it happens because it calculate itself as the Group.Bullet so i decided to make a scoping that it fixed value doesn't equal to itself:

    *On each one of Group.Enemies, loop name "xxx"
    + Alterable Value A of Group.Enemies = Alterable Value A( "Group.Bullets" )
    + Fixed value of "Group.Enemy" <> Fixed value of "Group.Bullets"
    Group.Enemy:Set RGB coefficient to GetRGB(200,0,0)

    And it just doesn't work, even if Alterable Value A of Group.Bullets equal Alterable Value of Group.Enemies.
    Don't know what to do with that.

  5. #5
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,384
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    * Always
    Start loop for each one of Group.Enemies, loop name "xxx"

    *On each one of Group.Enemies, loop name "xxx"
    + Alterable Value A of Group.Bullets = Alterable Value A( "Group.Enemies" )
    Group.Enemy:Set RGB coefficient to GetRGB(200,0,0)
    This doesn't sound correct. If you want to apply an action to the selected Enemy object, you should probably exchange the objects in the Start Loop and conditions:

    * Always
    Start loop for each one of Group.Bullets, loop name "xxx"

    *On each one of Group.Enemies, loop name "xxx"
    + Alterable Value A of Group.Enemies = Alterable Value A( "Group.Bullets" )
    Group.Enemy:Set RGB coefficient to GetRGB(200,0,0)

  6. #6
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2020
    Location
    Canada
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Maddevil57 View Post
    Is it posible to make event with the same object?
    Something like:

    Alterable Value A of "Group.Enemy" = Alterable Value A of "Group.Enemy"

    But scope it so that the first value was from one object, and the second from another.
    Also i trying to use two groups in one object, like:

    Alterable Value A of "Group.Enemy" = Alterable Value A of "Group.Bullets"
    Fixed value of "Group.Enemy" <> Fixed value of "Group.Bullets"

    But it doesn't seems to work.
    Are there any alternatives to this method?
    Hey when I was having some scoping difficulties, this gentleman's article really helped me out:

    https://www.sprykegame.com/volblog/w...team-fusion-25

Similar Threads

  1. Replies: 4
    Last Post: 2nd November 2016, 12:40 PM
  2. Cannot get object to appear at event
    By Pesto in forum Fusion 2.5
    Replies: 1
    Last Post: 18th August 2015, 08:18 AM
  3. Event to happen when Object A is within a certain range of Object B?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 20th April 2012, 09:56 PM
  4. Create Object Event
    By dcrew in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 13th October 2010, 02:58 AM
  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
  •