Number of Tagerts Problem
Hello there!
I am still working on my top-down shoter and i have a little but very important issue.
I have enemies on batlefield and turets. Each one turret has "detector"(solid circle active object)that allows them(turrets)detect enemies. More than that i would like every detector to "calcualte" how many tagerts are detected by it.
I tried do that using flags but it does not works.
Help me please!
Re: Number of Tagerts Problem
Always
-->Set TargetCount of TurretArea to 0
Always
-->Spread value 0 in ID of Target
Always
-->Start fastloop "targets" NObjects("Target") times
On loop "targets"
+ID of Target = loopindex("targets")
+TurretArea is overlapping Target
-->Add 1 to TargetCount of TurretArea
Does that make sense? Let me know if you still need help.
Re: Number of Tagerts Problem
Ok! But why it is neccessary to use fast-loop?! And why the
following code does not work(using your value names to be clear):
Always
-->Set TargetCount of TurretArea to 0
Target is overlapping TurretArea
-->Add 1 to TargetCount of TurretArea
?
Re: Number of Tagerts Problem
Quote:
Originally Posted by RealGameMaker
Ok! But why it is neccessary to use fast-loop?! And why the
following code does not work(using your value names to be clear):
Always
-->Set TargetCount of TurretArea to 0
Target is overlapping TurretArea
-->Add 1 to TargetCount of TurretArea
?
That event makes perfect sense to a human being... but when you code events, you basically need to put them in a form that Multimedia Fusion can understand.
In an MMF program cycle, each event will execute only once (excluding fastloops). So, when the program hits your event, it'll see if any target is overlapping a TurretArea, and if it is, it'll add 1 to TargetCount of TurretArea... once. (regardless of how many targets are actually overlapping).
The point of the fastloop is to add 1 to TargetCount for every target that is overlapping the TurretArea... does that make sense?
Re: Number of Tagerts Problem
Yes! Thanks!
But where can i find description of MMF2 code logics?(books, articles...)
Re: Number of Tagerts Problem
MMF2 Runtime Engine
http://www.clickteam.com/website/usa/tutorials
Marv