How do I find the total values of everything in one area. Let's say I have a bunch of elves, dwarves, and um... hobbits in Qualifier 1. Now if I wanted to find the total hit points of all of those creatures in Qualifer 1 (let's say for some "auto-calculate battle" feature), how do I do it?
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
I think you should have an object that overlaps all those objects once (set position to ... and such), and when an elf and the hidden object collide, the hit points of the elf is added to the Alterable value A of the hidden object.
I'm sure there's a much easier way, but I can't be bothered to look for it
i dont think that will work Xsheep. i tried something similar a while back, i wanted to get a value of how many bad guys were on screen at once using that technique and im sure it didnt work. i suppose with a bit of playing around you could fix it though
maybe if you use flags. The default for flags is off, so you could do something like this:
====================================================
Check for this:
+ Elf's flag 0 is off
+ position X is equal to or greater than 50
+ position X is equal to or lower than 325
+ position Y is equal to or greater than 65
+ position Y is equal to or lower than 430
Do this:
add Value of Elf to Total
set flag 0 to on
====================================================
I don't know if this will work. But the idea is to first see if the elf's value (or anything else) has been counted if it was inside a certain area, then set the flag on to indicate that the value has been counted....
edit: just remember there's a "check for object in zone" thing in mmf/tgf ..that should replace the XY stuff
A faster way would be to spread a value in them and fastloop them. On the loop, check if the current object is in the zone. If so, add its value to a counter or whatever.
Seems that MMF only picks the latest object created when it comes to conditions & functions. So, even if you add the Value of Elf, it'll only pick the latest Elf and add its value, leaving the other Elves with untouched flags.
I fixed it out with a good ol' KNP trick - Pick (object) at random.
But as a sign of thanks anyway, would you, EvisceratoR, mind if I put your name in the credits of my Click FAQ for this section? I've already got Tigerworks everywhere in my CFAQ...
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
MMF DOES NOT pick only the latest object in its conditions, unless you're using expressions (e.g. X Position of Object = Y( "Object" )). If you need to use expressions like that, you will have to fastloop - if not, fastlooping isn't necessary.
It doesn't? Seemed to work that way every time I try...
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.