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

Coding Question, possibly advanced~ Just a quick question ^_^


Zappy
 Share

Recommended Posts

I've been working on an advanced crafting system, and to do so, I needed to create a completely new type of object which I've called recipes. I don't really know what to call it, so when I say "type of object", I'm referring to maps, items, spells, npcs, animations, etc. I've nearly finished all the code, and it's so close to being fully functional. However, I can't seem to find what I'm missing to save the information on shut down. It only saves it in the client, regardless of my attempts to completely mimic how the other information in the game is transferred from client to server and saved. (The folder is set up, and all 500 files [recipe1, recipe2, etc] are generated. Once I close out of the client, I lose the data I "saved".
Anything specific I may be forgetting? If you need source, feel free to ask. Though its a bit messy…

(I've nearly followed how items are saved line for line, with minor adjustments of course for a different type of object)
Link to comment
Share on other sites

It'll cache in a way that I can save, close the editor, close the admin panel, and open it back up again to see it there. But when I completely close the client and re open it, it isn't there anymore. I can log out, but NOT close the client, and it'll still be there.
Also, I get completely random "subscript out of range" problems, at random unpredictable times, usually during an action that I perform over and over again, without any problems.

EDIT:
If it helps, the packs Im sending: (all of the "Handle blah blah blah's" seem to be working fine)

    CRequestEditRecipes
    CSaveRecipe
    CRequestRecipes

    SRecipeEditor
    SUpdateRecipe

EDIT AGAIN:

Also, heres the "SendSaveRecipe" sub from the client:

```
Public Sub SendSaveRecipe(ByVal Recipenum As Long)
Dim buffer As clsBuffer
Dim RecipeSize As Long
Dim RecipeData() As Byte

    Set buffer = New clsBuffer
    RecipeSize = LenB(Recipe(Recipenum))
    ReDim RecipeData(RecipeSize - 1)
    CopyMemory RecipeData(0), ByVal VarPtr(Recipe(Recipenum)), RecipeSize
    buffer.WriteLong CSaveRecipe
    buffer.WriteLong Recipenum
    buffer.WriteBytes RecipeData
    SendData buffer.ToArray()
    Set buffer = Nothing

    ' Error handler
    Exit Sub
End Sub
```
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...