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

New UDT not working[Solved]


crzyone9584
 Share

Recommended Posts

I'm building up my personal guild system and for some reason its not allowing to add things to it.

Like I'm trying to do Player(index).Guilds(i).GuildName =  but but its not accepting the (i) and the ide beeps after i add the .

Here is my code so far.

```
Public Guilds(1 To MAX_GUILDS) As GuildRec ' Used for checking guilds exsist or not.

Private Type GuildRec
    GuildName As String * NAME_LENGTH
    GuildID As Byte
    GuildMembers(1 To MAX_GUILD_MEMBERS) As String
    AmountofGuildMembers(1 To MAX_GUILD_MEMBERS) As String
End Type
```
in the playerrec i have
```
'Guild System
    Guild(1 To MAX_USERS_GUILDS) As GuildRec
```
Here are my constants
```
Public Const MAX_GUILDS As Byte = 50
Public Const MAX_USERS_GUILDS As Byte = 2 ' Allows users to join X amount of Guilds.
Public Const MAX_GUILD_MEMBERS = 15 ' Limit one guld from having all the members

```
What have i messed up even if i leave out the (i) and just add . it still beeps at me. This is in EO 2.0
Link to comment
Share on other sites

You have nothing to check all the guilds
you declared the constant MAX_GUILDS
but your not using it in ur recs

Guild(1 to MAX_GUILDS) as etc

im doing the same thing for my guild system
im using Player(index).Guilds(i).GuildName

so what you would have is loop through all the guilds to find a slot thats empty

For i=1 to MAX_GUILDS
      If Player(index).Guilds(i).GuildName = vbnullstring then
      Player(index).Guilds(i).GuildName = $variableNameTheyEntered
      Else

but i see that your making that each user can have 2 guilds??
if so ull need to do 2 loops using say i2 or something to check if the 2 users guilds have a empty slot?
Link to comment
Share on other sites

peekay, I know how it it works. The check is nt even programmed in yet. It was getting programmed when i came across this error. If you notice there is a for i loop and an for x loop…

@Yukiyo - s in Player9index).Guilds was accidently typed when typing into the forums. I'm using .Guild but its just not working. I went and added my friend system in and thats not working either. None of the UDT's that I've added are working....
Link to comment
Share on other sites

I'm just spitballing here but does the declaration of the type have anything to do with it?

I see both privates and publics in the types:
```
Private Type BankRec
    Item(1 To MAX_BANK) As PlayerInvRec
End Type

Public Type PlayerInvRec
    num As Long
    Value As Long
End Type

```Maybe if you change Private Type GuildRec to Public Type GuildRec?

Sorry if I'm way off, just trying to help…
Link to comment
Share on other sites

@zulu:

> I'm just spitballing here but does the declaration of the type have anything to do with it?
>
> I see both privates and publics in the types:
> ```
> Private Type BankRec
>     Item(1 To MAX_BANK) As PlayerInvRec
> End Type
>
> Public Type PlayerInvRec
>     num As Long
>     Value As Long
> End Type
>
> ```Maybe if you change Private Type GuildRec to Public Type GuildRec?
>
> Sorry if I'm way off, just trying to help…

You obviously have no idea. Please, stop trying.

Is GuildRec above PlayerRec? because it will not function if it's not.

EDIT
Found the problem
Change
```
Public Const MAX_GUILD_MEMBERS = 15 ' Limit one guld from having all the members

```to
```
Public Const MAX_GUILD_MEMBERS as byte = 15 ' Limit one guld from having all the members

```
Link to comment
Share on other sites

thats not the problem bunny. all my other custom udt's are working either and they are all copy and pasted from wn which work just fine. I even tried typing them all out by hand once again, and still nothing works…

As i said in my earlier post I'm giving up from moving from WN to EO 2.0

EDIT: So i tried one last time. I renamed all the udts and guess what. they worked.... Who new renaming things would work...
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...