Server Help

Bot Questions - Moving flags in Mervbot?

CommieCausey - Sat Jan 13, 2007 3:46 pm
Post subject: Moving flags in Mervbot?
What is a proper way to move flags in mervbot? When I move flags they don't reappear for a long time.

Here is the code of my function that moves flags:

Code: Show/Hide

void botInfo::moveFlag(Flag *f, int destx, int desty)
{

tell(makeFollowing(false));
tell(makeFlying(true));

tell(makeShip(SHIP_Warbird));

me->move(f->x, f->y);
tell(makeSendPosition(true));
tell(makeGrabFlag(f->ident));

me->move(destx*16, desty*16);
tell(makeSendPosition(true));
tell(makeDropFlags());

tell(makeShip(SHIP_Spectator));

tell(makeFollowing(true));
tell(makeFlying(false));

}


I have tried messing with following and flying and other things. I didn't find any mervbot code for moving flags. I think I mostly copied the ballmover plugin. I wish the CTF plugin had source code included.

I am a newbie with server settings so maybe that is the problem? I have tinkered with them to get the flag to not reset on drop, and be unowned when dropped but I can't get them to reappear faster.

CC
Cyan~Fire - Sat Jan 13, 2007 6:29 pm
Post subject:
I think your problem is probably that you're changing ships as you drop the flag. Try dropping the flags then changing back to spec 1 tick later or something.

(PS: Use ASSS.)
CommieCausey - Sun Jan 14, 2007 11:59 am
Post subject:
Hrm I tried it but it didn't work any better. I had the flag move step by step by responding to the FlagGrab event by moving to the upper-left corner and dropping the flag. The flagdrop event then finishes the whole process. I still get the same results. I have also tried not spectating at all but the flag still takes a little while to reappear. Thanks for the help though! I will keep messing with it...

(yeah I wish I could use ASSS!!)

CC
Cyan~Fire - Sun Jan 14, 2007 1:11 pm
Post subject:
Do you have all the proper CTF settings set?
Quote:
; Required settings:
; [Flag]FlagDropDelay=? <- Set really high
; [Flag]CarryFlags=2 <- Only carry one flag at a time, important if one flagger kills another flagger
; [Flag]FlagMode=1 <- Warzone style
; [Flag]FlagReward=0 <- Never win jackpot
; [Flag]FlagTerritoryRadius=0 <- The bot needs to drop flags with precision
; [Flag]FlagTerritoryRadiusCentroid=0 <- ditto

; Recommended settings:
; [Flag]FlaggerOnRadar=1 <- So people can compete
; [Flag]NoDataFlagDropDelay=32767 <- Bot may have trouble with this
; [Flag]FlagBlankDelay=32767 <- Bot may have trouble with this
; [Team]MaxPerTeam=255
; [Team]MaxFrequency=2 <- Bot may have trouble with this
; [Flag]MaxFlags=2 <- Bot may have trouble with this
; [Team]DesiredTeams=2


And why can't you use ASSS?
Smong - Mon Jan 15, 2007 5:03 am
Post subject:
Here's some code I found: (I didn't write it)
Code: Show/Hide
   case EVENT_Tick:
      {
         for (int i = 0; i < 5; ++i)
            --countdown[i];

         // resume spectating
         if (!countdown[0])
         {
            tell(makeFollowing(true));
            tell(makeFlying(false));
            tell(makeShip(SHIP_Spectator));
         }
...
   case EVENT_FlagMove:
...
                     if (countdown[0] <= 0)
                     {
                        tell(makeFollowing(false));
                        tell(makeFlying(true));
                        tell(makeShip(SHIP_Warbird));
                        countdown[0] = 1;
                     }

                     tell(makeTeam(fident));
                     tell(makeGrabFlag(fident));
                     me->move(info->xAtRest * 16, info->yAtRest * 16);
                     tell(makeSendPosition(true));
                     tell(makeDropFlags());

Note this bot is for CTF, so you can get away with tell(makeTeam(fident)) (using flag ID as freq number).
CommieCausey - Tue Jan 16, 2007 1:25 pm
Post subject:
Okay I got it fixed. It was server settings after all. I had FlagMode set to 0 and it would take a little while for the flags to drop. I then set FlagMode to 1 and flags would reset to the middle of the map with their team changed. I even modified the settings like you suggested but it was still messed up.

I started over with a new server package and it works fine now. I compared the .cfg's but I don't know what was wrong... Owell! I screwed them up somehow.

Thanks for the help. Sorry to be a pest.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group