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

Skill System [EO]


Matt
 Share

Recommended Posts

I'm working on a skill system. I'm not the best at coding, so i'm a bit confused as to how to do certain things. My biggest issue is how to set the levels in the skill system. Since i've never seen it done before, nor have i ever seen anything like it be done in EO, i'm stuck. Can anyone give me advice on where to start?

EDIT: Because the skills are a part of the player, should i place something like

```
    Woodcutting As Byte
    Woodcuttingxp As Long
```In PlayerRec?
Link to comment
Share on other sites

First, make a SkillRec, which will contain all the info for an individual skill, (such as the player's level in that skill). Let me make an example:
```
Public Type SkillRec
    Name As String * 20
    Level As Long
    Exp As Long
End Type

```
Afterwards, create an enum:

```
Public Enum Skills
    Mining = 1
    Fishing
    ' always at bottom:
    SKILL_COUNT
End Enum
' comment: Skills.Mining = 1, Skills.Fishing = 2

```
This will allow you to reference skills by name, rather than by number. In addition, it will add a SKILL_COUNT:
Then, in PlayerRec, add:

```
Skill(1 To SKILL_COUNT - 1) As SkillRec
```
I think you can guess where this is going:
```
Player(index).Skill(Skills.Mining).Level = Player(index).Skill(Skills.Mining).Level + 1

```
4 new replies.

@Faulty:

> ttheres a spells system already

@Faulty:

> Use The event system it will be very helpful to you

Those are unrelated to the current problem.
Link to comment
Share on other sites

@Soul:

> First, make a SkillRec, which will contain all the info for an individual skill, (such as the player's level in that skill). Let me make an example:
> ```
> Public Type SkillRec
>     Name As String * 20
>     Level As Long
>     Exp As Long
> End Type
>
> ```
> Afterwards, create an enum:
>
> ```
> Public Enum Skills
>     Mining = 1
>     Fishing
>     ' always at bottom:
>     SKILL_COUNT
> End Enum
> ' comment: Skills.Mining = 1, Skills.Fishing = 2
>
> ```
> This will allow you to reference skills by name, rather than by number. In addition, it will add a SKILL_COUNT:
> Then, in PlayerRec, add:
>
> ```
> Skill(1 To SKILL_COUNT - 1) As SkillRec
> ```
> I think you can guess where this is going:
> ```
> Player(index).Skill(Skills.Mining).Level = Player(index).Skill(Skills.Mining).Level + 1
>
> ```
> 4 new replies.
>
> Those are unrelated to the current problem.

Just curious, shouldn't```
Skill(1 To SKILL_COUNT - 1) As SkillRec
```be something like```
Skill(1 To Skills.SKILL_COUNT - 1) As Long
```?
Link to comment
Share on other sites

  • 6 months later...

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...