DeathKnight Posted March 29, 2014 Author Share Posted March 29, 2014 I'm looking for some help implementing a new editor into an engine (using Eclipse Worlds 1.1.7, but that should matter).Essentially what I'm doing is trying to copy the spell editor to make a talent editor (once I get the editor working, I'll adjust the system). My problem is it crashes when it saves, so I'm just wondering if someone can explain where exactly something in the spell system is being pulled from. This is the particular sub in question. What happens is when I run my talent editor, it pops up with the basic editor (only have name, icon and a lstIndex on the form right now) . When I make the edit and save, the client closes down, no error, just exits. In the staff log's it shows that a talent was edited, though when I load it doesn't show any information on the talent screen (though that could just be my loading isn't correct). Can someone explain to me where the information for this line comes from exactly? ```buffer.WriteBytes SpellData``````Public Sub SendSaveSpell(ByVal SpellNum As Long) Dim buffer As clsBuffer Dim SpellSize As Long Dim SpellData() As Byte ' If debug mode, handle error then exit out If Options.Debug = 1 Then On Error GoTo errorhandler Set buffer = New clsBuffer SpellSize = LenB(Spell(SpellNum)) ReDim SpellData(SpellSize - 1) CopyMemory SpellData(0), ByVal VarPtr(Spell(SpellNum)), SpellSize buffer.WriteLong CSaveSpell buffer.WriteLong SpellNum buffer.WriteBytes SpellData SendData buffer.ToArray() Set buffer = Nothing Exit Sub' Error handlererrorhandler: HandleError "SendSaveSpell", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext Err.ClearEnd Sub``` Link to comment Share on other sites More sharing options...
abhi2011 Posted March 30, 2014 Share Posted March 30, 2014 The error might be taking place but not being raised. Go to the error log and check if there are any new entries. To make it easier in the future change Options -> Debug to 0.The value of SpellData is set by using an API call. This line in the given method does it. ```CopyMemory SpellData(0), ByVal VarPtr(Spell(SpellNum)), SpellSize```What is done is that SpellData is first declared and it's size/dimension is set which is equal to the number of bytes in the spellrec. This "buffer" is given to the copymemory directly as the first parameter. As the second parameter the pointer of the the spell rec is passed and then finally the size of the rec is passed. What copymemory does is it takes this "buffer" and starts setting the data from the spell rec starting from the first variable sequentially downwards on to the buffer. The amount of data copied it the SpellSize. This byte buffer is then added into the packet buffer. Link to comment Share on other sites More sharing options...
DeathKnight Posted March 30, 2014 Author Share Posted March 30, 2014 Thanks, this really helped me understand it a bit better. Didn't help me get it fixed, I'm thinking of using a different engine, and I was able to start over and do a more complete copy and get done what needed to be done. (for the most part). At least it's working like it should (I focused more on copying the system and less on ripping out what it doesn't need. I'll work on that soon). Link to comment Share on other sites More sharing options...
abhi2011 Posted March 30, 2014 Share Posted March 30, 2014 If you need any more help then don't hesitate to ask. Link to comment Share on other sites More sharing options...
DeathKnight Posted March 30, 2014 Author Share Posted March 30, 2014 Thanks. I'll probably come to you when the system is done for some debugging (currently one thing I can't figure out how to do, but it shouldn't be too difficult), but I know once I hit the 2nd half of it then it will be way more difficult for me. Link to comment Share on other sites More sharing options...
SpiceyWolf Posted March 31, 2014 Share Posted March 31, 2014 Volvex I am not here often if you need me Find me on skype or send a messege to this profile and wait for a response i can help you personally get it working.Skype: [email protected] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now