Unnamed Project.

For online players and cars makers

User avatar
HummersRock
MM2X Super Active User
MM2X Super Active User
Posts: 2152
Registered for: 17 years 5 months
Location: Floating in The Land of Colours
Contact:

Postby HummersRock » Fri Mar 20, 2009 8:41 pm

I have just used Visual Basics 2008 Express Edition. I also have Visual Basics 6 hidden somewhere in my house.

I have it almost all finished except for getting it to put in all the data for the files. I've had a little trouble with that and I'm not sure how to get it to put the correct basename into the .info file.
[url=https://bit.ly/znpgtp][color=deepskyblue]My MM2 Creations[/color][/url] | [url=https://bit.ly/o9c3][color=red]My MM2 Youtube[/color][/url] | [url=https://bit.ly/yfqjeq][color=green]My DeviantArt[/color][/url]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Fri Mar 20, 2009 9:13 pm

In which language VB.NET or VB6?
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
HummersRock
MM2X Super Active User
MM2X Super Active User
Posts: 2152
Registered for: 17 years 5 months
Location: Floating in The Land of Colours
Contact:

Postby HummersRock » Fri Mar 20, 2009 9:14 pm

VB6.
[url=https://bit.ly/znpgtp][color=deepskyblue]My MM2 Creations[/color][/url] | [url=https://bit.ly/o9c3][color=red]My MM2 Youtube[/color][/url] | [url=https://bit.ly/yfqjeq][color=green]My DeviantArt[/color][/url]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Fri Mar 20, 2009 9:23 pm

Okay there are 2 ways of doing this.

1. The quick & easy way.
This basically involves reading the first line of the *.info file, and splitting the string using a function.

2. The fool-proof method.
The first method COULD easily fail, if the person puts the basename on the second line.

Which way would you like to do it? Lemme know, and I'll help you with the code.

Edit: Do you need to read the current basename? Or just write? Or both?

If you only need to write, you just use a reference to M$'s scripting runtime and use a Filesystemobject.

To admin personnnel; The Seat Leon Turbo NOS appears to link a Humvee download. See link.
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
HummersRock
MM2X Super Active User
MM2X Super Active User
Posts: 2152
Registered for: 17 years 5 months
Location: Floating in The Land of Colours
Contact:

Postby HummersRock » Fri Mar 20, 2009 10:38 pm

Well I could have coded it very poorly, it could have way more code then it needs, etc. But here is all the code:

Code: Select all

Public Class baseForm Private Sub createButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles createButton.Click Dim BaseName As String = nameTextBox.Text Dim Opponent As String = BaseName & "\aud\cardata\opponent\" & BaseName & ".csv" Dim Player As String = BaseName & "\aud\cardata\player\" & BaseName & ".csv" Dim InfoFile As String = BaseName & "\tune\" & BaseName & ".info" Dim AsNode1File As String = BaseName & "\tune\" & BaseName & ".asnode" Dim AsNode2File As String = BaseName & "\tune\" & BaseName & "_dash.asnode" Dim mmMirror As String = BaseName & "\tune\" & BaseName & ".mmMirror" Dim DgBangerData1 As String = BaseName & "\tune\banger\" & BaseName & "_BREAK01.dgbangerdata" Dim DgBangerData3 As String = BaseName & "\tune\banger\" & BaseName & "_BREAK03.dgbangerdata" Dim DgBangerData23 As String = BaseName & "\tune\banger\" & BaseName & "_BREAK23.dgbangerdata" Dim HeadLight0 As String = BaseName & "\tune\banger\" & BaseName & "_HEADLIGHT0.dgbangerdata" Dim HeadLight1 As String = BaseName & "\tune\banger\" & BaseName & "_HEADLIGHT1.dgbangerdata" Dim Wheel0 As String = BaseName & "\tune\banger\" & BaseName & "_WHL0.dgbangerdata" Dim Wheel1 As String = BaseName & "\tune\banger\" & BaseName & "_WHL1.dgbangerdata" Dim Wheel2 As String = BaseName & "\tune\banger\" & BaseName & "_WHL2.dgbangerdata" Dim Wheel3 As String = BaseName & "\tune\banger\" & BaseName & "_WHL3.dgbangerdata" Dim CamPovCS As String = BaseName & "\tune\camera\" & BaseName & ".camPovCS" Dim CamPovCS2 As String = BaseName & "\tune\camera\" & BaseName & "_dash.camPovCS" Dim CamTrackCS As String = BaseName & "\tune\camera\" & BaseName & "_far.camTrackCS" Dim CamTrackCS2 As String = BaseName & "\tune\camera\" & BaseName & "_near.camTrackCS" Dim VehCarSim As String = BaseName & "\tune\vehicle\" & BaseName & ".vehcarsim" Dim VehCarSim2 As String = BaseName & "\tune\vehicle\" & BaseName & "_opp.vehcarsim" Dim VehCarDamage As String = BaseName & "\tune\vehicle\" & BaseName & ".vehCarDamage" Dim VehGyro As String = BaseName & "\tune\vehicle\" & BaseName & ".vehGyro" Dim VehStuck As String = BaseName & "\tune\vehicle\" & BaseName & ".vehStuck" Dim FileCreator As IO.TextWriter = Nothing Dim OpponentContents As String = "Horn wave name,Horn volume,flags,Num Engine Samples,clutch wave name,clutch volume,,,,," & ControlChars.NewLine & "RACECARHORN,0.95,0,2,REVERSE,0.93,,,,," & ControlChars.NewLine & "Engine wave name,Min Volume,Max Volume,fade in start RPM,fade in end RPM,fade out start RPM,fade out end RPM,Min Pitch,Max Pitch,Pitch shift start RPM,Pitch shift end RPM" & ControlChars.NewLine & "RACECARDRIVE,0.82,0.9212,500,3500,9000,12500,0.55,4.5,500,40000" Dim PlayerContents As String = "" Dim InfoFileContents As String = "" Dim AsNode1FileContents As String = "" Dim AsNode2FileContents As String = "" Dim mmMirrorContents As String = "" Dim DgBangerData1Contents As String = "" Dim DgBangerData3Contents As String = "" Dim DgBangerData23Contents As String = "" Dim HeadLight0Contents As String = "" Dim HeadLight1Contents As String = "" Dim Wheel0Contents As String = "" Dim Wheel1Contents As String = "" Dim Wheel2Contents As String = "" Dim Wheel3Contents As String = "" Dim CamPovCSContents As String = "" Dim CamPovCS2Contents As String = "" Dim CamTrackCSContents As String = "" Dim CamTrackCS2Contents As String = "" Dim VehCarSimContents As String = "" Dim VehCarSim2Contents As String = "" Dim VehCarDamageContents As String = "" Dim VehGyroContents As String = "" Dim VehStuckContents As String = "" My.Computer.FileSystem.CreateDirectory("" & BaseName & "\aud" & "\cardata" & "\player") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\aud\cardata\opponent") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\bound") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\geometry") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\jpg") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\texture") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\tune" & "\banger") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\tune\camera") My.Computer.FileSystem.CreateDirectory("" & BaseName & "\tune\vehicle") Try FileCreator = IO.File.AppendText(Opponent) FileCreator = IO.File.AppendText(Player) FileCreator = IO.File.AppendText(InfoFile) FileCreator = IO.File.AppendText(AsNode1File) FileCreator = IO.File.AppendText(AsNode2File) FileCreator = IO.File.AppendText(mmMirror) FileCreator = IO.File.AppendText(DgBangerData1) FileCreator = IO.File.AppendText(DgBangerData3) FileCreator = IO.File.AppendText(DgBangerData23) FileCreator = IO.File.AppendText(HeadLight0) FileCreator = IO.File.AppendText(HeadLight1) FileCreator = IO.File.AppendText(Wheel0) FileCreator = IO.File.AppendText(Wheel1) FileCreator = IO.File.AppendText(Wheel2) FileCreator = IO.File.AppendText(Wheel3) FileCreator = IO.File.AppendText(CamPovCS) FileCreator = IO.File.AppendText(CamPovCS2) FileCreator = IO.File.AppendText(CamTrackCS) FileCreator = IO.File.AppendText(CamTrackCS2) FileCreator = IO.File.AppendText(VehCarSim) FileCreator = IO.File.AppendText(VehCarSim2) FileCreator = IO.File.AppendText(VehCarDamage) FileCreator = IO.File.AppendText(VehGyro) FileCreator = IO.File.AppendText(VehStuck) FileCreator.Write(OpponentContents) MessageBox.Show("The files have been created. You will have to rename the basename in the info file that is contained in the tune folder.") Finally If FileCreator IsNot Nothing Then FileCreator.Dispose() End Try End Sub
[url=https://bit.ly/znpgtp][color=deepskyblue]My MM2 Creations[/color][/url] | [url=https://bit.ly/o9c3][color=red]My MM2 Youtube[/color][/url] | [url=https://bit.ly/yfqjeq][color=green]My DeviantArt[/color][/url]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Fri Mar 20, 2009 10:49 pm

You've decided to convert your project to VB.NET?

My suggestion would've been to have a data folder in your app path with the files created beforehand, and then just copy the whole folder over, and rename all the files, and creating a new basename.info file in the process, just before, it'd be easier in my opinion.

I'd also like to point out the number of new strings you've used - or rather not. It'd make more sense to dim one string, and re-use it as needed, it'll be easier on the system's memory - speeding up the whole process.

You shouldn't use things like;

Code: Select all

"\tune" & "\camera"
It'd make more sense to use;

Code: Select all

"\tune\camera"
I'll code you a sample of how I'd do it - using VB6, and then you can take it from there if you'd like?

I'd personally, hardcode all the folders to be created, but load the files to be copied or created from a filelist (into a hidden listbox) - created from working templates and then modify and/or rename them. That way you can modify the filelist without having to make changes to your application - gotta think ahead. ;)
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
HummersRock
MM2X Super Active User
MM2X Super Active User
Posts: 2152
Registered for: 17 years 5 months
Location: Floating in The Land of Colours
Contact:

Postby HummersRock » Fri Mar 20, 2009 11:23 pm

You've decided to convert your project to VB.NET?
My bad, it was VB.NET to start with.
My suggestion would've been to have a data folder in your app path with the files created beforehand, and then just copy the whole folder over, and rename all the files, and creating a new basename.info file in the process, just before, it'd be easier in my opinion.
Yes it would be easier, but I though that it might be nicer, for the user, if there was just one EXE file to do it all and nothing else needed.
You shouldn't use things like;

Code: Select all

"\tune" & "\camera"
It'd make more sense to use;

Code: Select all

"\tune\camera"
Yeah but for some reason I think I needed to do that. I had a hard time getting it to create all of the sub folders in the correct places.
[url=https://bit.ly/znpgtp][color=deepskyblue]My MM2 Creations[/color][/url] | [url=https://bit.ly/o9c3][color=red]My MM2 Youtube[/color][/url] | [url=https://bit.ly/yfqjeq][color=green]My DeviantArt[/color][/url]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Fri Mar 20, 2009 11:28 pm

Ahaha, okay. Well I'll code you a sample, using the code you've given me, okay?
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
HummersRock
MM2X Super Active User
MM2X Super Active User
Posts: 2152
Registered for: 17 years 5 months
Location: Floating in The Land of Colours
Contact:

Postby HummersRock » Fri Mar 20, 2009 11:50 pm

That would be great.
[url=https://bit.ly/znpgtp][color=deepskyblue]My MM2 Creations[/color][/url] | [url=https://bit.ly/o9c3][color=red]My MM2 Youtube[/color][/url] | [url=https://bit.ly/yfqjeq][color=green]My DeviantArt[/color][/url]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Sat Mar 21, 2009 12:16 am

[Previous snipped removed due to overlap in code]

Edit; The following code will load up a file list & create the blank files as needed from test.lst.

Code: Select all

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click '########## CHECK IF NAME IS VALID. If nameTextBox.Text = "" Then MsgBox("Error, enter a name!", MsgBoxStyle.Critical) Exit Sub End If '########## LOAD FILELIST lstFiles.Items.Clear() lstFiles.Items.AddRange(Split(My.Computer.FileSystem.ReadAllText(Application.StartupPath & "\test.lst"), vbNewLine)) '########## MAKE FOLDERS Dim Loc As String Loc = Application.StartupPath & "\" & nameTextBox.Text & "\" With My.Computer.FileSystem .CreateDirectory(Loc & "aud\cardata\player\") .CreateDirectory(Loc & "aud\cardata\opponent\") .CreateDirectory(Loc & "bound") .CreateDirectory(Loc & "geometry") .CreateDirectory(Loc & "jpg") .CreateDirectory(Loc & "texture") .CreateDirectory(Loc & "tune\banger") .CreateDirectory(Loc & "tune\camera") .CreateDirectory(Loc & "tune\vehicle") End With '########## MAKE FILES FROM LSTFILES For i = 0 To lstFiles.Items.Count - 1 Dim AzFile As String = lstFiles.Items.Item(i).ToString With AzFile AzFile = .ToLower() AzFile = .Replace("$basename", nameTextBox.Text) End With Dim NewFile As New IO.StreamWriter(Application.StartupPath & "\" & nameTextBox.Text & "\" & AzFile) NewFile.Write("") NewFile.Close() Next '########## ENTER INFO FILE Dim InfoF As String = ("" & nameTextBox.Text & "\tune\" & nameTextBox.Text & ".info") Dim TargetFile As IO.StreamWriter Try TargetFile = New IO.StreamWriter(InfoF, True) Catch MessageBox.Show("Error opening " & InfoF) End Try Try With TargetFile .Write("basename=" & nameTextBox.Text) .WriteLine("description=Your vehicle name") .WriteLine("colors=colour1|colour2|etc") .Close() End With Catch MessageBox.Show("Error writing file") End Try '########## OPEN FILES Process.Start(Application.StartupPath & "\" & nameTextBox.Text) End Sub
test.lst - goes in your appdir.

Code: Select all

aud\cardata\player\$basename.csv aud\cardata\opponent\$basename.csv $basename.hat $basename.dog $basename.cow
You will need a button named button1, a listbox named lstfiles and a textbox named nametextbox - you should use more appropriate control names such as tName or txtName, nametextbox is stupidly long to type out everytime. I'd be grateful for any credit if anyone uses this. ;)
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Mon Mar 23, 2009 4:13 am

Finished databasing MM2X! I estimated the file count at around ~580 . MM2X had 536 vehicles, mods & maps (correct at the time of starting), excluding my 30 or so private and/or personal files, brings the total to 566, and then some archives, I obviously expected to cotain more than 1 file, but some downloads like Classic Madness & Midtown Madness Overhauled, contained about 10-20 files a piece, thus pushing the file count easily over 600. And it'd explain why they have multiple entires in the filelist - I'd also like to point out that no two files, referenced in the database, are the same - even if the names are.
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Mon Mar 30, 2009 8:05 pm

Testers wanted. I've been quite busy lately. MM2ST still needs a bit of polish, but it works. I also have another project that I'd like someone to test (file locker) - you will need...

Microsoft's .NET Framework
I use 3.5, but I believe 2.0 or higher should work. It will not work with Microsoft's .NET Compact Framework.
Link; .Net Framework 3.5

Stuff to lock
it'd help if you had files to lock, but don't worry if you don't, I can provide some test files. Or some public add-ons if you're testing MM2ST.

Midtown Madness 2
Quite important. But not essential.

Basic Computer Competence
A little computing know-how. Also, knowing about sending e-mails and taking screenshots would be helpful. Some form of messenger would also be handy - not essential however, but I most often use MSN (AZXIRSTV@MSN.com) - I have AIM (az5135) and Yahoo (az5135/fuzzydogslayer) too.

Good English
Obviously I'll be needing your feedback, suggestions and whatever else you may have to say. Testers will be credited in the application, and will get to have your say about development.
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
Franch88
MM2X Admin
MM2X Admin
Posts: 15758
Registered for: 16 years 11 months
Location: Italy
Been thanked: 1 time
Contact:
Italy

Postby Franch88 » Mon Mar 30, 2009 8:25 pm

I could offer to test your project, but maybe I won't give a complete feedback. :roll:
Fiat 500 = Italian motorization. Franch88, MM2 eXtreme forum and website Administrator.
|Franch88's MM2 Releases|

User avatar
Azbestos8
MM2X Occasional User
MM2X Occasional User
Posts: 310
Registered for: 15 years 11 months
Location: England
Contact:

Postby Azbestos8 » Mon Mar 30, 2009 8:29 pm

It doesn't have to be complete, providing as long as it's detailed and gives me information about the major flaws & problems - if any.
[img]https://img84.imageshack.us/img84/7341/websitebasicpsd.jpg[/img]
[img]https://img684.imageshack.us/img684/8926/smashupazsig2.jpg[/img]

User avatar
dageek
MM2X Very Active User
MM2X Very Active User
Posts: 1205
Registered for: 15 years 8 months
Location: United States
Contact:

Postby dageek » Tue Mar 31, 2009 3:51 am

Oh..
can I test?
[url=https://www.dageek.webs.com][img]https://i945.photobucket.com/albums/ad294/photobukcet_dageek/Avatars/LamboSig.jpg[/img][/url]