Author |
Message |
guest Guest
Offline
|
Posted: Mon Aug 30, 2004 10:32 pm Post subject: p->flash |
 |
|
|
|
is there a simple way to have the bot react only when a player warps, and not when the player changes ships or teams or something? |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Mon Aug 30, 2004 11:36 pm Post subject: |
 |
|
|
|
lol, somebody get creative with title editing? or was it like that? _________________

Last edited by D1st0rt on Mon Aug 30, 2004 11:44 pm, edited 1 time in total |
|
Back to top |
|
 |
guest Guest
Offline
|
Posted: Mon Aug 30, 2004 11:40 pm Post subject: |
 |
|
|
|
what? |
|
Back to top |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Mon Aug 30, 2004 11:47 pm Post subject: |
 |
|
|
|
You'll need a custom plugin, I'd imagine. _________________ Performance is often the art of cheating carefully. - James Gosling |
|
Back to top |
|
 |
guest Guest
Offline
|
Posted: Tue Aug 31, 2004 12:13 am Post subject: |
 |
|
|
|
im making one, im just seeing if there's any code tricks to detect if someone flagged p->flash because they were warping, rather than freq switching or ship switching |
|
Back to top |
|
 |
D1st0rt Miss Directed Wannabe

Age:37 Gender: Joined: Aug 31 2003 Posts: 2247 Location: Blacksburg, VA Offline
|
Posted: Tue Aug 31, 2004 12:26 am Post subject: |
 |
|
|
|
Just check for p->flash whenever you get a position packet |
|
Back to top |
|
 |
Mr Ekted Movie Geek

Gender: Joined: Feb 09 2004 Posts: 1379 Offline
|
Posted: Tue Aug 31, 2004 1:31 am Post subject: |
 |
|
|
|
Save their previous ship/freq. When you get p->flash, compare old to current. If they are the same, then it's a warp. You also need to know if they died, so you can differentiate a warp from a spawn. _________________ 4,691 irradiated haggis! |
|
Back to top |
|
 |
Dr Brain Flip-flopping like a wind surfer

Age:39 Gender: Joined: Dec 01 2002 Posts: 3502 Location: Hyperspace Offline
|
Posted: Tue Aug 31, 2004 9:55 am Post subject: |
 |
|
|
|
Don't forget about cloak. _________________ Hyperspace Owner
Smong> so long as 99% deaths feel lame it will always be hyperspace to me |
|
Back to top |
|
 |
guest Guest
Offline
|
Posted: Tue Aug 31, 2004 12:05 pm Post subject: |
 |
|
|
|
do any of you know where theres a good tutorial or sample bot dll of how to set up linklists of players in the bot? i guess thats the only way to do it, even though i was trying to avoid it (im not that good at programming yet) |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Tue Aug 31, 2004 12:58 pm Post subject: |
 |
|
|
|
Most people use catid's linklist class, but creating your own linklist is the best solution and most efficient. But since you dont know how, ill explain the class.
struct Bob
{
int joe;
};
_linkedlist <Bob> BobList;
//to add a node
Bob *NewBob= new Bob;
NewBob->joe=2;
BobList.append(NewBob);
//then to cycle through the list
_listnode <Bob> *parse= BobList.head;
while(parse != NULL)
{
printf("%i\n",parse->item->joe);
parse= parse->next;
}
//to delete a node
_listnode <Bob> *parse= BobList.head;
while(parse != NULL)
{
if(parse->item->joe == 2)
{
BobList.kill(parse);
break;
}
parse= parse->next;
} |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Wed Sep 01, 2004 8:42 pm Post subject: |
 |
|
|
|
50% Packetloss wrote: | creating your own linklist is the best solution and most efficient. |
a hash table or a binary search tree is faster lookup than a linked list
an expanding array (vector) uses less space than a linked list |
|
Back to top |
|
 |
50% Packetloss Server Help Squatter

Age:40 Gender: Joined: Sep 09 2003 Posts: 561 Location: Santa Clarita, California Offline
|
Posted: Thu Sep 02, 2004 12:48 am Post subject: |
 |
|
|
|
It depends on what you are doing, if you have an unknown number of "items" that you have to keep track of, then linklist might be the best solution. Arrays are fast but not if you have to keep allocating/deallocating memory to fit everything in it. We are talking about a PC, a bot using a linklist isnt exactly going to take up cpu cycles unless you are managing a huge amount of data. Huge amounts of data should be handled efficiently by mysql or something, you cant have a lot of data taking up memory. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Thu Sep 02, 2004 6:19 am Post subject: |
 |
|
|
|
Vectors take longer appending data and linkedlists take longer accessing data. So basically, you should almost always use vectors unless you're constantly adding/deleting objects. _________________ 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 |
|
 |
CypherJF I gargle nitroglycerin

Gender: Joined: Aug 14 2003 Posts: 2582 Location: USA Offline
|
Posted: Thu Sep 02, 2004 10:06 am Post subject: |
 |
|
|
|
Shrug, for bot's, I just use w/e works... :-p |
|
Back to top |
|
 |
Bak ?ls -s 0 in

Age:26 Gender: Joined: Jun 11 2004 Posts: 1826 Location: USA Offline
|
Posted: Fri Sep 03, 2004 1:31 pm Post subject: |
 |
|
|
|
vectors shouldn't take longer appending data on average. |
|
Back to top |
|
 |
Cyan~Fire I'll count you!

Age:37 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Fri Sep 03, 2004 2:17 pm Post subject: |
 |
|
|
|
Why not? With a vector, even when you have extra allocated space, you're still going to have to reallocate and copy some later. With a linkedlist, you just keep on appending items or changing some pointers to insert. |
|
Back to top |
|
 |
|