[SimpleRelease]NPC Creator

01/16/2011 22:26 Syst3m_W1z4rd#1
This is for hybrids source.
You can use it to create NPC's fast and simple.
It already have the standard things as you can see.

I will implent more functions later, to make it more userfriendly, but this is what I got now.

It can also load npcs. If you write the general things, then it won't make them automatical, but if it detects, that you haven't made it, then it will automatical write them in.

Features now:
Code:
-Save warning before you're making a new npc.
-Madeby, NPCID & NPCName defined by textboxes.
-Standard class for NPCScripting in vb.
-Open NPCScripts (.vb).
-SaveNPCScripts in the default folder NPCScripts\file.vb.
What I'm planning to make:
Code:
Autoscripting for LUA, with eg. Moneys, Items, Levels etc.
Create dialog automatical.
Add npc's automatical into process.vb, once they are saved.
More functions, then only NPCScripting.
Screenshot:
[Only registered and activated users can see links. Click Here To Register...]

Download:
[Only registered and activated users can see links. Click Here To Register...]

is not obfuscated, so you can deobfuscate it, if you want.
It requires .NET Framework 4, didn't bother to make it lower.

Sourcecode:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Text.RegularExpressions;
using System.IO;

namespace NPCDialogCreator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (txtDialog.Text.Length > 2)
            {
                DialogResult dlgResult = MessageBox.Show("Do you want to save current NPCFirst?",
        "SAVE WARNING",
        MessageBoxButtons.YesNoCancel);

                if (dlgResult == System.Windows.Forms.DialogResult.Yes)
                {
                    MadeBy = txtMade.Text;
                    NPCID = txtID.Text;
                    NPCName = txtName.Text;
                    WriteDialog();

                    txtDialog.Text = "";
                }
                else if (dlgResult == System.Windows.Forms.DialogResult.Cancel)
                {
                }
                else if (dlgResult == System.Windows.Forms.DialogResult.No)
                {
                    txtDialog.Text = "";
                }
            }
            else
                txtDialog.Text = "";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            bool Have = false;
            OpenFileDialog ofn = new OpenFileDialog();
            ofn.Filter = "VisualBasic Files (*.vb)|*.vb";
            ofn.Title = "Open NPCDialog";
            while (Have == false)
            {
                if (ofn.ShowDialog() == DialogResult.Cancel)
                    return;

                string file = ofn.FileName;

                try
                {
                    FileStream fs = new FileStream(@"" + file, FileMode.Open);
                    StreamReader sr = new StreamReader(fs);

                    string text = sr.ReadToEnd();

                    sr.Close();
                    fs.Close();

                    txtDialog.Text = text;

                    Have = true;
                }
                catch (IOException io)
                {
                    MessageBox.Show(io.ToString());
                }
            }
        }
        private string MadeBy = "";
        private string NPCID = "";
        private string NPCName = "";
        private string General = "\nImports System\nImports ConquerScriptLinker\n\nPartial Public Class NpcEngine\n";
        private string End = "\nEnd Class";
        private void WriteDialog()
        {
            string dialog = MadeBy +
            "\n' Npc: " + NPCID +
            NPCName + "\n" +
            General + "\n";

            if (txtDialog.Text.Contains(dialog) && dialog.Length > 10)
            {
                dialog = txtDialog.Text;
            }
            else
                dialog = dialog + txtDialog.Text + "\n" + End;

            try
            {
                FileStream fs = new FileStream(@"NPCScripts\" + NPCID + ".vb", FileMode.CreateNew);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine(dialog);
                sw.Flush(); fs.Flush();
                sw.Close(); fs.Close();
            }
            catch
            {
                FileStream fs = new FileStream(@"NPCScripts\" + NPCID + ".vb", FileMode.Truncate);
                StreamWriter sw = new StreamWriter(fs);
                sw.WriteLine(dialog);
                sw.Flush(); fs.Flush();
                sw.Close(); fs.Close();
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            MadeBy = "' By: " + txtMade.Text;
            NPCID = txtID.Text;
            NPCName = "\n' Name: " + txtName.Text;
            WriteDialog();
        }
    }
}
01/17/2011 01:27 taylor2846#2
looks nice.
would you happen to have a open source version of it i can get?


i would like to see how this little things are made.
and try to make a more adv vs of it to release to you all just to see if i can.
01/17/2011 01:40 Syst3m_W1z4rd#3
Posted sourcecode, I found some mistakes in it, I will update them tomorrow. Thank you :)
01/17/2011 20:52 JobvdH#4
Well its very nice, only i wouldnt release the source code too.
Because some people might copy it, remove copyrights (If included) and add their own to claim its their work
01/17/2011 21:19 Syst3m_W1z4rd#5
They can't just copy + paste it, they also need to know where to paste it, also they need to make the design etc. by them self.
01/17/2011 21:24 BioHazarxPaul#6
Quote:
Originally Posted by Syst3m_W1z4rd View Post
They can't just copy + paste it, they also need to know where to paste it, also they need to make the design etc. by them self.
Let em copy and paste, Syst3m can just be like hey its mine and send em to this post if they don't give him his credit.
01/17/2011 21:31 Syst3m_W1z4rd#7
I wouldn't even do. I don't care if peoples take my work.
01/17/2011 21:40 _tao4229_#8
[Only registered and activated users can see links. Click Here To Register...]

Easy to embed, provides built in parsers for VB, C#, and python (among others)

It'll make it easier for people to program with rather than a plain old richTextBox.
01/18/2011 08:26 JobvdH#9
thats nice