SRL Archive - Suggestions

FindColor extension.


Wizzup?

2010-01-04 10:42:35

So, I think it would be really useful to have a function that searches from the right bottom corner to the left top corner. We could create a new function for this, or introduce the following:

In FindColor:
if (xs,ys) < (xe,ye) then FindColorNormal (from left)
else if (xs,ys) > (xe, ye) then FindColorRightBottomFirst;

I don't think it would be much of an overhead to add this, but it would make "debugging" your scripts code harder; currently we throw an exception if invalid coordinates are passed. (xs,ys>xe,ye is also considered invalid)

EDIT: We could also make it some sort of mode.
SetColorFindingModeBlaBla(cfm_LeftTop)
SetColorFindingModeBlaBla(cfm_BottomRight)

mixster

2010-01-04 11:38:58

I would say people who know what they are doing don't generally use FindColor, preferring FindColors and if they don't then a FindColorSpiral like function would be suitable in near all cases I would think.

Wizzup?

2010-01-04 11:47:04

From: mixster
I would say people who know what they are doing don't generally use FindColor, preferring FindColors and if they don't then a FindColorSpiral like function would be suitable in near all cases I would think.


Well, spiral wasn't suitable in my case… http://www.ferryhalim.com/orisinal/g2/applegame.htm

mixster

2010-01-04 12:11:38

FindColors could have been used though then inverting the TPA, resulting in the bottom right most ones being returned first or you could base it on a very specific area just above the basket rather than the entire area.

Markus

2010-01-04 13:34:24

Spiral could've been used by setting the spiral @ bottom-right?

Wizzup?

2010-01-04 14:00:30

From: mixster
FindColors could have been used though then inverting the TPA, resulting in the bottom right most ones being returned first or you could base it on a very specific area just above the basket rather than the entire area.


We can also do FindColor with FindColors then? And FindColorSpiral as well.

EDIT: Just a small note, why invert the TPA if you can just access its last element? :p

mixster

2010-01-04 14:34:18

Inverting is more fun of course! I would say that removing FindColor would be a good idea if it were not so heavily embedded in everyone. The only time I really ever used it, after learning TPA's, was when I was too lazy to properly script something.