Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Moving Flags

 
Post new topic   Reply to topic Printable version
 View previous topic  In there mervbot source... Post :: Post AI bot problems  View next topic  
Author Message
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Nov 03, 2003 6:07 pm    Post subject: Moving Flags Reply to topic Reply with quote

OK, I'm trying to make the bot just grab a flag and put it somewhere. I know I gotta use EVENT_GrabFlag, but what next? I was looking for a move bot event or something, but there isn't one. Can someone guide me on how to do this (or just send me the CTF source icon_wink.gif)?

I'm probably just missing something easy. icon_razz.gif
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
ExplodyThingy
Server Help Squatter


Age:38
Gender:Gender:Male
Joined: Dec 15 2002
Posts: 528
Location: Washington DC
Offline

PostPosted: Mon Nov 03, 2003 6:28 pm    Post subject: Reply to topic Reply with quote

Code: Show/Hide

bool grabbing; //in ship
int team; //specfreq

void botInfo::CheckFlags()
{
   _listnode <Flag> *parse_1 = flaglist->head;
   while (parse_1)
   {
      Flag *flag = parse_1->item;
      if (matrix.BadPlayerGrid(flag->x, flag->y))
      {
         String s;
         s += "Taking flag at ";
         s += flag->x;
         s += ", ";
         s += flag->y;
         tell(makeEcho(s));
         IllegalFlag(flag);
      }
      parse_1 = parse_1->next;
   }

   if(grabbing)
      dropFlags();
}
void botInfo::IllegalFlag(Flag *flag)
{
   if (!grabbing)
   {
      tell(makeShip(SHIP_Warbird));
      grabbing = true;

      tell(makeFollowing(false));
      tell(makeFlying(true));
      String s = "*setfreq ";
      s += team;
      sendPrivate(me, s);
   }
   tell(makeGrabFlag(flag->ident));
}
void botInfo::dropFlags()
{
   grabbing = false;
   me->move(512 * 16, 512 * 16);
   tell(makeSendPosition(true));
   tell(makeShip(SHIP_Spectator));

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


if (matrix.BadPlayerGrid(flag->x, flag->y))
is the boolean check for flag location. You can simply replace it with "if(BadFlag(parse_1->item))" and make a "bool botInfo::BadFlag(Flag *f)" function to check if "f" is in your bad region.
_________________
There are no stupid question, but there are many inquisitive idiots.
Loot

Dr Brain> I hate clean air and clean water. I'm a member of Evil Conservitive Industries
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Nov 03, 2003 6:37 pm    Post subject: Reply to topic Reply with quote

Lol, wow. All I needed was the me->move part, but that'll save me a lot of time. Thanks a lot!
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
k0zy
Server Help Squatter


Gender:Gender:Male
Joined: Jan 11 2003
Posts: 571
Location: Germany
Offline

PostPosted: Tue Nov 04, 2003 12:43 am    Post subject: Reply to topic Reply with quote

Tell me if it worked...
I tried to code such a bot once, but i couldn't get it to move more than 6 flags at a time.

Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole....
Back to top
View users profile Send private message Add User to Ignore List
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Tue Nov 04, 2003 8:16 am    Post subject: Reply to topic Reply with quote

That's catid's flagmover. It only moves one flag at a time though IIRC.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Tue Nov 04, 2003 7:42 pm    Post subject: Reply to topic Reply with quote

Actually, Bob Dole.. Bob Dole... Bob Dole...... bob dole.... bob... dole...., I only need it to move 1 flag at a time. Sorry.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Wed Nov 05, 2003 10:22 pm    Post subject: Reply to topic Reply with quote

OK, I got everything done, thanks for your help. Except, the bot doesn't spec after it moves the flag.

Code: Show/Hide
void botInfo::change_flag(int ident, int team)
{
   tell(makeShip(SHIP_Warbird));
   tell(makeTeam(team));
   tell(makeFollowing(false));
   tell(makeGrabFlag(ident));
   tell(makeFlying(true));
   me->move(setts.base_x * 16, setts.base_y[team] * 16);
   tell(makeSendPosition(true));
   tell(makeDropFlags());
   tell(makeShip(SHIP_Spectator));
   tell(makeFlying(false));
   tell(makeFollowing(true));
}

The bot will do another change_flag, so it is completing, but it just doesn't spec. I'm probably making a stupid mistake, but usually other people catch em more easily. icon_wink.gif

Thanks,
Cyan
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Dustpuppy
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 23 2003
Posts: 215
Location: England
Offline

PostPosted: Thu Nov 06, 2003 6:23 am    Post subject: Reply to topic Reply with quote

You've moved some of the tell() statements (specifically makeFlying() and makeFollowing()). Make sure they are in the same places as in the code 'splody posted.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Thu Nov 06, 2003 6:14 pm    Post subject: Reply to topic Reply with quote

Thanks, but that's not the problem. (I tried messing with the order before.) This is very odd...
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Splody
Guest


Offline

PostPosted: Fri Nov 07, 2003 7:51 am    Post subject: Reply to topic Reply with quote

Order, definately wrong.
switch makeFlying and makeGrabFlag, remove makeDropFlags
Back to top
Cyan~Fire
I'll count you!
I'll count you!


Age:37
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Fri Nov 07, 2003 4:48 pm    Post subject: Reply to topic Reply with quote

OK, yeah, I changed that, but it does the same thing.
First of all, I need DropFlags because I want the bot to drop owned flags not neuted ones.
And Second, everything is working fine except spectating. The bot drops the flags owned, in the right place, and even spectates just for like a millisecond (The Spectator sign flashes for a sec), and then goes to 512,512 and stays there.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 62 page(s) served in previous 5 minutes.

phpBB Created this page in 0.446732 seconds : 35 queries executed (92.5%): GZIP compression disabled