The Daily Click ::. Forums ::. Klik Coding Help ::. Finding total values
 

Post Reply  Post Oekaki 
 

Posted By Message

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
30th August, 2004 at 02:23:22 -

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.

Image

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
30th August, 2004 at 02:26:25 -

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

 
a/n

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
30th August, 2004 at 07:01:27 -

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

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
30th August, 2004 at 08:03:17 -

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

Image Edited by the Author.

 
n/a

Tigerworks

Klik Legend

Registered
  15/01/2002
Points
  3882
30th August, 2004 at 08:51:22 -

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.

 
- Tigerworks

Lazernaut



Registered
  08/09/2002
Points
  1103

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
30th August, 2004 at 08:54:45 -

i got that idea afterwards as well, but i felt lazy and didn't wanna post it figuring someone else would

 
n/a

醤油の兵士

Almost Human

Registered
  12/06/2002
Points
  173

VIP Member
30th August, 2004 at 19:22:20 -

I thought spreading a value in a group was buggy...

I'd fastloop and pick object based on flag 0 is off then add there hit points and turn on flag 0 if that made any sense

 
As a boy, I wanted to be a train. I didn’t realize this was unusual—that other kids played with trains, not as them.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
8th September, 2004 at 09:17:06 -

LOL. None of your ideas work...

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.

Image

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
8th September, 2004 at 11:52:28 -

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.

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
11th September, 2004 at 00:01:02 -

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.

Image
   

Post Reply



 



Advertisement

Worth A Click