News:

Wondering if this will always be free?  See why free is better.

Main Menu

[WIP] Mod Builder

Started by NanoSector, December 24, 2012, 08:05:46 PM

Previous topic - Next topic

XienDev

Ok.. this is not a hard task as i espected:

here is simple linked data structure:


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsFormsApplication1
{
public class DataBase
{
public Data root;
public Data prev;
public Data current;

        /// <summary>
        /// Adds here
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="next"></param>
        public void Add(string name, string value, Data next)
        {
            if (current != null)
            {
                current.Add(name, value, next);
            }
        }

        /// <summary>
        /// Removes DataValues
        /// </summary>
        /// <param name="toRemove"></param>
        public void Remove(DataValues toRemove)
        {
            if (current != null)
            {
                current.Remove(toRemove);
            }
        }

}

public class Data
{
        List<DataValues> m_values;

        /// <summary>
        /// Read only list of datas
        /// </summary>
        public List<DataValues> values
        {
            get {return m_values;}
        }


        /// <summary>
        /// Adds value to current data
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="next"></param>
        public void Add(string name, string value, Data next)
        {
            DataValues tmp = new DataValues(name, value, next);

            m_values.Add(tmp);
        }

        /// <summary>
        /// Removes value from current data
        /// </summary>
        /// <param name="toRemove"></param>
        public void Remove(DataValues toRemove)
        {
            if (m_values.Contains(toRemove))
                m_values.Remove(toRemove);

        }

        /// <summary>
        /// Constructor
        /// </summary>
        public Data()
        {
            m_values = new List<DataValues>();
        }

        /// <summary>
        /// Destructor
        /// </summary>
        ~Data()
        {
            m_values.Clear();
        }

}

    /// <summary>
    /// Contains a simple pair and reference to next data
    /// </summary>
public class DataValues
{
public string name;
public string value; //empty if not a final

        public Data next; //if next is empty than it is final

        /// <summary>
        /// Creates a list
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <param name="next"></param>
        public DataValues(string name, string value, Data next)
        {
            this.name  = name;
            this.value = value;
            this.next  = next;
        }
}
}


All what you need is add serialization and write a tool to fill base, don't forget to change it to your needs;

here is simple code how to fill it:


          database = new DataBase();

            Data root = new Data();

            database.root = root;
            database.prev = root;
            database.current = root;

            for (int i = 0; i < 5; i++)
            {
                Data tmp = new Data();

                for (int z = 0; z < 3; z++)
                {
                    Data tmp2 = new Data();

                    for (int j = 0; j < 3; j++)
                    {
                        //final values;
                        tmp2.Add("final value #" + j.ToString(), "some value #" + j.ToString(), null);
                    }

                    tmp.Add("Second layer #" + z.ToString(), "", tmp2);
                }


                database.Add("List #" + i.ToString(), "", tmp);
            }
 


Selector is a database current; if datavalue.next is null then it is a final value; hmm.. don't forget to store id of last value for Data. i hope i was clear.

and here is screan shot:

I'm not a native English speaker, so feel free to check my posts for spelling errors and improve them

Arantor

I'm not sure how this ties in to what you were saying... but even then it still requires much more coding to be done (including in PHP)

NanoSector

Generating code is more than just generating a line of text.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

NanoSector

It's alive! :D
http://imageshack.us/photo/my-images/534/screenshotfrom201302092.png/

One last thing to fix will be that the Mod Editor crashes upon creating a SQLite database connection. Might take a while, or not.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

ZerK

it is amazing!


PD to mod team: embrace yourselves!! my mods are coming

Mr. Pedram

Awesome
Thank you, it's very useful
My Modifications:
» Loading For SMF
» Buddies Block
» Redirect Links
» Birthdate On Registration
» PM Warning
» Instagram
» Add Table,Td,Tr Button
» Search Topic & Board Button
Browse All...

Bugo

What about translations? Like *.lng files.

NanoSector

Sorry, multilingual support is not implemented yet, I will implement it in version 2.0 as I'll be redoing the thing then :)

Unless you mean in mods, but I've never seen a .lng file before in a mod. If you could provide me a sample if it's a mod, I'd be able to implement it :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Bugo

I mean *.lng files for your ModBuilder.exe

NanoSector

Yeah, I'll implement that in 2.0 :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

NanoSector

#110
I need input for versions 1.3 and 2.0. What features would you like in those versions? :)

Currently planned features for 1.3 and 2.0:
1.3
- Code templates: Allows you to easily insert templates.
- Fix the compiler: Fix the compiler so you do not need to re-zip files.
- Code checking: Allow code to be checked for parse errors by PHP.

2.0
- User Interface redesign: Instead of using an Agent, Mod Editor windows and a Console, I will integrate all that in one window.
- Language support: The UI should be translatable, and language packs should be provided.
- Code Editor: A code editor should be integrated, which provides easier code editing. Users should be able to edit code right in the Mod Builder.
- Hook Editor: Mod Builder should provide an easy way to insert and edit hooks. By entering the hook name and value once, installation and deinstallation instructions should be generated.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

NanoSector

If you are desperate to try building mods with this on Linux or Mac, I just got it running flawlessly on my Linux laptop.

Linux
1. Download and install PlayOnLinux on the distribution you are using. I am using Elementary OS, based on Ubuntu, so I went with the Ubuntu DEB package.
2. Open POL and let it do it's setting up. After it's done, click "Install".
3. A window pops up. Wait till it finished reloading, then at the bottom of the window click "Install a non-listed program". A wizard will come up. Click next.
4. Keep the default setting for creating a new hard drive. Click next.
5. Type "ModBuilder" in the text box where you need to set a name. Click next.
6. Check both "Use another version of Wine" and "Install some libraries" and click Next.
7. In this screen, select the latest version of wine you have installed. For me, this is 1.5.28. Click next.
8. Select 32-bits Windows installation and click next.
9. Wine will open and start preparing your new virtual drive. This shouldn't take long. Select Install on any prompts which may open.
10. The wizard will continue, with a long list of libraries you can install. Check POL_Install_dotnet40 and click Next.
11. .NET 4.0 will be installed in the virtual drive. This may take a while.
12. After this, the wizard will ask you for an executable file. Download the latest setup.exe file from the first post, and browse and select it by clicking on the button.
13. Click next, and then follow the setup program like you normally would. At the end of the installer, uncheck "Launch Mod Builder"!
14. Now the wizard will prompt for the executable file to create a shortcut for. Select "ModBuilder.exe" (at the end of the list, with the card icon) and click Next.
15. Enter "Mod Builder" in the text box.
16. Select "I don't want to make another shortcut" and click Next. The wizard will close.
17. Select "Mod Builder" in the main POL window and click Play, and get building!

May sound like a lot of steps but they really can be done in a minute :)
I will test on my iMac ASAP and create a guide for that. I know Wine is not the optimal way of doing these things, but right now it is the only way.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Matthew K.


NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

NanoSector

Allright, so hereby I'd like to announce version 1.2 and immediate update 1.2.1!

Version 1.2 includes:
- Smarter code building!
- Smarter code editing!
- A redesign for the Agent!
- Instruction checking!
- Environment management!
- More settings!
- Faster opening and saving of projects!
- The ability to work offline without crashes!
- Highly needed bug fixes!

Please update either manually or update from within Mod Builder by using the Check for updates link on the Agent screen :)

Some of you code readers may actually notice a feature I was working on for a later version, which is partially included...
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Colin

Thanks Yosh! Great work as always.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

NanoSector

Thanks Colin :)

I shifted some features to 1.3 as I wanted to get this version out first, due to the various bug fixes. Sorry if you are disappointed to not see a certain feature in here.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

NanoSector

Allright, so, with BurkeKnight I got heaps of bugs fixed and we're on 1.2.4 already! :)

I hope successful building and compiling is now guaranteed (apart from the horrible bug in SMF 1.1 and 2.0). If it is not, give me a poke and I'll fix the bugs (or, you C# coders, submit a pull request!)

Thanks again BurkeKnight :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Burke ♞ Knight

Whew!!!

And to think, I was thinking it was me, not the program...lol

Yoshi, thanks for all the help, and the chance to work together on the bugs.
Let me know if I can be of more service. :)

NanoSector

I can't be happier if you'd just use the program like normal and report any bugs or weird stuff that'd come along :)

If you want to, though, you can help me with writing a wiki sometime later. I'll get one set up tomorrow, or if not, later this week.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: