YesNoOk
avatar

On Helper Projectile Detection (Read 2919 times)

Started by Lasombra Demon, January 22, 2022, 02:10:43 PM
Share this topic:
On Helper Projectile Detection
#1  January 22, 2022, 02:10:43 PM
  • ****
  • WIP: Tons and tons of IKEMEN stages
Hey there! I've been trying to understand Inktrebuchet's code to detect enemy helper projectiles: https://mugenguild.com/forum/topics/ai-detect-enemys-helper-projectile-system-179829.0.html

And I'm kinda lost in three portions of the code:

The first [State 33333333, 0] refers to a trigger1 = (var(0) := id). I cannot understand this one at all. Why is this done?

The second [state 33333333, 1] bloc sweeps through all the possible PlayerIDs, correct? How is this done?

The third one [state 33333333, 2] checks if the Player ID exists and then assigns it to var 3?

I could use an explanation of the logic behind these.

Thanks!
Current release: SF vs MK, fully interactive
https://www.youtube.com/watch?v=7bM9DpmVXOA
Last Edit: January 23, 2022, 04:44:23 AM by Lasombra Demon
Re: On Helper Projectile Detection
#2  January 22, 2022, 05:17:27 PM
  • ******
    • Portugal
    • network.mugenguild.com/pots/
Not familiar with the code, but I can try.

The first [State 33333333, 0] refers to a trigger1 = (var(0) := id). I cannot understand this one at all. Why is this done?
It sets the starting point from where to check the existence of other helpers. If the detection helper ID is 40, for instance, there's no point in checking ID's 0 to 39.

The second [state 33333333, 1] bloc sweeps through all the possible PlayerIDs, correct? How is this done?
It checks if there are any helpers with higher ID than the detector helper. Since you're trying to detect projectiles, only the most recent helpers matter.
Every time it finds a helper newer than ours, it adds 1 to the variable, until var(0) is higher than the "youngest" helper's ID.

The third one [state 33333333, 2] checks if the Player ID exists and then assigns it to var 3?
Now that you know which are the youngest helpers in the screen, you start to check if any of them are projectiles. If one of them is, it stores their ID in the variable so you can then do whatever you set out to do with the code.
Re: On Helper Projectile Detection
#3  January 23, 2022, 04:43:58 AM
  • ****
  • WIP: Tons and tons of IKEMEN stages
Whoa, a reply by the returning legend himself. I think I got it! Thanks! :)
Current release: SF vs MK, fully interactive
https://www.youtube.com/watch?v=7bM9DpmVXOA