Re: problem with isTeammate()
fnl <[email protected]> Sun, 9 May 2021 06:59:29 -0700 (PDT)
| Newsgroups | gmane.comp.java.robocode |
|---|---|
| Message-ID | <[email protected]> |
OK. I will have a look into this scenario as well. søndag den 9. maj 2021 kl. 14.55.12 UTC+2 skrev [email protected]: > Hi Flemming! > > Thank you for the fast answer and the fix after some testing I can see > that it now works as long as there are multiple bots of the same type on > the battlefield but unfortunately it still seems to be a problem when only > one bot of one type is on the battlefield in a team. For example if my > leader is MyFirstLeader its name on the battlefield is MyFirstLeader, since > there are no other, but the name I get from getTeammates is MyFirstLeader > (1) which then results in isTeammate returning false. > > Thank you for all the help, > Måns > > söndag 9 maj 2021 kl. 00:29:10 UTC+2 skrev fnl: > >> I have now made a fix for it, and you can try it out here before a real >> release comes (later): >> https://robocode.sourceforge.io/files/robocode-1.9.4.1-team-fix-setup.jar >> >> Cheers, >> - Flemming >> >> fredag den 7. maj 2021 kl. 16.36.13 UTC+2 skrev [email protected]: >> >>> Hello! >>> >>> I am currently developing a team robot which main function will be to >>> protect its leader. However for this to work it has to identify which team >>> a robot belongs to as well as identify its own leader. Unfortunately >>> neither the isTeammate(e.getName()); , which I call in onScannedRobot, or >>> getTeammates() seems to work. The isTeammate() method always returns a >>> value false. When printing out the names of the retrieved bots through the >>> getTeammates function I get SittingDuck (1), SpinBot (1), SpinBot(2) etc. >>> but the bots on the battlefield might have different values in the >>> parentheses or nothing at all if it is the only bot of its kind on the >>> battlefield. Might that be the reason why isTeammate() won't work? I'm >>> currently running robocode v 1.3.9.7 >>> >> -- You received this message because you are subscribed to the Google Groups "Robocode" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/robocode/2c94025a-0fe8-464f-b857-9995538493b4n%40googlegroups.com.