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

[EO 2.0/3.0] Guilds


Scott
 Share

Recommended Posts

Link to EO2.0 [Here](http://www.eclipseorigins.com/community/index.php?/topic/104386-eclipse-origins-v2-beta/).

**Bugs**
**[1.Important Bug Fix (Link)](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__60#entry809002)**
1*

1- This bug fix is now included in the tutorial, it is still here for those who may not have seen this bug fix and still is using the affected version.

If your using Eclipse Origins 3.0 make sure you skip the 3 steps(They are Marked) that are now found
[HERE](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804)

**Additions**

1.Special thanks to **[Deathbeam](http://www.touchofdeathforums.com/community/index.php?/user/54531-deathbeam/)** for **visual menu addition**! [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/126795-eo-guild-menu-update/)

2\. Special thanks to **[Sherwin](http://www.touchofdeathforums.com/community/index.php?/user/75020-sherwin/)** for **Level Required on guild creation**! [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/129257-all-version-level-required-on-creating-guild/)

3\. **Cost for guild creation**. [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__60#entry808765)

4\. Special thanks to **[GoldSide](http://www.touchofdeathforums.com/community/index.php?/user/65994-goldside/)** for **Random Guild Logos**! [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/131561-eo-30random-logo-guild-systemv02/#entry876954)

5\. Special thanks to **[ranslsad](http://www.touchofdeathforums.com/community/index.php?/user/59762-ranslsad/)** for **[EA] Guild Invitation Dialog** [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/132753-ea-guild-invitation-dialog/)

6.  **Duplicate Guild Name Check**(Because I forgot it in the release) [Thread Link](http://www.eclipseorigins.com/community/index.php?/topic/124848-eo-2030-guilds/?p=904482)

After seeing many requests for a stable guild system I decided to take it on as my first feature for eclipse.

You can try out a pre-compiled version here:[attachment=69:GuildCompiled.zip]

Some highlight features:
_Invites_- When a player sends an invite to another player, they will have 2 minutes to accept/decline or it will auto decline players can only have 1 invite at a time.

_Founder_- There can only be 1 founder at a time in a guild they can't be kicked and can't have restricted privileges(Can do anything period). You may transfer the founder status to another player with the /founder (name) command.

_Guild Ranks_- Each guild can have its own guild ranks(custom names), each guild also has its own set of guild permission(see below).

_Guild Permission_- Guild leaders can set what each rank can do, these include: Open Admin Panel, Edit Options/Ranks/Users, Recruit Users, Kick Users.

_Guild name over head_

**Guild Commands:**
_Make Guild: /guild make

To transfer founder status use /guild founder (name)

Invite to Guild: /guild invite (name)

Leave Guild: /guild leave

Open Guild Admin: /guild admin

Guild kick: /guild kick (name)

Guild disband: /guild disband yes

View Guild: /guild view (online/all/offline)

^Default is online, example: /guild view would display all online users.

You can talk in guild chat with: ;Message_

Please keep all help/bug reports to this topic, I will look into every single post and do my best to help you. Post in this topic before you PM me, if you don't get a responce within a few days than feel free to PM me.

**Download GuildFiles.zip, and follow these steps if your are installing this!**

[attachment=16:GuildFiles.zip]

Server

1.Place modGuild.bas from the server_files directory into server/src

2.Inside VB6 right click where it displays all the files -> Add -> Module

3.Inside the popup click the existing tab -> Select the src folder -> Select modGuild.bas

Client

1.Place modGuild.bas from the client_files directory into client/src

2.Place the 2 frmGuildAdmin files from the client_files directory into client/src

3.Inside VB6 right click where it displays all the files -> Add -> Module

4.Inside the popup click the existing tab -> Select the src folder -> Select modGuild.bas

5.Inside VB6 right click where it displays all the files -> Add -> Form

6.Inside the popup click the existing tab -> Select the src folder -> Select frmGuildAdmin.frm

**If a step lists a specific location, this means that it might be confusing to try searching for them.**

**!STOP!- Make a backup before you start!**

******************************************************************************

**SERVER**

FIND:

```
Call SetStatus("Clearing animations...")
Call ClearAnimations
```
UNDER ADD:

```
Call SetStatus("Clearing guilds...")
Call ClearGuilds
```
–------------------------------------------------------------

FIND:

```
ChkDir App.Path & "\Data\", "spells"

```
UNDER ADD:

```
ChkDir App.Path & "\Data\", "guilds"

```
–------------------------------------------------------------

FIND:

```
HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)
```
UNDER ADD:

```
HandleDataSub(CSayGuild) = GetAddress(AddressOf HandleGuildMsg)
HandleDataSub(CGuildCommand) = GetAddress(AddressOf HandleGuildCommands)
HandleDataSub(CSaveGuild) = GetAddress(AddressOf HandleGuildSave)
```
–------------------------------------------------------------

FIND(Find in Function PlayerData):

```
Buffer.WriteLong GetPlayerX(index)
Buffer.WriteLong GetPlayerY(index)
Buffer.WriteLong GetPlayerDir(index)
Buffer.WriteLong GetPlayerAccess(index)
Buffer.WriteLong GetPlayerPK(index)

For i = 1 To Stats.Stat_Count - 1
Buffer.WriteLong GetPlayerStat(index, i)
Next
```
UNDER ADD:

```
If Player(index).GuildFileId > 0 Then
If TempPlayer(index).tmpGuildSlot > 0 Then
Buffer.WriteByte 1
Buffer.WriteString GuildData(TempPlayer(index).tmpGuildSlot).Guild_Name
End If
Else
Buffer.WriteByte 0
End If
```
–------------------------------------------------------------

FIND:

```
' General
Name As String * ACCOUNT_LENGTH
poontang As Byte
Class As Long
Sprite As Long
Level As Byte
exp As Long
Access As Byte
PK As Byte
```
UNDER ADD:

```
GuildFileId As Long
GuildMemberId As Long
```
–-----------------------------------------------------------

FIND:

```
Public Type TempPlayerRec
```
UNDER ADD:

```
tmpGuildSlot As Long
tmpGuildInviteSlot As Long
tmpGuildInviteTimer As Long
tmpGuildInviteId As Long
```
–------------------------------------------------------------

FIND:

```
' Checks to save players every 5 minutes - Can be tweaked
If Tick > LastUpdateSavePlayers Then
UpdateSavePlayers
LastUpdateSavePlayers = GetTickCount + 300000
End If
```
UNDER ADD:

```
'Handles Guild Invites
For i = 1 To Player_HighIndex
If IsPlaying(i) Then
If TempPlayer(i).tmpGuildInviteSlot > 0 Then
If Tick > TempPlayer(i).tmpGuildInviteTimer Then
If GuildData(TempPlayer(i).tmpGuildInviteSlot).In_Use = True Then
PlayerMsg i, "Time ran out to join " & GuildData(TempPlayer(i).tmpGuildInviteSlot).Guild_Name & ".", BrightRed
TempPlayer(i).tmpGuildInviteSlot = 0
TempPlayer(i).tmpGuildInviteTimer = 0
Else
'Just remove this guild has been unloaded
TempPlayer(i).tmpGuildInviteSlot = 0
TempPlayer(i).tmpGuildInviteTimer = 0
End If
End If
End If
End If
Next i
```
–------------------------------------------------------------

FIND(Find in modEnumerations):

```
SPartyInvite
SPartyUpdate
SPartyVitals
```
UNDER ADD:

```
SSendGuild
SAdminGuild
SGuildAdminSwitchTab
```
–------------------------------------------------------------

FIND(Find in modEnumerations):

```
CDeclineParty
CPartyLeave
```
UNDER ADD:

```
CGuildCommand
CSayGuild
CSaveGuild
CRequestGuildAdminTabSwitch
```
–------------------------------------------------------------

FIND:

```
' Send welcome messages
Call SendWelcome(index)
```
UNDER ADD:

```
'Do all the guild start up checks
Call GuildLoginCheck(index)
```
–------------------------------------------------------------

FIND(Find in sub LeftGame):

```
' leave party.
Party_PlayerLeave index
```
UNDER ADD:

```
If Player(index).GuildFileId > 0 Then
'Set player online flag off
GuildData(TempPlayer(index).tmpGuildSlot).Guild_Members(Player(index).GuildMemberId).Online = False
Call CheckUnloadGuild(TempPlayer(index).tmpGuildSlot)
End If
```
–------------------------------------------------------------

FIND:

```
' Check if the master charlist file exists for checking duplicate names, and if it doesnt make it
If Not FileExist("data\accounts\charlist.txt") Then
F = FreeFile
Open App.Path & "\data\accounts\charlist.txt" For Output As #F
Close #F
End If
```
UNDER ADD:

```
Call Set_Default_Guild_Ranks
```
–-------------------------------------------------------------

FIND:

```
ChkDir App.Path & "\Data\", "spells"
```
UNDER Add:

```
ChkDir App.Path & "\Data\", "guilds"
```
**CLIENT**

FIND:

```
Public Sub DrawPlayerName(ByVal Index As Long)
Dim TextX As Long
Dim TextY As Long
Dim color As Long
Dim Name As String
```
UNDER ADD:

```
Dim Text2X As Long
Dim Text2Y As Long
Dim GuildString As String
```
–------------------------------------------------------------

(Using EO 3.0?
[Click Here](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) and skip these steps
)

(This step works for eo2.0/2.3
)

FIND:

```
Name = Trim$(Player(Index).Name)
' calc pos
TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name)))
```
UNDER ADD:

```
GuildString = Player(Index).GuildName
Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GuildString)))
```
–------------------------------------------------------------

(Using EO 3.0?
[Click Here](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) and skip these steps
)

(This step works for eo2.0/2.3
)

FIND:

```
If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
Else
' Determine location for text
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
End If
```
**REPLACE WITH:**

```
If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16
Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset
Else
' Determine location for text
TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16
Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4
End If
```
–------------------------------------------------------------

(Using EO 3.0?
[Click Here](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) and skip these steps
)

(This step works for eo2.0/2.3
)

FIND:

```
' Draw name
Call DrawText(TexthDC, TextX, TextY, Name, color)
```
UNDER ADD:

```
If Not Player(Index).GuildName = vbNullString Then
Call DrawText(TexthDC, Text2X, Text2Y, GuildString, color)
End If
```
–------------------------------------------------------------

FIND:

```
' Vitals
Vital(1 To Vitals.Vital_Count - 1) As Long
MaxVital(1 To Vitals.Vital_Count - 1) As Long
' Stats
Stat(1 To Stats.Stat_Count - 1) As Byte
POINTS As Long
' Worn equipment
Equipment(1 To Equipment.Equipment_Count - 1) As Long
' Position
Map As Long
x As Byte
y As Byte
Dir As Byte
' Client use only
XOffset As Integer
YOffset As Integer
Moving As Byte
Attacking As Byte
AttackTimer As Long
MapGetTimer As Long
Step As Byte
```
UNDER ADD:

```
GuildName As String
```
–------------------------------------------------------------

FIND(Find in modEnumerations):

```
STradeRequest
SPartyInvite
SPartyUpdate
SPartyVitals
```
UNDER ADD:

```
SSendGuild
SAdminGuild
SGuildAdminSwitchTab
```
–------------------------------------------------------------

FIND(Find in modEnumerations):

```
CPartyRequest
CAcceptParty
CDeclineParty
CPartyLeave
```
UNDER ADD:

```
CGuildCommand
CSayGuild
CSaveGuild
CRequestGuildAdminTabSwitch
```
–------------------------------------------------------------

FIND:

```
HandleDataSub(SPartyUpdate) = GetAddress(AddressOf HandlePartyUpdate)
HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)
```
UNDER ADD:

```
HandleDataSub(SSendGuild) = GetAddress(AddressOf HandleSendGuild)
HandleDataSub(SAdminGuild) = GetAddress(AddressOf HandleAdminGuild)
```
–------------------------------------------------------------

FIND:

```
Call SetPlayerDir(i, Buffer.ReadLong)
Call SetPlayerAccess(i, Buffer.ReadLong)
Call SetPlayerPK(i, Buffer.ReadLong)

For x = 1 To Stats.Stat_Count - 1
SetPlayerStat i, x, Buffer.ReadLong
Next
```
UNDER ADD:

```
If Buffer.ReadByte = 1 Then
Player(i).GuildName = Buffer.ReadString
Else
Player(i).GuildName = vbNullString
End If
```
–------------------------------------------------------------

FIND:

```
If LenB(ChatText) = 0 Then Exit Sub
MyText = LCase$(ChatText)

' Handle when the player presses the return key
If KeyAscii = vbKeyReturn Then
```
UNDER ADD:

```
'Guild Message
If Left$(ChatText, 1) = ";" Then
ChatText = Mid$(ChatText, 2, Len(ChatText) - 1)

If Len(ChatText) > 0 Then
Call GuildMsg(ChatText)
End If

MyText = vbNullString
frmMain.txtMyChat.text = vbNullString
Exit Sub
End If
```
–------------------------------------------------------------

FNID:

```
Case "/help"
Call AddText("Social Commands:", HelpColor)
Call AddText("'msghere = Broadcast Message", HelpColor)
Call AddText("-msghere = Emote Message", HelpColor)
Call AddText("!namehere msghere = Player Message", HelpColor)
Call AddText("Available Commands: /info, /who, /fps, /fpslock", HelpColor)
```
UNDER ADD:

```
Case "/guild"
If UBound(Command) < 1 Then
Call AddText("Guild Commands:", HelpColor)
Call AddText("Make Guild: /guild make (GuildName)", HelpColor)
Call AddText("To transfer founder status use /guild founder (name)", HelpColor)
Call AddText("Invite to Guild: /guild invite (name)", HelpColor)
Call AddText("Leave Guild: /guild leave", HelpColor)
Call AddText("Open Guild Admin: /guild admin", HelpColor)
Call AddText("Guild kick: /guild kick (name)", HelpColor)
Call AddText("Guild disband: /guild disband yes", HelpColor)
Call AddText("View Guild: /guild view (online/all/offline)", HelpColor)
Call AddText("^Default is online, example: /guild view would display all online users.", HelpColor)
Call AddText("You can talk in guild chat with: ;Message ", HelpColor)
GoTo Continue
End If

Select Case Command(1)
Case "make"
If UBound(Command) = 2 Then
Call GuildCommand(1, Command(2))
Else
Call AddText("Must have a name, use format /guild make (name)", BrightRed)
End If

Case "invite"
If UBound(Command) = 2 Then
Call GuildCommand(2, Command(2))
Else
Call AddText("Must select user, use format /guild invite (name)", BrightRed)
End If

Case "leave"
Call GuildCommand(3, "")

Case "admin"
Call GuildCommand(4, "")

Case "view"
If UBound(Command) = 2 Then
Call GuildCommand(5, Command(2))
Else
Call GuildCommand(5, "")
End If

Case "accept"
Call GuildCommand(6, "")

Case "decline"
Call GuildCommand(7, "")

Case "founder"
If UBound(Command) = 2 Then
Call GuildCommand(8, Command(2))
Else
Call AddText("Must select user, use format /guild founder (name)", BrightRed)
End If
Case "kick"
If UBound(Command) = 2 Then
Call GuildCommand(9, Command(2))
Else
Call AddText("Must select user, use format /guild kick (name)", BrightRed)
End If
Case "disband"
If UBound(Command) = 2 Then
If LCase(Command(2)) = LCase("yes") Then
Call GuildCommand(10, "")
Else
Call AddText("Type like /guild disband yes (This is to help prevent an accident!)", BrightRed)
End If
Else
Call AddText("Type like /guild disband yes (This is to help prevent an accident!)", BrightRed)
End If

End Select
```
**Delete any accounts made before you installed this!**

**(Requested by Captain Obvious)**

[attachment=16:GuildFiles.zip]

[attachment=69:GuildCompiled.zip]
Link to comment
Share on other sites

  • Replies 328
  • Created
  • Last Reply

Top Posters In This Topic

Very nice easy tutorial Scott! If I used the old one would I have to just replace the guild mods or better just to redo the whole thing? Also I noticed you can only have a one word guild name.. if I used a txt box and button instead of the /command could I get around this? Thanks for sharing this bro :)
Link to comment
Share on other sites

You can just try to find my changes above and replace the mod files, other than that you need to re-do it.

Guild names: Yes that would be fine, the only reason it is limited to 1 word is because of the commands there is no code preventing spaces in guild names.
Link to comment
Share on other sites

I made a guild system similar. Only more complex. Being able to appoint and demote members to leaders, leaders to founders, and you have 1 chairman. If the chairman leaves any founder can claim the clan.

You also have to take into consideration when a player deletes their character or account.
Link to comment
Share on other sites

It's kept simple for a reason, I don't know what the people who will use this want so its basics to build off.  I had in mind easy expandability when I made this.

As for the delete character portion, this is something I overlooked and will be adding but a user can just kick them for now, thanks for letting me know.
Link to comment
Share on other sites

@Scott:

> Yes, just realized that shortly before you said this.  I'll release a version with fixes in a few days just in-case anymore issues come up.

okay I will waiting ,Additional another one, can you add a guild logo beside Guild text ***above Player head**
sorry to bother you
Link to comment
Share on other sites

**Guild Commands:**
_Make Guild: /guild make
To transfer founder status use /guild founder (name)
Invite to Guild: /guild invite (name)
Leave Guild: /guild leave
Open Guild Admin: /guild admin
Guild kick: /guild kick (name)
**Guild disband: /guild disband yes**
View Guild: /guild view (online/all/offline)
^Default is online, example: /guild view would display all online users.
You can talk in guild chat with:  ;Message_
Link to comment
Share on other sites

I don't see why you couldn't have pulled together a GUI yourself even if no one did offer to help.

As far as I remember the default EO GUI had a generic black box for these kinds of menus. You could even use GDI controls for it.

Still, seems like a solid system. I think you did right by keeping it simple. That's what a base system should do. Glad to know there are still other people around who are willing to work on things simply to release them.

It's also rare for someone to develop a system that actually works as advertised. Keep it up. I'll keep an eye on your work.
Link to comment
Share on other sites

@Robin:

> I don't see why you couldn't have pulled together a GUI yourself even if no one did offer to help.
>
> As far as I remember the default EO GUI had a generic black box for these kinds of menus. You could even use GDI controls for it.

I'm working hard to improve my self in this area, ever since I started working with eclipse this has become extremely apparent to me and is making work for me harder but I still was not happy with anything but those commands in the end.  Maybe I'm just to picky?

@Robin:

> Still, seems like a solid system. I think you did right by keeping it simple. That's what a base system should do. Glad to know there are still other people around who are willing to work on things simply to release them.
>
> It's also rare for someone to develop a system that actually works as advertised. Keep it up. I'll keep an eye on your work.

Thank you, I enjoy helping others develop games and this is a great way for me to bring that to more people.  It does end up taking me awhile to release things because I do try to not sit in front of my computer everyday, but I do enjoy making them so I don't expect to stop anytime soon.
Link to comment
Share on other sites

@Scott:

> I'm working hard to improve my self in this area, ever since I started working with eclipse this has become extremely apparent to me and is making work for me harder but I still was not happy with anything but those commands in the end.  Maybe I'm just to picky?

You'll learn in time. Took me a good couple of years to finally make something which was actually good. Just go around and look at all the best interfaces you can find. Read up on opinion articles and the like.

For now you can just steal all the existing control styles from Origins and re-use those.

@Scott:

> Thank you, I enjoy helping others develop games and this is a great way for me to bring that to more people.  It does end up taking me awhile to release things because I do try to not sit in front of my computer everyday, but I do enjoy making them so I don't expect to stop anytime soon.

You'll end up being one of the best developers around, then. The only way to get good with game design is to surround yourself with talented people. I was never that good when I started, but I always helped other people when they needed it. In the end I learnt how to recognise errors without even reading the code.

I met most of the developers I work with now through my early years as the forum's residential debugger. From them I learnt about all the other aspects of game design like graphics, feel and… well, design.
Link to comment
Share on other sites

@Whack:

> EDIT: Fixed the problem!
>
> There seems to be an error with the frmGuildAdmin. scrlRecruits needs to have its Min set to 0 and value to 0, or else you will error!

Why would you want scrlrecruits min to be 0? It hasto be set at 1 or higher anyways.

**And a sidenote to you Whack, I do not support PVO in my releases so please don't bash my tutorial again because you can't get it to work in a custom version.**

Guild Cost, I'll consider it since it is a pretty basic feature.
Guild Name, Yes it's possible I'll consider doing this also.

@Robin:

> You'll end up being one of the best developers around, then. The only way to get good with game design is to surround yourself with talented people. I was never that good when I started, but I always helped other people when they needed it. In the end I learnt how to recognise errors without even reading the code.
>
> I met most of the developers I work with now through my early years as the forum's residential debugger. From them I learnt about all the other aspects of game design like graphics, feel and… well, design.

Thank you again for all the encouragement, it's nice to know I'm on the right track.

To people using this:
I expect to release the bug fixes I have done so far on friday, as of now it is as simple as swapping 2 files and making a couple small edits to the client.  Guild save files won't be affected so no need to hold off on using the tutorial.
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...