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

Account converter


Guest
 Share

Recommended Posts

I added a new stat to the game by simply copying and pasting from the other stats. However i now need to delete all my players accounts in order for them to have the stat. Any one got a converter that will help? Or is their anyother way to do this?
Link to comment
Share on other sites

@Synergy:

> No, probably not.

Shush, plox.

Making a converter is quite simple. All you need is the old player structure, the new player structure, and then you need to load the old player structure, copy the data across into the right type, and just write it into the reorganised player structure.

As an example, I believe there's a converter for the Quest system, which functions in exactly the same way, just with different structures.
Link to comment
Share on other sites

@Lenn:

> Shush, plox.
>
> Making a converter is quite simple. All you need is the old player structure, the new player structure, and then you need to load the old player structure, copy the data across into the right type, and just write it into the reorganised player structure.
>
> As an example, I believe there's a converter for the Quest system, which functions in exactly the same way, just with different structures.

Fair enough.
Although he did ask if someone had one, and there isn't currently one..  ;)

Out of interest though, how would you go about changing the quest converter to work for accounts?
Link to comment
Share on other sites

@Synergy:

> Fair enough.
> Although he did ask if someone had one, and there isn't currently one..  ;)
>
> Out of interest though, how would you go about changing the quest converter to work for accounts?

It's the same principle. You list both UDTs, and load the old one, write the old one into the new format, and save the new one.
Link to comment
Share on other sites

Let's imagine we're loading two NPCs. The old structure has a name, a sprite, and a certain music that plays when you attack it. The structure looks like this:

```
Private Type OldNPCrec
          Name As String * 20
          Sprite As Byte
          Music As String * 20
End Type

```
But, now, I want to add HP to it, and I also want to extend it's string limit to 50\. Problem is, if I do that, my UDTs'll mess up, and won't work.

So, the new one would look like:

```
Private Type NewNPCrec
          Name As String * 20
          Sprite As Byte
          Music As String * 20
          HP As Long
End Type

```
So, how do we overcome our dilemma?

Well, we load our old NPC UDTs in the converter.
  "Get #F, , OldNpc(i).Name"

And, we then simply put the old ones into where they're meant to go

    NewNpc(i).Name = OldNpc(i).Name

And, then we save the new rec, preferably, in a new location.
    "Put #F, , NewNpc(i).Name"

Now that we've stuck the old data into it's "correct place", we can effectively edit what's new, and not mess anything up.
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...