Posted By
|
Message
|
Don Luciano Heavy combat pancake
Registered 25/10/2006
Points 380
|
30th May, 2009 at 17:30:35 -
How would i pick an object with the highest alterable value? to determine who acts first in combat? but not just two objects, but quite many.
Code me a sausage!
|
RedEnchilada formerly RedEchidna
Registered 01/08/2008
Points 301
|
30th May, 2009 at 23:31:25 -
Always:
Spread value 0 in Value Z of objects
Always:
Run loop "highest" Nobject(Objects) times
Set value of "Temp counter" to 0
On loop "highest":
Value Z(Object)=Value(Temp counter):
Set value of "Highest value" to Max(Value A(Object), value("Highest value"))
Add 1 to "Temp counter"
Value A (Object)=Value(Highest value):
Pick one of "Object":
Do whatever
You can do some other math to go down the list, but that's basically it.
http://www.youtube.com/watch?v=WYrSD35vHo4
woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan
|
Don Luciano Heavy combat pancake
Registered 25/10/2006
Points 380
|
31st May, 2009 at 13:23:38 -
Uh, i dont understand. whats the point with temp counter instead of loopindex?
Set value of "Highest value" to Max(Value A(Object), value("Highest value"))
Where what?
Max(Value A(Object)?? u mean condition to see if bigger?
Can you explain a bit noobishly? I am totally confused.
Code me a sausage!
|
RedEnchilada formerly RedEchidna
Registered 01/08/2008
Points 301
|
31st May, 2009 at 14:17:55 -
Ok, setting the highest value counter to Max(Value A(object), value(highest value counter)) sets it to that object's alterable value A if said value is greater than its current value. It is an action. (I ended all the conditions with a colon.)
And I use a temp counter because getting the loopindex never seems to work for me. Feel free to use loopindex if it works for you.
Edit: Lol grammar check
Edited by RedEnchilada
http://www.youtube.com/watch?v=WYrSD35vHo4
woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan
|
Don Luciano Heavy combat pancake
Registered 25/10/2006
Points 380
|
31st May, 2009 at 14:47:40 -
Still doesnt really understand, but anyway i solved the problem, . A bit differently but anyway thanks.
I still dont get what do you mean with Max?
Oh, found it, maximum of two values, i didnt know that .
Edited by Don Luciano
Code me a sausage!
|
|
|