User Tag List

Results 1 to 7 of 7

Thread: Code not triggering, need help

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

    Code not triggering, need help

    So I'm working on this path finding system, and don't worry the problem isn't that complicated. All I'm trying do at the moment is compare values in a list (which is numerically ordered through the use of preceding zeros before the list data). Here's a little photo that I drew up that will explain some of the values in my engine.

    https://dl.dropbox.com/u/4459105/MMF2/node.png

    On the left is the starting node. It's starting position is at (1,4). I wrote out the surrounding square coordinates. On the right is the list that's ordered by the "F values" for each square. Each line of the list represents data from a square. The first number is the F value, the next two numbers is that squares coordinates, and the final number is the corresponding index number for some other array (last part doesn't matter). Basically I'm testing for the lowest F value (which should be somewhere at the top of the list) however the square has to be adjacent to the previous square. I've stored the previous square's coordinates in two alterable values called "Parent X Val and "Parent Y Val".

    So at the start of this fast loop on the first loop it will set the lowest number to an alterable value (Check F Val=40 as in the photo above). Then each loop it will compare the next line in the list. If the F values are the same it will compare the square's coordinates with the Parent X and Parent Y vals. I use the absolute value of the difference between the two values and compare it to either 0 or 1.

    Here's a look at my code:
    https://dl.dropbox.com/u/4459105/MMF...38.24%20PM.png

    As you can see I added an "end application" action in this line, however it does not trigger. I made sure that the Parent X and Y values are correct and that the data is correct in the list. For some reason it's not triggering. Could anybody help me? I know this is kind of a long post and a bit complicated to explain, but it's really not that confusing... Thanks.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be better if you uploaded an example, it is rather confusing this way. And also the best way for you to debug such things that need to be ordered in a certain manner is to use another list object, that would list out the order of your events as they happen, so you can check where it stops or goes wrong.

    And check if the list object in your code has unticked 1 based index, that might be the reason why its not triggering.

  3. #3
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    2,997
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    To add to SkyHunter's comments, the best way to test whether a condition(s) has been met play a sound in that event line! Make it the last action, if it fires the conditions where met and the actions performed. If it doesn't then you know which area of code to study...

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    rubes's Avatar
    Join Date
    May 2011
    Posts
    364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great idea with playing the sound as the last action for debugging purposes. I'm adding that to my arsenal

  5. #5
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if sounds would work so well since the code is fast loops... wouldn't they all sound at the same time basically? I actually have a second list on the screen as debug, but it's not helping all that much. Everything in my example starts at base index 0 including the lists and arrays. Fast loops start with a zero base index as well. Here's an example file if you want to look at it. Look at the "Compare F Values" group.

    https://dl.dropbox.com/u/4459105/MMF...gine_Array.mfa

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds work very well for any kind of simple testing of whetever event has trigered, even in fastloops when the sound is short and not too aggressive.

    Your most likely problem is the string parser, i had this problem myself recently, the string parser cannot change its source string twice in a single event properly. And not to mention your strings are ussually empty even before that, check: https://dl.dropbox.com/u/14962632/Pu...ine_Array2.mfa

    Also, you should learn to use lists to debug properly, your second list object just repeated the events of the first one...

  7. #7
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Sumo's Avatar
    Join Date
    Jul 2008
    Posts
    642
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ah I figured it out. After setting some strings to listGetAt$( "String Parser", 2) and listGetAt$( "String Parser", 3) I found out that it wasn't parsing the string correctly. I needed to add "(" as a delimeter so that the numbers were parsed correctly. Now the code triggers fine. I had the second list repeat the events because in the first list some of the lines were removed from it. I wanted to gather the total data without any loss to see if the engine was constructing it correctly. Thanks for the hint that the parser cant change the source string in one event properly, it'll help in the long run.

    Thank you everybody for helping me.

Similar Threads

  1. Multiple events triggering from one button press
    By Smakian in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 20th September 2013, 09:58 AM
  2. Object Not Triggering Animation 100% of the Time
    By tomrslever in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 7th September 2013, 05:18 PM
  3. Inconsistent triggering of Q&A, take 2
    By Teero in forum File Archive
    Replies: 2
    Last Post: 20th January 2011, 04:24 PM
  4. Triggering samples - user defined possible?
    By neupix in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd July 2008, 03:54 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
  •