User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: How to find the vertical speed of an active?

  1. #1
    Clicker 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)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Question How to find the vertical speed of an active?

    Since Speed( "Player" ) get any direction moviment speed and doesn't work in custom moviment, I can't use it.
    I need a way to find the vertical speed no matter if it uses a preset moviment or custom moviment.
    I think it can be found using expression, but I don't know how...

  2. #2
    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)
    You need the "vertical speed" of an object
    meaning how much it's moving vertically (through Y coordinates?) ... per frame?

    While you move your object, you could simply:

    Always
    >>> set counter "show_speed" to abs(value_storeY("object")-Y("object"))
    >>> set value_storeY to Y position of object

    counter "show_speed" will show you the object's vertical speed per frame

  3. #3
    Clicker 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)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I don't understand how but it looks like working, thanks!
    Since you knew that, using this, how could I detect if the player has stopped without triggering when the object end the jump and started falling?
    I was trying to detect how much the object stays in zero to know if it was stopped, but I don't know any good way to do this in one or two events without a counter or value...

  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)
    mmm, not sure if you need something more "advanced",
    but as a test maybe you could "add" to another value when the player Y position remains the same for some time?

    So, yes, I'd say you would need another value or counter, to record this "time".

    i.e.

    storeY-Y("player") <> 0
    >>> set value_timer to 0
    (so we reset the "timer" when the player Y velocity is not 0)

    then insert this other condition:

    value_storeY = Y("object")
    >>> add 1 to value_timer

    make sure you place both these events before the "always" condition we talked about in previous post!


    then when:
    value_timer > X (any amount you feel does the job right, i.e. try with 4 or 10..)
    the player is stopped

  5. #5
    Clicker 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)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I'll try this
    Last one, is there a way to detect the direction (up or down) using the first expression?

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You should be able to remove the abs() from this: abs(value_storeY("object")-Y("object"))

    so that you are left with value_storeY("object")-Y("object"), then reverse this to Y("object")-value_storeY("object"), and check if the value is negative (object was moving UP) or positive (object was moving DOWN).

  7. #7
    Clicker 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)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Everything works great! Thank you all guys!
    Soon I hope to upload some interesting things in the ClickStore!

  8. #8
    Clicker 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)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    But there's a little problem with the detect if the player is stopped, because em the player ends the jump it can sometimes trigger...
    To avoid this, could be possible to get this number (Y speed) in decimal? So it would stay less time in the zero when ending jump...
    Or any other way to detect if the player stopped suddenly. I'm thinking in compare the last Y, if it's greater than certain value and it's positive, it means that the player stopped suddenly after fall down, right?
    Help if you can, you already helped me a lot, and I'm very thankful.

  9. #9
    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)
    To get Y speed as a float you should have floating Y coordinates,
    it depends on your movement, if you use a custom movement system and work with Y position in an alterable value for example,
    this can be done,
    otherwise subtracting raw screen Y coordinates will always give you integer numbers.

    To understand if there could be other ideas, what exactly you need to do?
    Detect when the player has ended a jump? (we may need to know how you coded the jump for a better answer)
    Or detect when the player is staying on ground? (this could be done with some looping or a detector)
    Or other?

  10. #10
    Clicker 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)
    Fuuriokun's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    243
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If the player touch the top of the ground to trigger something, no matter if the ground is a obstacle or an active...
    Any solution? I prefer to not use more actives like detectors, but if there's no another way...

Page 1 of 2 1 2 LastLast

Similar Threads

  1. [HowTo] Find the Height of an active Object?
    By BackStaged in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 1st October 2010, 03:24 AM
  2. Animation speed/frame bug in an active?
    By AdamDobay in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 29th August 2010, 04:20 PM
  3. Subapps, Active Boxes = HWA speed killers?
    By Blizna in forum Hardware Accelerated Runtime
    Replies: 5
    Last Post: 9th June 2009, 09:57 AM
  4. slider to control speed of active element.
    By tourmaline in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th May 2007, 09:10 PM
  5. Speed of active object
    By Dariorox in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 29th November 2006, 12:04 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
  •