Go Back   Flash Flash Revolution > Gaming > Stepmania
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 09-21-2009, 12:42 AM   #1
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default SpeedModGenerator2.5 (autosave function)


Download http://www.flashflashrevolution.com/...p?songid=39261
--------------------------------------------------





So I worked on this today. I started not knowing how to search for a specific file and write to it but I believe I figured it all out. This one only works with 3.9 and 3.95 because I got fed up with trying to make it work for 3.9 and 4.0 while saving. Try it out for me and tell me if it works please. It is generally pretty stable if you aren't completely dumb.

Last edited by Izzy; 09-22-2009 at 02:03 PM..
Izzy is offline   Reply With Quote
Old 09-21-2009, 12:48 AM   #2
who_cares973
FFR Player
 
who_cares973's Avatar
 
Join Date: Aug 2006
Location: :U
Age: 35
Posts: 15,407
Send a message via AIM to who_cares973 Send a message via MSN to who_cares973 Send a message via Yahoo to who_cares973 Send a message via Skype™ to who_cares973
Default Re: SpeedModGenerator2.5 (autosave function)

very cool i'll try it out tomorrow
__________________
who_cares973 is offline   Reply With Quote
Old 09-21-2009, 12:50 AM   #3
leonid
I am leonid
Retired StaffFFR Simfile AuthorFFR Music ProducerD7 Elite KeysmasherFFR Veteran
 
leonid's Avatar
 
Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
Default Re: SpeedModGenerator2.5 (autosave function)

Doesn't work on mac
lame
__________________



Proud member of Team No
leonid is offline   Reply With Quote
Old 09-21-2009, 12:54 AM   #4
pokelda
⁽ ´ཀ`⁾
FFR Simfile AuthorFFR Veteran
 
pokelda's Avatar
 
Join Date: Jun 2006
Location: It is a mystery.
Posts: 3,876
Send a message via AIM to pokelda Send a message via MSN to pokelda Send a message via Yahoo to pokelda
Default Re: SpeedModGenerator2.5 (autosave function)

i agre, macs are lame
__________________
pokelda is offline   Reply With Quote
Old 09-21-2009, 12:55 AM   #5
leonid
I am leonid
Retired StaffFFR Simfile AuthorFFR Music ProducerD7 Elite KeysmasherFFR Veteran
 
leonid's Avatar
 
Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
Default Re: SpeedModGenerator2.5 (autosave function)

i agree with that too
__________________



Proud member of Team No
leonid is offline   Reply With Quote
Old 09-21-2009, 12:51 PM   #6
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: SpeedModGenerator2.5 (autosave function)

Here is my horrendous looking code. I'm aware there might be easier or less bulky methods of doing things. I just put down the first thing that came to my head that made it work.

Code:
using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.IO;

namespace WindowsFormsApplication1
{
    public partial class SpeedmodGen : Form
    {

        StreamReader x = new StreamReader("metrics.ini");
        public int xcount = 1;
        public int xxcount = 1;
        public int ccount = 1;
        public int cccount = 1;
        public double xstart = 0;
        public double xend = 0;
        public double xinc = 0;
        public int cstart = 0;
        public int cend = 0;
        public int cinc = 0;

        public SpeedmodGen()
        {
            InitializeComponent();
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void Go_Click(object sender, EventArgs e)
        {
            
                if (Xstart.Text == "" || Xend.Text == "" || Xinc.Text == "" || Cstart.Text == "" || Cend.Text == "" || Cinc.Text == "")
                {
                    MessageBox.Show("At least one field is empty", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                else
                {
                   
                    xstart = Convert.ToDouble(Xstart.Text);
                    xend = Convert.ToDouble(Xend.Text);
                    xinc = Convert.ToDouble(Xinc.Text);
                    cstart = Convert.ToInt32(Cstart.Text);
                    cend = Convert.ToInt32(Cend.Text);
                    cinc = Convert.ToInt32(Cinc.Text);
                    
                
                    metrics.Text = "";
                    Language.Text = "";

                    for (double i = xstart; i <= xend; i = i + xinc)
                    {

                        xxcount += 1;
                    }


                    cccount = xxcount;
                    for (int i = cstart; i < cend; i = i + cinc)
                    {
                        cccount += 1;
                    }


                    
                    metrics.Text = ("# Player options\r\n");
                    metrics.Text = metrics.Text + ("Speed=" + cccount + "\r\n");
                    metrics.Text = metrics.Text + ("SpeedDefault=mod,1x\r\n");

                    for (double i = xstart; i <= xend; i = i + xinc)
                    {
                        metrics.Text = metrics.Text + ("Speed," + xcount + "=mod," + System.Math.Round(i, 3) + "x;name,x" + System.Math.Round(i, 3) + "\r\n");
                        xcount += 1;
                        metrics.Update();
                    }

                    ccount = xcount;
                    for (int i = cstart; i <= cend; i = i + cinc)
                    {
                        metrics.Text = metrics.Text + ("Speed," + ccount + "=mod," + "C" + i + ";name,C" + i + "\r\n");
                        ccount += 1;
                        metrics.Update();
                    }

                    Language.Text = "";
                    for (double i = xstart; i <= xend; i = i + xinc)
                    {

                        Language.Text = Language.Text + ("x" + System.Math.Round(i, 3) + "=x" + System.Math.Round(i, 3) + "\r\n");
                        metrics.Update();

                    }
                    for (int i = cstart; i <= cend; i = i + cinc)
                    {
                        Language.Text = Language.Text + ("C" + i + "=C" + i + "\r\n");
                        metrics.Update();

                    }

                    xcount = 1;
                    xxcount = 1;
                    ccount = 1;
                    cccount = 1;
                    xstart = 0;
                    xend = 0;
                    xinc = 0;
                    cstart = 0;
                    cend = 0;
                    cinc = 0;
                }
        }


        private void Clear_Click(object sender, EventArgs e)
        {
            Xstart.Text = "";
            Xend.Text = "";
            Xinc.Text = "";
            Cstart.Text = "";
            Cend.Text = "";
            Cinc.Text = "";
            metrics.Text = "";
            Language.Text = "";
            filePath.Text = "";
        }


        private void Form1_Load(object sender, EventArgs e)
        {
          
        }

        private void Help_Click(object sender, EventArgs e)
        {
            metrics.Text = "";
            Language.Text = "";
            metrics.Text = "Created by: Izzy\r\n";
            metrics.Text = metrics.Text + "http://www.flashflashrevolution.com/profile/Izzy/";


            Language.Text = "1) Don't leave any fields blank \r\n";
            Language.Text = Language.Text + ("2) Don't use any letters \r\n");
            Language.Text = Language.Text + ("3) Don't make the incriments bigger then the end value \r\n");
            Language.Text = Language.Text + ("4) It's a good idea to make your values pass through 1x \r\n");
        }

        private void Save_Click(object sender, EventArgs e)
        {
            int screenop = 0;

            xcount = 1;
            xxcount = 1;
            ccount = 1;
            cccount = 1;
            xstart = 0;
            xend = 0;
            xinc = 0;
            cstart = 0;
            cend = 0;
            cinc = 0;

            string num = "0";

            if (filePath.Text == "")
            {
                MessageBox.Show("No directory selected. Please browse for a file.", "Error" ,MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (filePath.Text.Contains("metrics.ini") == false)
            {
                MessageBox.Show("Please select the metrics.ini file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (Xstart.Text == "" || Xend.Text == "" || Xinc.Text == "" || Cstart.Text == "" || Cend.Text == "" || Cinc.Text == "")
            {
                MessageBox.Show("At least one field is empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else
            {
                StreamReader r = new StreamReader(filePath.Text);

                string line = "";
                int lines = 0;
                while ((line = r.ReadLine()) != null)
                {
                    lines++;
                }
                r.Close();

                StreamReader rx = new StreamReader(filePath.Text);

                string[] meh = new string[lines];
                for (int i = 0; i < meh.Length; i++)
                {
                    line = rx.ReadLine();
                    meh[i] = line;
                    
                    if (meh[i] == "# Player options")
                    {
                        num = rx.ReadLine();

                        num = num.Substring(6);
                    }
                }
                rx.Close();

                string beh = "";
                for (int j = 0; j < meh.Length; j++)
                {
                    beh = meh[j];
                    if (meh[j] == "# Player options")
                    {
                        meh[j] = " ";
                    }

                    if (meh[j] == null)
                    {
                    }
                    else if (beh.Contains("SpeedDefault=mod,"))
                    {
                        meh[j] = " ";
                    }
                    if (meh[j] == null)
                    {
                    }
                    else if (beh.Contains("Speed,"))
                    {
                        meh[j] = " ";
                    }
                    if (meh[j] == "[ScreenOptionsMaster]")
                    {
                        screenop++;
                        if (screenop >= 2)
                        {
                            meh[j] = " ";
                        }
                    }

                }
                int blank = 0;
                for (int o = 0; o < meh.Length; o++)
                {
                    if (meh[o] == " ")
                    {
                        blank++;
                    }

                }
                string[] mah = new string[meh.Length - blank];

                int m = 0;
                for (int l = 0; l < meh.Length; l++)
                {
                    if (meh[l] != " ")
                    {
                        mah[m] = meh[l];
                        m++;
                    }

                }
               

                StreamWriter w = File.CreateText(@filePath.Text);
                for (int x = 0; x < mah.Length -1; x++)
                {
                    w.WriteLine(mah[x]);
                }
                w.Close();

                StreamWriter wx = File.AppendText(@filePath.Text);



                xstart = Convert.ToDouble(Xstart.Text);
                xend = Convert.ToDouble(Xend.Text);
                xinc = Convert.ToDouble(Xinc.Text);
                cstart = Convert.ToInt32(Cstart.Text);
                cend = Convert.ToInt32(Cend.Text);
                cinc = Convert.ToInt32(Cinc.Text);

                for (double i = xstart; i <= xend; i = i + xinc)
                {

                    xxcount += 1;
                }


                cccount = xxcount;
                for (int i = cstart; i < cend; i = i + cinc)
                {
                    cccount += 1;
                }

                wx.WriteLine("[ScreenOptionsMaster]");
                wx.WriteLine("# Player options");
                wx.WriteLine("Speed=" + cccount + "");
                wx.WriteLine("SpeedDefault=mod,1x");

                for (double i = xstart; i <= xend; i = i + xinc)
                {
                    wx.WriteLine("Speed," + xcount + "=mod," + System.Math.Round(i, 3) + "x;name,x" + System.Math.Round(i, 3));
                    xcount += 1;
                }

                ccount = xcount;
                for (int i = cstart; i <= cend; i = i + cinc)
                {
                    wx.WriteLine("Speed," + ccount + "=mod," + "C" + i + ";name,C" + i);
                    ccount += 1;
                }
                wx.Close();

            }

        }

        private void openFileDialog1_FileOk(object sender, CancelEventArgs e)
        {

        }

        private void Save2_Click(object sender, EventArgs e)
        {
            xcount = 1;
            xxcount = 1;
            ccount = 1;
            cccount = 1;
            xstart = 0;
            xend = 0;
            xinc = 0;
            cstart = 0;
            cend = 0;
            cinc = 0;


            if (filePath.Text == "")
            {
                MessageBox.Show("No directory selected. Please browse for a file.", "Error" ,MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (filePath.Text.Contains("english.ini") == false)
            {
                MessageBox.Show("Please select the english.ini file.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else if (Xstart.Text == "" || Xend.Text == "" || Xinc.Text == "" || Cstart.Text == "" || Cend.Text == "" || Cinc.Text == "")
            {
                MessageBox.Show("At least one field is empty.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }

            else
            {

                StreamWriter wx = File.AppendText(@filePath.Text);

                wx.WriteLine("[OptionNames]");

                xstart = Convert.ToDouble(Xstart.Text);
                xend = Convert.ToDouble(Xend.Text);
                xinc = Convert.ToDouble(Xinc.Text);
                cstart = Convert.ToInt32(Cstart.Text);
                cend = Convert.ToInt32(Cend.Text);
                cinc = Convert.ToInt32(Cinc.Text);


                for (double i = xstart; i <= xend; i = i + xinc)
                {

                    xxcount += 1;
                }


                cccount = xxcount;
                for (int i = cstart; i < cend; i = i + cinc)
                {
                    cccount += 1;
                }
                for (double i = xstart; i <= xend; i = i + xinc)
                {
                    xcount += 1;
                }
                ccount = xcount;
                for (int i = cstart; i <= cend; i = i + cinc)
                {
                    ccount += 1;
                }

                for (double i = xstart; i <= xend; i = i + xinc)
                {
                    wx.WriteLine("x" + System.Math.Round(i, 3) + "=x" + System.Math.Round(i, 3));

                }
                for (int i = cstart; i <= cend; i = i + cinc)
                {
                    wx.WriteLine("C" + i + "=C" + i);
                }

                wx.Close();


            }

        }

        private void search_Click(object sender, EventArgs e)
        {
            OpenFileDialog F = new OpenFileDialog();
            F.Title = "Search for file";
            F.InitialDirectory = @"C:\Program Files";
            F.Filter = "All files (*.*)|*.*";
            F.FilterIndex = 1;
            F.RestoreDirectory = true;
            if (F.ShowDialog() == DialogResult.OK)
            {
                filePath.Text = F.FileName;
            }
        }


    }
}
Izzy is offline   Reply With Quote
Old 09-21-2009, 01:09 PM   #7
xingyguy
Bagel
FFR Veteran
 
xingyguy's Avatar
 
Join Date: Apr 2008
Location: california
Posts: 266
Default Re: SpeedModGenerator2.5 (autosave function)

Can you make a mac version?
xingyguy is offline   Reply With Quote
Old 09-21-2009, 01:15 PM   #8
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: SpeedModGenerator2.5 (autosave function)

I'm sorry, I have no idea how to program apps. Also I do not own a mac computer.
Izzy is offline   Reply With Quote
Old 09-21-2009, 01:23 PM   #9
i love you
Live a wonderful life~
Retired StaffFFR Simfile AuthorFFR Veteran
 
Join Date: Oct 2006
Posts: 7,313
Default Re: SpeedModGenerator2.5 (autosave function)

Just downloaded this and it seems pretty stable to me. I really love the auto save feature and the browsing button. Good job Izzy, I will definitely start using this.
__________________
===============================
The idea that RDCP 3 may come out in the future is a fun thought to have~
===============================
i love you is offline   Reply With Quote
Old 09-21-2009, 01:30 PM   #10
TheLaughingSpaz
FFR Player
FFR Veteran
 
TheLaughingSpaz's Avatar
 
Join Date: Apr 2006
Posts: 7
Default Re: SpeedModGenerator2.5 (autosave function)

Quote:
Originally Posted by Izzy View Post
I'm sorry, I have no idea how to program apps. Also I do not own a mac computer.
Get Monodevelop, compile against Mono, and distribute that executable to the Mac and Linux people. Mac and Linux people will have to download the latest version of Mono. WinForms support in Mono may or may not be wonky. This is a fairly simple app, so hopefully it'll work.
TheLaughingSpaz is offline   Reply With Quote
Old 09-21-2009, 02:17 PM   #11
leonid
I am leonid
Retired StaffFFR Simfile AuthorFFR Music ProducerD7 Elite KeysmasherFFR Veteran
 
leonid's Avatar
 
Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
Default Re: SpeedModGenerator2.5 (autosave function)

For mac users, I just wrote a Ruby script that generates speedmods.

Download and unzip THIS FILE, open up terminal, go to the folder where speedmodgen.rb is located, and type following command:
Code:
ruby speedmodgen.rb (xmod start) (xmod end) (xmod increment) (cmod start) (cmod end) (cmod increment)

<usage example>
ruby speedmodgen.rb 1 10 0.25 200 800 20

*xmod increment rate should be at least 0.001, and cmod increment rate at least 1

Then the script will generate two files: english and metric
Open up those files, copy the content, and paste onto appropriate location at english.ini and metric.ini.

No fancy GUI or anything, but this script works at least.


Here's the source code.

Code:
if $*.size < 6
	puts "Usage: #$0 Xmod_start Xmod_end Xmod_increment Cmod_start Cmod_end Cmod_increment"
	exit
end

xstart, xend, xinc, cstart, cend, cinc = $*.map{|i|i.to_f}

if xinc < 0.001
	puts "Xmod increment rate should be at least 0.001"
	exit
end	

if cinc < 1
	puts "Cmod increment rate should be at least 1"
	exit
end

xnum = [((xend-xstart)/xinc).to_i + 1, 0].max
cnum = [((cend-cstart)/cinc).to_i + 1, 0].max
xmod = xstart
cmod = cstart

met = File.open("metric","w")
eng = File.open("english","w")

met.puts"[ScreenOptionsMaster]"
met.puts"# Player options"
met.puts"Speed=#{xnum+cnum}"
met.puts"SpeedDefault=mod,1x"

eng.puts"[OptionNames]"
eng.puts"# Menu option entry text"

1.upto(xnum) do |i|
	mline="Speed,%d=mod,%.3fx;name,x%.3f"%[i,xmod,xmod]
	eline="x%.3f=x%.3f"%[xmod,xmod]
	met.puts mline.gsub /\.?0+(x|$)/,'\1'
	eng.puts eline.gsub /\.?0+(=|$)/,'\1'
	xmod += xinc
end
1.upto(cnum) do |i|
	met.puts"Speed,%d=mod,C%d;name,C%d"%[i+xnum,cmod,cmod]
	eng.puts"C%d=C%d"%[cmod,cmod]
	cmod += cinc
end



If you are windows user, just use Izzy's program since it's much more convenient to use than this one.
__________________



Proud member of Team No

Last edited by leonid; 09-21-2009 at 02:44 PM..
leonid is offline   Reply With Quote
Old 09-21-2009, 04:26 PM   #12
jugglinguy
Use me as a porta-potty
FFR Veteran
 
jugglinguy's Avatar
 
Join Date: Dec 2006
Age: 30
Posts: 4,319
Default Re: SpeedModGenerator2.5 (autosave function)

Or if you're on mac, you could always: http://splashbeats.com/

No autosave but :P
__________________
Quote:
Originally Posted by Jem
Jem is my name. No one else is the same!

You're Aja Leith of the Holograms! You're very exotic, intelligent and sophisticated.
jugglinguy is offline   Reply With Quote
Old 09-21-2009, 04:49 PM   #13
Magic_V2
RobMagic
FFR Veteran
 
Magic_V2's Avatar
 
Join Date: Jun 2006
Location: Las Vegas
Age: 36
Posts: 638
Send a message via MSN to Magic_V2
Default Re: SpeedModGenerator2.5 (autosave function)

Good job Izzy I'm sure many people will want this.
__________________

Magic_V2 is offline   Reply With Quote
Old 09-21-2009, 05:41 PM   #14
leonid
I am leonid
Retired StaffFFR Simfile AuthorFFR Music ProducerD7 Elite KeysmasherFFR Veteran
 
leonid's Avatar
 
Join Date: Oct 2008
Location: MOUNTAIN VIEW
Age: 35
Posts: 8,080
Default Re: SpeedModGenerator2.5 (autosave function)

Quote:
Originally Posted by jugglinguy View Post
Or if you're on mac, you could always: http://splashbeats.com/

No autosave but :P
Damn I'd just use that one
Why did I write ruby script lmao
__________________



Proud member of Team No
leonid is offline   Reply With Quote
Old 09-21-2009, 05:42 PM   #15
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: SpeedModGenerator2.5 (autosave function)

Nice one. =)
Izzy is offline   Reply With Quote
Old 09-21-2009, 06:37 PM   #16
MSN Guy
Banned
 
Join Date: Sep 2009
Posts: 41
Default Re: SpeedModGenerator2.5 (autosave function)

Quote:
Originally Posted by leonid View Post
Damn I'd just use that one
Why did I write ruby script lmao
MSN Guy is offline   Reply With Quote
Old 09-22-2009, 01:25 PM   #17
john_reactor
FFR Player
 
Join Date: Sep 2004
Posts: 4
Default Re: SpeedModGenerator2.5 (autosave function)

Unfortunately this program crushes under my system.
It returns error: "Application wasn`t initialized properly (0xc0000135)"
Does it work under winXP ?
john_reactor is offline   Reply With Quote
Old 09-22-2009, 01:31 PM   #18
Izzy
Snek
FFR Simfile AuthorFFR Veteran
 
Izzy's Avatar
 
Join Date: Jan 2003
Location: Kansas
Age: 34
Posts: 9,192
Default Re: SpeedModGenerator2.5 (autosave function)

If you have updated windows it should. Windows XP by itself probably doesn't have the newest .netframework without updating. I tried making it work with .netframework 2.0 but I started having issues. It might have been unrelated so I could try again later.

Edit:

http://www.flashflashrevolution.com/...p?songid=39261

Reuploaded it. I switched it to be compatible with .netframework 2.0 and removed all using system statements that it didn't use. Should work on unupdated windows xp now.

Last edited by Izzy; 09-22-2009 at 02:03 PM..
Izzy is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 03:05 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution