The Daily Click ::. Forums ::. Klik Coding Help ::. code not triggering, need help
 

Post Reply  Post Oekaki 
 

Posted By Message

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
26th January, 2013 at 26/01/2013 20:47:32 -

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.

Image

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:
Image

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.

All of my lists and arrays are starting with a 0 based index. The fast loops start with 0 base indexes as well.


Here's the .mfa file if anybody wants to take a look.
https://dl.dropbox.com/u/4459105/MMF2/Pathfinding%20Engine_Array.mfa

Edited by Sumo148

 
n/a

Sumo148

Super amazing fantastic user

Registered
  26/01/2009
Points
  530

360 OwnerThe Cake is a LieVIP MemberPokemon Ball!I am an April FoolI donated an open source projectSanta Hat
27th January, 2013 at 27/01/2013 20:50:25 -

I found out that the string parser wasn't parsing it correctly because I needed to add "(" as a delimeter.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click