ScriptyEditor(another one DB editor)

Results 1 to 5 of 5
  1. #1
    Proficient Member Turmalin is offline
    MemberRank
    Jul 2014 Join Date
    168Posts

    ScriptyEditor(another one DB editor)

    So, it's editor for those one, who would like to code dbs.
    All is simple - you can look for source code(if would like to upgrade it) or just use script from Script folder.

    How it's works?

    You have simple script like this:

    Code:
    using System.IO;
    using System.Linq;
    namespace ROMEditor.Classes
    {
        public class Script
        {
            public void EntryPoint()
            {
                var dbBuffs = new DBEditor<Structures.GameObjectMagicStruct>("magicobject");
                var buffs = dbBuffs.objects;
                var newBuff = buffs.Row(503499, 629999);
                newBuff.EqType[0] = (int) EqType.GatherSpeedRate;
                newBuff.EqTypeValue[0] = 3000; 
                //newBuff.EqType = new[] { 10, 10, 10, 0, 0, 0, 0, 0, 0, 0 };
                //newBuff.EqTypeValue = new[] { 10, 10, 10, 0, 0, 0, 0, 0, 0, 0 };
                dbBuffs.saveChanges();
            }
        }
    }

    You would need to put all dbs, that you would change, to \Binaries\db. Changed dbs would be produced into \Binaries\db_result.



    So, how it works?
    Structures.GameObjectMagicStruct is struct for magicobject.db(which you already have add into \Binaries\db, isn't you?). You can see list of all structs in Classes(look into source code).

    Next row is needed to work with objects collection.

    var newBuff = buffs.Row(503499, 629999);
    This code row just create new buff with id 629999 from 503499.

    Next 4 rows(include commented) are example of fields modifications(which you can see in those Structures.cs file). Also, you can get those EqType.GatherSpeedRate values from Classes\UsableData.cs - which are named values(enums) for int values, which u use as diff fields values.

    dbBuffs.saveChanges();
    This code row would save all your changed to Binaries\db_result folder.


    Also, you can look for more examples inside Classes folder(most part are test code, which not used now).


    Debug.zip
    ScriptEditor.zip


  2. #2
    Proficient Member Drewww is offline
    MemberRank
    Apr 2015 Join Date
    164Posts

    Re: ScriptyEditor(another one DB editor)

    Looks like C and I never wrote or used C before. Might be time to learn some basics.

  3. #3
    Proficient Member Turmalin is offline
    MemberRank
    Jul 2014 Join Date
    168Posts

    Re: ScriptyEditor(another one DB editor)

    It's C#, not C.
    BTW, it's simpliest way I had found to merge diff version *.db and save all changes in readable view.

  4. #4
    Member MunkyCS is offline
    MemberRank
    Jul 2014 Join Date
    RussiaLocation
    58Posts

    Re: ScriptyEditor(another one DB editor)

    You can probably make a SQL-like syntaxis for that. However, I hate SQL, lol. As for me C# with LinQ is much more convenient

  5. #5
    Proficient Member Turmalin is offline
    MemberRank
    Jul 2014 Join Date
    168Posts

    Re: ScriptyEditor(another one DB editor)

    I usually use LINQ with lambda-syntax, as well in this editor)



Advertisement