The Daily Click ::. Forums ::. Klik Coding Help ::. Getting the object with the lowest/highest value
 

Post Reply  Post Oekaki 
 

Posted By Message

Odeon Marik



Registered
  05/05/2008
Points
  5
5th May, 2008 at 03:58:01 -

Hello everybody!

I got a major problem!

I got a value in my enemys, where the actual range to the player is stored.

But now i need to grap the enemy, that ist closest to the player/that has the lowest value.

The "pick one of" doesnt work in this case.

Without any extension would be nice, because i am developing in the mmf 2 demo for over an year now

Have a nice day!

 
n/a

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
5th May, 2008 at 10:27:13 -

Firstly how the hell are you developingin the demo for over a YEAR???? the demo is only a 30 day trial? I smell something dodgy.

 
n/a

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
5th May, 2008 at 12:14:41 -

Nah it sometimes lets you use it for ages, then one day without warning it will stop working.

you probably need to make sure the enemies are in a group then check each enemies alterable value individually, maybe a fastloop can help speed it up (which is not an extension in MMF2)

i'm terrible with fastloops though so someone else needs to help with an actual solution

 
.

Ricky

loves Left For Dead 2

Registered
  28/12/2006
Points
  4075

Has Donated, Thank You!Game of the Week WinnerVIP MemberWii OwnerHero of TimeGOTM Winner! - November 2009I am an April Fool
5th May, 2008 at 12:55:00 -

You could spread a value (let's name it ID), then start a fast loop the number of instances (do this in a separate event)

use two counter to externally hold information

On loop
If "ID" = Loop index
If Value you you are comparing > the value stored in counter
Then
Set one counter to that value
Set the other counter to "ID"

At the end of the loop, the object with the greatest value will have his "ID" stored in one of the counters

Now you can follow that by
If value "ID" = counter
and do whatever you want

Image Edited by the Author.

 
-

Odeon Marik



Registered
  05/05/2008
Points
  5
5th May, 2008 at 19:29:28 -

Yeah, just why did i know, that i will have to use a fastloop......... i hate them and get them only working properly after hours.

Well, you`re right, the demo only works for 30 days, but if you delete it, make a new xp client an then reinstall it, it will work for another 30 days.
Why i do this? I only got the german version of mmf2 dev, but since knp i only used english versions. So, in time i need to buy the english one.

Mayby it is useful for you:
I found another way to fix my problem.
The player shoots a detector, which passes by the enemys an gives them numbers from 1 to X. This is not very professional, i know, but my function now works as wished, so why spending hours for a fastloop........

Thx for help guys/and or girls

 
n/a
   

Post Reply



 



Advertisement

Worth A Click