YesNoOk
avatar

Detecting distance from helpers causes debug flood (Read 265 times)

Started by Veanko, July 09, 2012, 06:53:14 pm
Share this topic:
Detecting distance from helpers causes debug flood
#1  July 09, 2012, 06:53:14 pm
  • ***
  • i am loyal to you unless you disagree with me
    • UK
Hey.

im trying to code my characters AI so it can detect its nearest helper. so it doesn't spawn another one to close to it. however. the code for this causes debug flood saying "WARNING: PLAYER (57) IN STATE 0: HAS NO HELPER 1051" whenever the AI is in control.

i have read the docs. though that didn't really help me for some reason. so thats why im coming here.

here is the code im useing:
Spoiler, click to toggle visibilty

is there something im doing wrong?
something looks a little off...

Download my characters here: https://www.mediafire.com/folder/3u2w1pme88w8d/Mugen

My youtube channel: http://www.youtube.com/user/TVeanko
Re: Detecting distance from helpers causes debug flood
#2  July 09, 2012, 07:41:31 pm
  • ****
    • Hungary
    • seravy.x10.mx/Wordpress
You need to force Mugen to skip evaluating the part of expression with the helper redirection to avoid the debug spam.
There are 2 ways to do that.
1. Adding the Numhelper to a trigger above, will make the remaining trigger lines get skipped, but for this you will need to separate the triggers. This generally works if there are no other lines with the same trigger number.
2. Using the Cond trigger can make the evaluation not happen, too. This works better if there are multiple lines with the same trigger number and more than one contains helper reference(s). This actually was what made Elecbyte add the Cond trigger into the engine.

Code: (mugen)
trigger2 = numhelper(1051) || numhelper(1054) || numhelper(1058) || numhelper(1071)
trigger2=abs(Rootdist X-Helper(1051),Rootdist X)>40 && numhelper(1051) || abs(Rootdist X-Helper(1054),Rootdist X)>40 && numhelper(1054) || abs(Rootdist X-Helper(1058),Rootdist X)>40 && numhelper(1058) || abs(Rootdist X-Helper(1071),Rootdist X)>40 && numhelper(1071)
1st method would result in this :
Code: (mugen)
trigger2=numhelper(1051)
trigger2=abs(Rootdist X-Helper(1051),Rootdist X)>40
trigger3=numhelper(1054)
trigger3 = abs(Rootdist X-Helper(1054),Rootdist X)>40
trigger4=numhelper(1058)
trigger4 = abs(Rootdist X-Helper(1058),Rootdist X)>40
trigger5= numhelper(1071)
trigger5 = abs(Rootdist X-Helper(1071),Rootdist X)>40
2nd would be this :
Code: (mugen)
trigger2=Cond(Numhelper(1051),abs(Rootdist X-Helper(1051),Rootdist X)>40,0) || Cond(Numhelper(1054),abs(Rootdist X-Helper(1054),Rootdist X)>40,0) || Cond(Numhelper(1058),abs(Rootdist X-Helper(1058),Rootdist X)>40,0) || Cond(Numhelper(1071),abs(Rootdist X-Helper(1071),Rootdist X)>40,0)
Re: Detecting distance from helpers causes debug flood
#3  July 09, 2012, 08:04:39 pm
  • ***
  • i am loyal to you unless you disagree with me
    • UK
ah ok. its fixed now. thanks seravy!
something looks a little off...

Download my characters here: https://www.mediafire.com/folder/3u2w1pme88w8d/Mugen

My youtube channel: http://www.youtube.com/user/TVeanko