Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Guild


goku1993
 Share

Recommended Posts

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

In my guild system, I store the following in a seperate guild file (one for each guild):

Guild Name
Array Of Guild Player Names
Array Of Player Levels in the Guild
Array 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 Rank

If you need any other pointers I will be glad to help you out._
Link to comment
Share on other sites

@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

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

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

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

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

@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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...