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

PlayerRec, QuestRec, ect


Rithy58
 Share

Recommended Posts

I'm just wondering how this work.
So let me see if I understand it correctly.

```
MAX_PLAYERS=2
MAX_NPCS=2

```
```
Public Player(1 To MAX_PLAYERS) As PlayerRec

```
This create as 2 spots(or files?) for Player.
Each Player is created using PlayerRec as a template.

```
Private Type PlayerRec
    ' General
    Name As String
    Class As Long
    Sprite As Long
    Level As Byte

    'Quest
    NPCQuest(1 To MAX_NPCS) As QuestRec
End Type

``````
Private Type QuestRec
    Progress As Byte
    Item(1 To 2) As Byte
EndType

```With this, each Player(file?, spot?) have like a data holder as follow
Name=
Class =
Sprite =
Level =
NPCQuest(1).Progress =
NPCQuest(1).Item(1) =
NPCQuest(1).Item(2) = 2
NPCQuest(2).Progress =
NPCQuest(2).Item(1) =
NPCQuest(2).Item(2) =

And I can put the data like "Player(1).NPCQuest(1).Item(2) = 2"

Now I compiled the server and run and everything.

2 days later, I add Level As Byte into QuestRec so now I'd have :
    Progress As Byte
    Item(1 To 2) As Byte
    Level As Byte

I compile and run the server, would all the player now have NPCQuest(#).Level = #?
Or if I changed the MAX_NPCS to 3, would all players have NPCQuest(3).# = #?
Or do I have delete all the Player Data in accounts folder?

I want to know if my understand of how EO save data is correct and what exactly is "PlayerRec, QuestRec, etc"

Sincerely,
Rithy
Link to comment
Share on other sites

Before:

```
Name=
Class =
Sprite =
Level =
NPCQuest(1).Progress =
NPCQuest(1).Item(1) =
NPCQuest(1).Item(2) = 2
NPCQuest(2).Progress =
NPCQuest(2).Item(1) =
NPCQuest(2).Item(2) =
```
After:

```
Name=
Class =
Sprite =
Level =
NPCQuest(1).Progress =
NPCQuest(1).Item(1) =
NPCQuest(1).Item(2) = 2
NPCQuest(1).Level=
NPCQuest(2).Progress =
NPCQuest(2).Item(1) =
NPCQuest(2).Item(2) =
NPCQuest(2).Level=
```
Yet your previous files will still be stored as the previous UDT, in which case the variable in "NPCQuest(1).Level" will be read from the old file data, which will be whole or part of "NPCQuest(2).Progress", which could cause an error. So yes, in this case you would have to delete your NPC files. (Or whatever you are using to store it) Alternatively, you could code a custom-made converter which will keep your old files intact, whilst keeping the the new UDT.

Changing the MAX_NPCS for NpcQuest will not matter as there are no data after this. However, if you add other variables after NpcQuest, then obviously changing MAX_NPCS will affect the data. Again, you would have to delete your player files, or run the old files through another converter.

Hope this has helped,

Lightning
Link to comment
Share on other sites

So the order of the Type is important.
And the server doesn't check the UDT against the files and change them(the files) if needed.

So the UDT is the data stored in memory and the server save those memory into files? Or what is UDT?
And how would I start coding this converter? Is there any other way for the server to like, convert the files by if it check the files and they're not the same as the UDT?

Thanks for helping me. I really appreciate your help. I want to learn more about EO.

Sincerely,
Rithy
Link to comment
Share on other sites

The best way to learn is lots of hands on moding. the more tuts you do the more likely you will be able to create your own mods later on.

I myself Did about 15 tuts on my copy then i started making my own, I just recently made somthing NEW that has never been seen before on EO. Just keep working at it and you will do great.
Link to comment
Share on other sites

@RyokuHasu:

> The best way to learn is lots of hands on moding. the more tuts you do the more likely you will be able to create your own mods later on.
>
> I myself Did about 15 tuts on my copy then i started making my own, I just recently made somthing NEW that has never been seen before on EO. Just keep working at it and you will do great.

o.o umm okay thanks for the tip? If you hadn't notice, I have some understand of how the server save and use the data but I don't understand it completely so I come here to ask a question and discuss about how to make the server convert the data so we don't have to delete the old data everytime we add a new TypeRec

Sincerely,
Rithy
Link to comment
Share on other sites

What i do to see if the changes occur in the file and all is save it as a txt this way you can test and see for example if you have to delete everything or not then just revert them to bin when you're done…(hope that helps a bit even though you already got your answer)
Link to comment
Share on other sites

@Musbah:

> What i do to see if the changes occur in the file and all is save it as a txt this way you can test and see for example if you have to delete everything or not then just revert them to bin when you're done…(hope that helps a bit even though you already got your answer)

I appreciate your help.

I want to know what it is, though. I'm doing some research on the internet right now and also waiting for someone that know this such as Lightning and Robin to explain this to me.

Sincerely,
Rithy
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...