DrBernhard Posted November 23, 2008 Share Posted November 23, 2008 Last update: 2008/12/02 Source code (checkout via SVN): http://code.google.com/p/fm2009scoutframework/ Sample application (including assemblies): http://www.100procentjan.nl/fm2009/FMScoutFrameworkSample.zip Assemblies only: http://www.100procentjan.nl/fm2009/FrameworkAssemblies.zip ---------------------------------------------------------------------------------------------------------- Ever wanted to build your own FMScout, FMRTE? Ever wanted to do crazy stuff to the ingame database, but no button in FMEditor which provided the function? Now you can build everything you want on your own! Today, the very first version of the FM 2009 Scout/Editor Framework is released! A ready-to-use assembly, which can be included in any .Net project (both Visual Basic and C#). The Framework gives you the ability to query the database using LinQ, make changes to the game's objects, and produce your own personalized editor! Main features * Query the ingame database * Find players, clubs, staff, cities, continents, stadiums, teams, etc. * Make realtime changes to the database * Create complex filters * Get the active player, and show his stats immediately * Perform batch operations on a whole bunch of players * Open source! Wanted to get started First of all, if you just want to get started, grab the SampleApplication from SVN or use the direct download link (above), open the (C#) project in VS2008, and hit the compile button. If you want a little tutorial, click http://www.100procentjan.nl/fm2009/tutorial.htm Feel free to contribute Just join on Google Code, make cool additions to the framework (or solve some issues ;-)) and check your code back in! Donations? Please don't! Buy yourself a beer! -------------- Last changes: * Contract works as it's supposed to be * Co-Contract and Loan-contract supported * Added happiness and squad number (under Contract) * Shortlist export in Interface.Common * PositionalSkills.ToString() for directly seeing the pos. skills as a string value * Added WSM as supported process, might help some steam WSM users * Non-playing staff bug, shows now all the np staff in the game Link to post Share on other sites More sharing options...
polkkiju Posted November 23, 2008 Share Posted November 23, 2008 this is for you very appreciate for "open source" stuff from such guys will be nice if somebody will do open source game like FM Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 Just looked through the stuff don't really understand how it all works all I want to do is have my aberdeen squads CA's and PA's Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 It is a framework for developers, not to be used by end users. Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 It is a framework for developers, not to be used by end users. Im not totally inexperienced btw Im just not sure how the whole framework works as I never used a Microsoft Visual Dev suite before (Y) Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 Im not totally inexperienced btw Im just not sure how the whole framework works as I never used a Microsoft Visual Dev suite before (Y) Fire up Visual Studio, Add references to the project (as shown in the tutorial), and create a FMDataContext object. Add a DataGridView to your form, and a button, doubleclick the button, and add the following code: DataGridView1.AutoGenerateColumns = true; Club club = fmDataContext.Clubs.Single(c=>c.Name=="Your club name"); DataGridView1.DataSource = (from p in fmDataContext.Players where p.Team != null && p.Team.Club == club select new { Name = p.FirstName + " " + p.LastName, CA = p.CurrentPlayingAbility, PA = p.PotentialPlayingAbility }).ToList(); The grid will now populate with all your players, including columns for their CA and PA. Link to post Share on other sites More sharing options...
Scoham Posted November 23, 2008 Share Posted November 23, 2008 Anyone want to have a go at creating a player skin and hair colour editor, since its not yet possible with the official editor. Link to post Share on other sites More sharing options...
bonsai Posted November 23, 2008 Share Posted November 23, 2008 Great Stuff. I just did a very quick test and it works fine (and it was the first .NET project I ever created ) Link to post Share on other sites More sharing options...
Aldart Posted November 23, 2008 Share Posted November 23, 2008 Wow, this is exactly what I've been dreaming of all those years.. Going to start playing with this right now. Link to post Share on other sites More sharing options...
Broode Posted November 23, 2008 Share Posted November 23, 2008 Does it work in Visual Basic 6 ? Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 Does it work in Visual Basic 6 ? Not by default, although you can compile the assemblies to be available through COM, will be some work though. Just google for '.net assemblies visual basic 6'. Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 Urgh im sure im following everything but it just refuses to work Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 Using Visual Studio 2008? What is the message of the compiler? Can you run the SampleApp when you download it? Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 Using Visual Studio 2008? What is the message of the compiler?Can you run the SampleApp when you download it? I am using 2008. The Compiler says there is an error but im none the wiser on how to fix it and yes the sample app does run. Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 Have you added the 'using...' statements, as stated in the top of the tutorial document. Can you post the compiler errors, that'd give way more insight. Link to post Share on other sites More sharing options...
Cin-cout Posted November 23, 2008 Share Posted November 23, 2008 I cant get this to work for some reason... Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 Have you added the 'using...' statements, as stated in the top of the tutorial document. Can you post the compiler errors, that'd give way more insight. Yes I have . Error 1 Type or namespace definition, or end-of-file expected C:\Users\--\Desktop\FM\Form1.cs 42 1 SampleApplication Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 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 Young3.FMSearch.Interface; using Young3.FMSearch.Business.Entities.InGame; using System.Reflection; namespace SampleApplication { public partial class MainForm : Form { public FMDataContext fmDataContext; public MainForm() { InitializeComponent(); } private void MainForm_Load(object sender, EventArgs e) { fmDataContext = new FMDataContext(); { this.ClubsComboBox.DataSource = fmDataContext.Clubs.OrderBy(c => c.Name).ToList(); } } private void button1_Click(object sender, EventArgs e) { DataGridView1.AutoGenerateColumns = true; Club club = fmDataContext.Clubs.Single(c=>c.Name=="Aberdeen"); DataGridView1.DataSource = (from p in fmDataContext.Players where p.Team != null && p.Team.Club == club select new { Name = p.FirstName + " " + p.LastName, CA = p.CurrentPlayingAbility, PA = p.PotentialPlayingAbility }).ToList(); } } } } Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 You need to delete one } on your last line. Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 Error 1 'SampleApplication.MainForm' does not contain a definition for 'ClubsComboBox' and no extension method 'ClubsComboBox' accepting a first argument of type 'SampleApplication.MainForm' could be found (are you missing a using directive or an assembly reference?) C:\Users\****\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs 28 22 WindowsFormsApplication1 Error 2 The name 'DataGridView1' does not exist in the current context C:\Users\****\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs 34 13 WindowsFormsApplication1 Error 3 The name 'DataGridView1' does not exist in the current context C:\Users\****\AppData\Local\Temporary Projects\WindowsFormsApplication1\Form1.cs 36 13 WindowsFormsApplication1 Error 4 The type or namespace name 'Form1' could not be found (are you missing a using directive or an assembly reference?) C:\Users\****\AppData\Local\Temporary Projects\WindowsFormsApplication1\Program.cs 18 33 WindowsFormsApplication1 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 Young3.FMSearch.Interface; using Young3.FMSearch.Business.Entities.InGame; using System.Reflection; namespace SampleApplication { public partial class MainForm : Form { public FMDataContext fmDataContext; public MainForm() { InitializeComponent(); } private void MainForm_Load(object sender, EventArgs e) { fmDataContext = new FMDataContext(); { this.ClubsComboBox.DataSource = fmDataContext.Clubs.OrderBy(c => c.Name).ToList(); } } private void button1_Click(object sender, EventArgs e) { DataGridView1.AutoGenerateColumns = true; Club club = fmDataContext.Clubs.Single(c => c.Name == "Aberdeen"); DataGridView1.DataSource = (from p in fmDataContext.Players where p.Team != null && p.Team.Club == club select new { Name = p.FirstName + " " + p.LastName, CA = p.CurrentPlayingAbility, PA = p.PotentialPlayingAbility }).ToList(); } } } Im sorry for the trouble and I am very grateful for your help I am able to make an application look fairly nice but getting it to work is the problem Link to post Share on other sites More sharing options...
DrBernhard Posted November 23, 2008 Author Share Posted November 23, 2008 You have to delete the following code: this.ClubsComboBox.DataSource = fmDataContext.Clubs.OrderBy(c => c.Name).ToList(); Then you have to add a DataGridView to your form (in Design View), with the name 'DataGridView1'. If this doesn't work, rename 'public partial class MainForm' to 'public partial class Form1'. If this still doesn't work, please ZIP your complete folder, and upload it, so I can have a look. Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 PM'd you the link with the zipped up folder of the project thank you again Link to post Share on other sites More sharing options...
DJLM82 Posted November 23, 2008 Share Posted November 23, 2008 Which visual studio version do I need? Link to post Share on other sites More sharing options...
megafan2005 Posted November 23, 2008 Share Posted November 23, 2008 Which visual studio version do I need? Microsoft Visual C# 2008 Link to post Share on other sites More sharing options...
DJLM82 Posted November 24, 2008 Share Posted November 24, 2008 Microsoft Visual C# 2008 Is Visual Studio 2008 express ok, or has to be the real deal? Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 VS 2008 Express is good enough for creating your own app using the framework. For editing the framework VS Professional is required. Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Microsoft Visual C# 2008 Actually, any version will do. Also VB.Net and Managed C++. Link to post Share on other sites More sharing options...
matt4ani Posted November 24, 2008 Share Posted November 24, 2008 This is superb. You are a true legend. Link to post Share on other sites More sharing options...
goldorakiller Posted November 24, 2008 Share Posted November 24, 2008 You are a "MASTER" DrBernard !!! Can this work with savegame or adapted for it ? Link to post Share on other sites More sharing options...
markec123 Posted November 24, 2008 Share Posted November 24, 2008 This is actually a tool for creating FM Scout or editor? Has anyone make something yet? He could upload it. I don't know how to do that stuff. Link to post Share on other sites More sharing options...
RodrigoL Posted November 24, 2008 Share Posted November 24, 2008 Good job! i'll take it to do my own scout Link to post Share on other sites More sharing options...
neevesc Posted November 24, 2008 Share Posted November 24, 2008 Excellant work. I'll have a look this evening:thup: Link to post Share on other sites More sharing options...
Cin-cout Posted November 24, 2008 Share Posted November 24, 2008 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Reflection; using System.Windows.Forms; using Young3.FMSearch.Interface; using Young3.FMSearch.Business.Entities.InGame; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public FMDataContext fmDataContext; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { fmDataContext = new FMDataContext(); } private void button1_Click(object sender, EventArgs e) { foreach (Player player in fmDataContext.Players) { if (player.PotentialPlayingAbility >= 190) listBox1.Items.Add(player.ToString()); } } } } Whenever I run this and press the button, it gives an error saying "Object reference not set to an instance of an object." fmDataContext is null, any help would be appreciated. Link to post Share on other sites More sharing options...
deep_dave Posted November 24, 2008 Share Posted November 24, 2008 If you get errors, please say which line the error was on. This will make it easier for us all. Link to post Share on other sites More sharing options...
Cin-cout Posted November 24, 2008 Share Posted November 24, 2008 foreach (Player player in fmDataContext.Players) this line was giving the error, NullReferenceException was unhandled - Object reference was not set to an instance of an object Link to post Share on other sites More sharing options...
Y.C.H Posted November 24, 2008 Share Posted November 24, 2008 When I'm using a LINQ with Player.Age with criteria, it will flow an exception var PlayerCollection = from p in GlobalVar.FMDataContext.Players.AsEnumerable() where p.Age >= 18 && p.Age <= 24 and ................... select p; Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 foreach (Player player in fmDataContext.Players) this line was giving the error, NullReferenceException was unhandled - Object reference was not set to an instance of an object Can you verify that: - FM2009 is running - That you have version 9.01 - That your process is called fm - That your code reaches the fmDataContext = new FMDataContext(); When I'm using a LINQ with Player.Age with criteria, it will flow an exception var PlayerCollection = from p in GlobalVar.FMDataContext.Players.AsEnumerable() where p.Age >= 18 && p.Age <= 24 and ................... select p; Was a bug in the datetime parsing, have fixed it, new assembly available through SVN or via the Sample Application download link. Link to post Share on other sites More sharing options...
Cin-cout Posted November 24, 2008 Share Posted November 24, 2008 FM2009 is running, version is 9.01 and the process is fm.exe, I assumed the code was reaching that point to give the error. Would I be best validating it with if (fmDataContext != null) { } or something? Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 PM'd you the link with the zipped up folder of the project thank you again Open your project in Visual C# 2008, click once on the form, and go in the right properties screen to the icon showed below, go to 'Load' and select 'MainForm_Load': Then click on the 'Aberdeen' button, choose 'Click' and select 'button1_click': Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 FM2009 is running, version is 9.01 and the process is fm.exe, I assumed the code was reaching that point to give the error.Would I be best validating it with if (fmDataContext != null) { } or something? Well, if your application reaches your form_load then everything is fine, and there won't be any check necessary. Do you also have problems running the SampleApplication ? Link to post Share on other sites More sharing options...
Cin-cout Posted November 24, 2008 Share Posted November 24, 2008 yes to be honest, it wasnt working, it didnt load anything when I pressed any of the buttons. Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Do you have Visual Studio Professional available? Then you can debug through the load process, to see what's going on (in the framework sourcecode). Link to post Share on other sites More sharing options...
megafan2005 Posted November 24, 2008 Share Posted November 24, 2008 Ive tried the club name as well as the ID im so close and so grateful for your help. If/After I get this working I will touch it up graphically and release it with full credits to you of course. Link to post Share on other sites More sharing options...
Cin-cout Posted November 24, 2008 Share Posted November 24, 2008 Do you have Visual Studio Professional available? Then you can debug through the load process, to see what's going on (in the framework sourcecode). Yes I have that available, I'll have a look at it when I get home from work. Thanks Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Ive tried the club name as well as the ID im so close and so grateful for your help. If/After I get this working I will touch it up graphically and release it with full credits to you of course. You need to have the complete full name of the club, or you can try something like this if you are for example looking for 'AGOVV Apeldoorn': fmDataContext.Clubs.Single(c=>c.Name.ToLower().StartsWith("agovv")); Link to post Share on other sites More sharing options...
megafan2005 Posted November 24, 2008 Share Posted November 24, 2008 You need to have the complete full name of the club, or you can try something like this if you are for example looking for 'AGOVV Apeldoorn':fmDataContext.Clubs.Single(c=>c.Name.ToLower().StartsWith("agovv")); Just wont work same error. Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Just wont work same error. Can you throw me your code once again? Link to post Share on other sites More sharing options...
megafan2005 Posted November 24, 2008 Share Posted November 24, 2008 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 Young3.FMSearch.Interface; using Young3.FMSearch.Business.Entities.InGame; using System.Reflection; namespace SampleApplication { public partial class Form1 : Form { public FMDataContext fmDataContext; public Form1() { InitializeComponent(); } private void MainForm_Load(object sender, EventArgs e) { fmDataContext = new FMDataContext(); { } } private void button1_Click(object sender, EventArgs e) { dataGridView1.AutoGenerateColumns = true; Club club = fmDataContext.Clubs.Single(c=>c.Name.ToLower().StartsWith("Aberdeen")); dataGridView1.DataSource = (from p in fmDataContext.Players where p.Team != null && p.Team.Club == club select new { Name = p.FirstName + " " + p.LastName, CA = p.CurrentPlayingAbility, PA = p.PotentialPlayingAbility }).ToList(); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } } } Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Make it 'aberdeen' instead of 'Aberdeen'. Link to post Share on other sites More sharing options...
Cin-cout Posted November 24, 2008 Share Posted November 24, 2008 got mine to work, thanks for the help DrBernard. The framework is brilliant. Link to post Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.