YesNoOk
avatar

On Helper Projectile Detection (Read 3343 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.
You can help with Ikemen GO's development by trying out the latest development build and reporting any bugs on GitHub.
My Mugen and Ikemen content can also be found here.
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