SRL Archive - OSR Help

FFlag used in SPS_WalkPath


Wardancer

2013-02-07 02:31:11

Long story short, I'm at the middle of customising SPS_WalkPath and SPS_WalkToPos for a script so it isn't completely useless when moving and to customize when it returns true or move to a new point. The changes by themselves are quite simple, but I stumbled upon a line which I don't fully understand. Well, I don't understand its use at all.

From my understanding, FFlag is a boolean function that returns true when you're within a decided distance of a flag. The way it is used in SPS_WalkPath surprises me:

FFlag(5 + (Integer(I <> H) * 15)); 

I should precise at this point that "I" represents the current point in the path and "H" represents high(Path). Is there any practical reason why the distance before FFlag returns true is based on these integers, is there is something that I'm missing/misunderstanding or is the usage of these integers is merely to add a custom randomization to paths?

Thank you for your time.

DannyRS

2013-02-07 04:12:31

I don't understand it either, but I know FFlag will exit and return true when the flag is no longer on the MM, because the flag disapears 3-4 tiles before you reach your point, SPS will continue to the next point early, theres also the time it takes to calculate position and then move the mouse there for a click, so if you want pinpoint accuracy, then you need to be completely still before moving to the next point (I find 1500ms wait after FFlag is about as good as it gets), theres also the 5x5 randomness of the point click in SPS and multimouse within it, if you look at my airorb charger, I edited all these to get it more accurate, but you still have to stand still for that split second to ensure accuracy

Theres also the fact Sps will exit if you are within 2ish tiles of your point, because it's not 110% accurate and position can vary by a few tiles,

Sps walking to a point, then waiting 1.5+randomness seconds, then using a DTM, is probably the only easy way to walk to an exact point, tho my air charger walkpathing got to be accurate within 1 tile around my chosen tile, which can be worked with most of the time,

Theres also the fact you can have your point 1 space into a wall ( say for in a bank like castlewars or etc, then Sps will click into the wall, making your flag/position exact to the bank tile, meaning you can more or less get 100% accurate results when a wall/sizeable object is at a direction of your position,

Accuracy of your custom map is also really inportant because the more accurate your position calculation, the better the walking results,

/soz for wall of text ;)

Wardancer

2013-02-07 11:10:39

From: DannyRS
I don't understand it either, but I know FFlag will exit and return true when the flag is no longer on the MM, because the flag disapears 3-4 tiles before you reach your point, SPS will continue to the next point early, theres also the time it takes to calculate position and then move the mouse there for a click, so if you want pinpoint accuracy, then you need to be completely still before moving to the next point (I find 1500ms wait after FFlag is about as good as it gets), theres also the 5x5 randomness of the point click in SPS and multimouse within it, if you look at my airorb charger, I edited all these to get it more accurate, but you still have to stand still for that split second to ensure accuracy

Theres also the fact Sps will exit if you are within 2ish tiles of your point, because it's not 110% accurate and position can vary by a few tiles,

Sps walking to a point, then waiting 1.5+randomness seconds, then using a DTM, is probably the only easy way to walk to an exact point, tho my air charger walkpathing got to be accurate within 1 tile around my chosen tile, which can be worked with most of the time,

Theres also the fact you can have your point 1 space into a wall ( say for in a bank like castlewars or etc, then Sps will click into the wall, making your flag/position exact to the bank tile, meaning you can more or less get 100% accurate results when a wall/sizeable object is at a direction of your position,

Accuracy of your custom map is also really inportant because the more accurate your position calculation, the better the walking results,

/soz for wall of text ;)


I've been playing a lot with SPS last few days and know pretty much all you said. For accuracy though, I like to make TPA that only gives the correct result so if it isn't found on MS, I make it walk to a position (and since it's standing still at that point, it's flawless). Therefore, what I'm looking for is speed rather than accuracy as my failsafes can correct any issue. I believe that you confuse Flag with FFlag though with this explanation.

The point of this thread was merely to ask if there is a reasoning behind the variables chosen for FFlag and you went on a tangent (certainly interesting for many though). My question remains the same.

Hint: For shorter walking time, use smaller maps whenever possible as the processing time goes up exponentially the bigger the map is. Since a recent fix, it's possible to use multiple maps within the same script and I certainly encourage to do so whenever possible. Chopping down excess of black also speeds things up.

Le Jingle

2013-02-07 11:25:35

Isn't that just autoboxing the integer calculation? ex. that replaces having do declare an integer variable and assign the calculation to it?
iirc then it looks for that amount of calculated degrees around the MM (probably some overkill for longer paths?)

idk, probs just piecing together a load of bologna :p

soz for the rant
-Lj