goku1993 Posted June 1, 2011 Author Share Posted June 1, 2011 Hey everyone, i was just looking for advice wondering how i could create my guild system.Had one that didn't really work well based on the party system but i decided to find a more efficient way to create it.I don't really need any source code and all i just need some ideas on proficient ways to store the guild data, for example storing the guild name in the player's files then creating another file for the guild's data or?…Help would be appreciated, Thank you. Link to comment Share on other sites More sharing options...
Yxxe Posted June 2, 2011 Share Posted June 2, 2011 In my guild system, I store the following in a seperate guild file (one for each guild):Guild NameArray Of Guild Player NamesArray Of Player Levels in the GuildArray Of Player Ranks (e.g. Leader, Co-leader)Amount of Players in the guild _Then in the player file, I stored this:Guild Index (reffering to the index of the guild file server side)Guild Name (for displaying the guild name above their heads)[Guild Emblem on applicable if you want one]Personal Player RankIf you need any other pointers I will be glad to help you out._ Link to comment Share on other sites More sharing options...
damian666 Posted June 2, 2011 Share Posted June 2, 2011 hmm, i do it differently, only slight though :Pi load guilds same way as items etc, i just check guildindex by comparing guildname.so i only store name and rank in playerfile, everything else is in guildfile.Dami Link to comment Share on other sites More sharing options...
goku1993 Posted June 2, 2011 Author Share Posted June 2, 2011 Thank you for your help, both of you.I'll start working on the guild system now and if i run into any deep problems i can't find a solution after a while I will probably look for some help on here.Thanks again. Link to comment Share on other sites More sharing options...
Yxxe Posted June 2, 2011 Share Posted June 2, 2011 @Musbah:> Thank you for your help, both of you.I'll start working on the guild system now and if i run into any deep problems i can't find a solution after a while I will probably look for some help on here.> > Thanks again.No problem, best of luck with it! Link to comment Share on other sites More sharing options...
Helladen Posted June 2, 2011 Share Posted June 2, 2011 Also you should store MemberCount (byte, integer or long) and Member() which is a string. Member holds the name so you can send all the guild members even when their offline and MemberCount the amount of members in the guild. Just add one to it when someone joins and subtract one when they leave. (For the guild list).By adding this your also going to have to make a function to find the slot the guild member is on when they leave. Just scan through the constant for the max amount of guild members until it finds the name then set that as it and erase the Member() from the file. Link to comment Share on other sites More sharing options...
goku1993 Posted June 3, 2011 Author Share Posted June 3, 2011 Thanks, that's what i did, everything has been going well untill just now.Everything was working well when i realized that when i invited a player to the guild his name will take the caption of himself and all the players that are in the guild. For example imagine a person called john is in the guild if i invite someone called killer, a new caption is used for killed but he also takes john's caption and adds killer in it…i think this is dumb but i really can't find anything wrong with```For i = 1 To MAX_GUILD_MEMBERS Guild.Member(i) = Buffer.ReadLong Guild.Level(i) = Buffer.ReadLong If Guild.Member(i) > 0 Then frmMain.lblGuildMember(i).Caption = Trim$(GetPlayerName(Guild.Member(i))) Else frmMain.lblGuildMember(i).Caption = vbNullString End If```edit: I'm thinking there is some setting in the captions i have to change, going to check now… Link to comment Share on other sites More sharing options...
Yxxe Posted June 3, 2011 Share Posted June 3, 2011 @Musbah:> ```> If Guild.Member(i) > 0 Then> > ```Should be?``` If Guild.Level(i) > 0 Then``` Link to comment Share on other sites More sharing options...
goku1993 Posted June 3, 2011 Author Share Posted June 3, 2011 both would pretty much do the same thing really…just added level because I'm going to add a level caption later Link to comment Share on other sites More sharing options...
Joyce Posted June 3, 2011 Share Posted June 3, 2011 Your system works from Indexes, which aren't a stable source.. That's not good. :) Indexes change every time someone logs off/in, so please store player NAMES, not their INDEXES when keeping member data in your UDT. :) Link to comment Share on other sites More sharing options...
goku1993 Posted June 3, 2011 Author Share Posted June 3, 2011 Oh ok thank you, i was storing player names at first just ran into some problems guess i'll have to try and fix them. Link to comment Share on other sites More sharing options...
Joyce Posted June 3, 2011 Share Posted June 3, 2011 OR !!! You could modify the login/registration system to give every player their unique ID in a Dynamic UDT which holds the player name in it under a number.. But that'd probably be more work then to simply use names.And what sort of issues? Link to comment Share on other sites More sharing options...
Yxxe Posted June 3, 2011 Share Posted June 3, 2011 @Musbah:> Oh ok thank you, i was storing player names at first just ran into some problems guess i'll have to try and fix them.Use "Function FindPlayer(ByVal Name As String)" to find a players' index depending on name, if you are using that to tell whether they are online or not. Otherwise, just use "IsConnected(Index)" or "IsPlaying(Index)", replacing "Index" with a "FindPlayer" call. Link to comment Share on other sites More sharing options...
goku1993 Posted June 3, 2011 Author Share Posted June 3, 2011 Thanks both of you for your help, was able to fix the problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now