User Tag List

Results 1 to 9 of 9

Thread: Push Box Spread Value Events

  1. #1
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Push Box Spread Value Events

    Hi

    I have some trouble getting spread value to work in my push box event. I also have some trouble understanding this in general. But how can I make these events work with more than 1 box? Where do I add spread value events?


    PushDetector is overlapping Box
    + Box is NOT overlapping Obstacle: Set HorizBox to HorizPlayer

    Push Detector is NOT overlapping Box: Set HorizBox to 0

    HorizBox <> 0
    + Box is NOT overlapping Obstacle: Start loop "MoveBox" ABS(HorizBox("Box")) times

    On Loop "MoveBox": Set X position of Box to X("Box")+(HorizBox("Box")/ABS(HorizBox("Box")))

    On Loop "MoveBox"
    + Box is overlapping Obstacle: Set HorizBox to 0, Set X position of Box to X("Box")+(0-HorizBox("Box")/ABS(HorizBox("Box"))), Stop loop "MoveBox"



    ... Or are my choice of events generally wrong?

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You don't. Don't use spread values and fast loops unless you want to export for something that isn't Flash or Java; use the ForEach object as it both increases simplicity and it has a linear speed decrease rather than an exponential one.

    Basically, for anything related to a box at all, you have it on a ForEach loop for object Box.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have fully access to ForEach object, and I tried that first... But mainly as a spread value replacement. I can give it a shot again.

    Edit:

    Well that did not work. How should I change the events to add ForEach?

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Did you make sure you put the "On ForEach Loop "Boxes" for object Box" at the top of the events, and you had an event "Always: Start ForEach Loop "Boxes" for object "Box"" ?
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah.. But should I still have the Loop events to move the box? Or should ForEach replace those aswell?? I mean, do I use ForEach as a spread value short cut, or as a loop that moves the box?

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    It's neither. It is a spread value replacement. For the looping, ForEach just need to be updated to run a loop on the currently selected objects, as looping during a for-each loop defeats the performance gain that it is intended for.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok I tried switching to ForEach events, and it actually worked one time on one box. One of the 3 boxes were pushable, but the remaining 2 were not. When I restarted the application, none of the boxes were pushable anymore. These are my events:

    Always: Start ForEach loop "BoxPusher" for object Box

    On ForEach loop "BoxPusher" for object Box
    + PushDetector is overlapping Box
    + Box is NOT overlapping obstacle:
    Set HorizMove of Box to Horiz("Player")

    On ForEach loop "BoxPusher" for object Box
    + PushDetector is NOT overlapping Box:
    Set HorizMove of Box to 0

    On ForEach loop "BoxPusher" for object Box
    + HorizMove of Box <> 0
    + Box is NOT overlapping Obstacle:
    Set X position of Box to X("Box")+(HorizMove("Box")/Abs(HorizMove("Box")))

    On ForEach loop "BoxPusher" for object Box
    + Box is overlapping Obstacle:
    Set HorizMove ("Box") to 0, Set X position of Box to X("Box")+(0-HorizMove("Box")/Abs(HorizMove("Box")))

    Anything wrong? I think its weird that it worked one time, and then stopped.

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    They don't look wrong and they work perfectly in a temporary MFA; the fact that it only worked once makes me think you have it in a delicate situation...could you post a stripped-down MFA?
    Working as fast as I can on Fusion 3

  9. #9
    Clicker Fusion 2.5+ DLCMultimedia Fusion 2HTML5 Export Module
    Kentronisk's Avatar
    Join Date
    Nov 2011
    Posts
    211
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I managed to fix it myself. It had nothing to do with the above events, but some gravity stuff that pushed the box down in the floor, thus making it overlapping an obstacle.

    EDIT:
    I dont understand how this works... If you wanna take a look, I have uploaded it on MegaUpload.

    http://www.megaupload.com/?d=G3UD01HO

    It seems its a bit random if the box overlaps the floor or not. And also, it seems like its a bit random when you push the box that it gets pushed into the wall or if it stops properly. Anything to change?

Similar Threads

  1. Performance of behavior events vs frame events
    By Ryan in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th July 2013, 05:24 AM
  2. Push Five
    By dubbros in forum iOS Released Games & Apps
    Replies: 1
    Last Post: 6th May 2013, 07:54 AM
  3. Push Notifications
    By Game_Master in forum iOS Export Module Version 2.0
    Replies: 33
    Last Post: 1st September 2012, 09:38 PM
  4. How are spread values spread ?
    By rudy in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th December 2011, 08:15 PM
  5. Group of events & global events - performance?
    By Leander in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 9th June 2010, 03:00 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
  •