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
In there mervbot source...

 
Post new topic   Reply to topic Printable version
 View previous topic  Need Someone To Make Me A Plugin Post :: Post Moving Flags  View next topic  
Author Message
Geg
Guest


Offline

PostPosted: Wed Nov 05, 2003 4:12 pm    Post subject: In there mervbot source... Reply to topic Reply with quote

Where is _listnode defined? Or is it something out of the project?
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: Wed Nov 05, 2003 6:26 pm    Post subject: Reply to topic Reply with quote

It's not in the DLL project, but is linked to when you try to compile. It's in datatypes.h (and cpp).
It's rather complicated if you don't have much experience with C++ so I'll try to explain here.

_listnode is a portion of a _linkedlist, which is basically like an array that can contain multiple datatypes. _linkedlists are used for the game flaglist, playerlist, and other struct lists. If you want to use one of these lists, use this:

Code: Show/Hide
_listnode <Datatype> *parse = list.head
while (parse)
{
  Datatype *object = parse->item
  //Perform functions on object
  parse = parse->next
}

Replace 'Datatype' with your desired object type (Flag, Player, Brick) and replace 'list' with your desired bot list of the data (flaglist, playerlist, bricklist).

Example on using a playerlist from Catid's rank plugin:
Code: Show/Hide
listnode <Player> *parse = playerlist->head;
while (parse)
{
   Player *p = parse->item;
   init_rank(p);
   parse = parse->next;
}


Hope this helps,
Cyan~Fire
_________________
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
Geg
Guest


Offline

PostPosted: Wed Nov 05, 2003 6:32 pm    Post subject: Reply to topic Reply with quote

I know what linked lists are and how to use them, just wondering about this one icon_smile.gif.
Back to top
Geg
Guest


Offline

PostPosted: Wed Nov 05, 2003 6:35 pm    Post subject: Reply to topic Reply with quote

Also wanted to know where to find them, and thanks. I thought I looked in there for them (seemed the most logical place, checked there first)... I seem to only be able to find the definitions in the .h file, where is the code for it at?
Back to top
Geg
Guest


Offline

PostPosted: Wed Nov 05, 2003 6:37 pm    Post subject: Reply to topic Reply with quote

Arg, I found them. icon_smile.gif
Back to top
Geg
Guest


Offline

PostPosted: Wed Nov 05, 2003 6:42 pm    Post subject: Reply to topic Reply with quote

One more question, sorry. Where does AnonymousStruct come from?
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: Wed Nov 05, 2003 9:53 pm    Post subject: Reply to topic Reply with quote

AnynymousStruct is just Catid's way of saying you can put any struct in there.
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:25 am    Post subject: Reply to topic Reply with quote

For some reason (not quite sure why, something to do with the templating I believe) the function bodies have to be in the header.
And yes, you can replace AnonymousStruct with whatever type you want to make a list/node of. Look up templates in the MSDN if you need more info (and have it icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List Send email 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: 104 page(s) served in previous 5 minutes.

phpBB Created this page in 0.509482 seconds : 32 queries executed (81.9%): GZIP compression disabled