Author |
Message |
Freakman Bob Guest
Offline
|
Posted: Wed Feb 02, 2005 3:52 pm Post subject: How would I do this?... |
 |
|
|
|
I want to make a Golf bot that would spawn powerballs at certain places, and that could also be told to warp people with simple commands like :GolfBot:!1hole Freakman Bob.
I'm sure this is considered simple, but I'm the sort of person who figures stuff out, doesn't just go with MERV or something....
Therefore, any suggestions / code? |
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Wed Feb 02, 2005 4:21 pm Post subject: |
 |
|
|
|
You wrote: | I'm sure this is considered simple, but I'm the sort of person who figures stuff out, doesn't just go with MERV or something.... |
I'm not sure if I understand what you said there, but whatever, I suggest you learn about C++ and MERV (if you don't know about them already, as I said I can't really find out by reading what you said); Some of us would be glad to help.
No idea how to do the ball spawning, I guess it is possible by letting the bot picking up the balls and releasing it somewhere else.
Something to get you started with the warp command (not sure if your idea really is convenient, but whatever, you asked for it).
void botInfo::gotCommand(Player *p, Command *c)
{
// Skipping code to improve readability.
switch (p->access)
{
// ...
case OP_Moderator:
{
// Is the used command "[!|.|@]1hole"?
if (c->check("1hole"))
{
// Did the operator use any parameters?
if (*c->final)
{
// Iterate through the playerlist while comparing c->final (which contains the name of the player who needs to be warped)
// If it's found, send the *warpto (and maybe another message like "Warp'd!") to the player.
// Otherwise if the player wasn't found, you could send an error message if you want.
}
// Error message?
}
}
// ...
}
} |
|
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
 |
Solo Ace Yeah, I'm in touch with reality...we correspond from time to time.

Age:37 Gender: Joined: Feb 06 2004 Posts: 2583 Location: The Netherlands Offline
|
Posted: Wed Feb 02, 2005 6:23 pm Post subject: |
 |
|
|
|
No you don't have the Player *, he doesn't want the player (or operator) who used the command to be warped, he wants a certain player in the arena to be warped.
He wrote: | that could also be told to warp people with simple commands like :GolfBot:!1hole Freakman Bob. |
But, I may be wrong.  |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Wed Feb 02, 2005 11:29 pm Post subject: |
 |
|
|
|
Or you could just set up a TM Baw (?) with warp points set up like in Assault: Overlord from UT GOTY _________________
 |
|
Back to top |
|
 |
|