User Tag List

Results 1 to 7 of 7

Thread: Scaling and Overlap not triggering?

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Scaling and Overlap not triggering?

    So I am starting to make a randomly generated dungeon engine. I am creating rooms of random size (with a min/max width and height) that are randomly positioned around the frame. The room object is a 1x1 pixel and I'm using the x and y scale to scale it to the random sizes.

    The problem is when I create a room on top of another room, I want to delete it and try again. For some reason the overlap condition doesnt seem to be triggering. I am trying to compare two of the same object for overlap. I'll post a picture of my code and the test frame when I run the program. It's only 3 lines of code so far so something is up...

    My Code:


    Test Frame:

  2. #2
    Clicker Fusion 2.5Fusion 2.5 Mac
    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)
    zip2kx's Avatar
    Join Date
    Jun 2015
    Posts
    845
    Mentioned
    18 Post(s)
    Tagged
    0 Thread(s)
    Try doing a seperate, nested loop to check for overlap.

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator Pro
    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
    Jul 2006
    Posts
    574
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    On line 3 try switching the "Index of" and "Loop Index".

  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,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    In line 3 is it object overlaps different instance of same object?
    I think that won't work without a separate check as zip2kx suggests
    (will also need an extra detector object to catch the overlap)

    ...but won't also work correctly unless you add a frameskip due to the "overlap delay" bug
    (but you can't skip frames unless you change your engine and make it "slower" in building the maze, by allowing 1 frame redraw for each room you place )

    If those are strictly "rectangular" rooms you could consider doing "math checks",
    won't need extra detectors, will be performance friendly, and won't suffer from the overlap bug

  5. #5
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator Pro
    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
    Jul 2006
    Posts
    574
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I mean changing it to "Loop Index..." = "Index of..."

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    So the problem is having the same instances of an object trying to check against itself? If I create a detector object and have it scale to the newly created room size and location, then test that detector for the previously created rooms, would that change anything? If it returns false, I could then create the normal room in the same location.

    What is this "overlap delay" bug? I've never heard of it. I'll try the other suggestion you guys made when I get home from work.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    If I create a detector object and have it scale to the newly created room size and location, then test that detector for the previously created rooms, would that change anything?
    this should theorically work, but won't work due to the overlap delay bug
    this bug prevents a correct overlap detection among two "moving" (or scaled, rotated) objects
    because the collision mask of the second object ("B" in a "A overlaps B" condition)
    will not be refreshed until the next frame cycle

    say you have object A at 0,0 and object B at 100,100

    then you do:
    >>> place B at 0,0

    test for A overlaps B
    >>> do something

    it won't return true until next frame cycle

    if A was there since previous frame cycle,
    you move B and test B overlaps A
    this would return correct because A collision mask is still lagging
    but A didn't move so it's still correct

    watching your code again, this could possibly work due to the fact you are creating objects on the fly
    (created objects forcedly have a "refreshed" collision mask - the bug won't show if you check A against a "just created" B)
    but not sure due to the fact you are scaling them, and I think this could cause the issue!

Similar Threads

  1. Triggering an animation only while holding a key :D
    By sardonyxfox in forum Fusion 2.5
    Replies: 4
    Last Post: 14th May 2018, 10:15 PM
  2. Code not triggering, need help
    By Sumo in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 27th January 2013, 05:32 PM
  3. Object overlap - Overlap area
    By Ls2 in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th May 2012, 10:06 PM
  4. Inconsistent triggering of Q&A, take 2
    By Teero in forum File Archive
    Replies: 2
    Last Post: 20th January 2011, 04:24 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
  •