megafan2005 Posted November 24, 2008 Share Posted November 24, 2008 Make it 'aberdeen' instead of 'Aberdeen'. aberdeen still doesnt work Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Club club = fmDataContext.Clubs.Single(c=>c.Name == "Aberdeen"); and Club club = fmDataContext.Clubs.Single(c=>c.ID == 1536); Should both work. Link to post Share on other sites More sharing options...
megafan2005 Posted November 24, 2008 Share Posted November 24, 2008 Club club = fmDataContext.Clubs.Single(c=>c.Name == "Aberdeen");and Club club = fmDataContext.Clubs.Single(c=>c.ID == 1536); Should both work. this is infuriating still wont work Link to post Share on other sites More sharing options...
Cadijk van Kaarhandel Posted November 24, 2008 Share Posted November 24, 2008 DrB just wanted to say thank you, I'm not programmer so its all Double-Dutch to me but I'm using a couple of the utilities that have came since you released this and for sure my circumstances are pleasant right now. Thanks. megafan give up and use the FMAgent! Link to post Share on other sites More sharing options...
megafan2005 Posted November 24, 2008 Share Posted November 24, 2008 DrB just wanted to say thank you, I'm not programmer so its all Double-Dutch to me but I'm using a couple of the utilities that have came since you released this and for sure my circumstances are pleasant right now.Thanks. megafan give up and use the FMAgent! Never Cadijk Link to post Share on other sites More sharing options...
GeedieZ Posted November 24, 2008 Share Posted November 24, 2008 It's like the best post in Editors section since err... Johny Rivers. This is absolutely amazing DrBernhard! Link to post Share on other sites More sharing options...
DJLM82 Posted November 24, 2008 Share Posted November 24, 2008 How do I download via SVN?: I've reached this: "http://code.google.com/p/fm2009scoutframework/source/browse/#svn/trunk/SampleApplication%3Fstate%3Dclosed" But never find how to download the source. Link to post Share on other sites More sharing options...
goldorakiller Posted November 24, 2008 Share Posted November 24, 2008 You are a "MASTER" DrBernhard !!! Can this work with savegame or adapted for it ? Link to post Share on other sites More sharing options...
DrBernhard Posted November 24, 2008 Author Share Posted November 24, 2008 Download TortoiseSVN (just Google), create a new folder on your harddrive, rightclick -> Check out, put the code.google url in the URL box, and the app will download. 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()); } } } } How would I populate a datagridview with the returned list? listing things such as club, value etc..? Link to post Share on other sites More sharing options...
bonsai Posted November 24, 2008 Share Posted November 24, 2008 Are the player reputations not featured (yet), or did I just not find it? Link to post Share on other sites More sharing options...
bluenaz Posted November 25, 2008 Share Posted November 25, 2008 gah, i'm a c++ coder (beginner). this shouldn't be too difficult, i'll give it a try Link to post Share on other sites More sharing options...
matthewfriedles Posted November 25, 2008 Share Posted November 25, 2008 Just wanted to add to the chorus of 'Thank You's for doing this. I can do a bit of scripting in php/perl and have been looking for a way to start playing with .net apps.... and i think playing around making apps for FM could be a rather fun way to start. Link to post Share on other sites More sharing options...
DrBernhard Posted November 25, 2008 Author Share Posted November 25, 2008 Crosspost about sale value Sale value seems to be a problem in all the editors and scouts, contrary to earlier versions SI has changed the way they handle Sale Value from a solid value (e.g. the sale value is saved in the memory), to a dynamic value: all because of the new transfer system. That way it is (at this point) impossible to read a proper sale value from the memory. I might run some tests in the next couple of days to see whether there could be an improvement. Link to post Share on other sites More sharing options...
DrBernhard Posted November 25, 2008 Author Share Posted November 25, 2008 How would I populate a datagridview with the returned list? listing things such as club, value etc..? This will give you a list of all players with name, club and value. (assume you already have added a DataGridView with the name DataGridView1). private void button1_Click(object sender, EventArgs e) { DataGridView1.AutoGenerateColumns = true; DataGridView1.DataSource = (from p in fmDataContext.Players where p.PotentialPlayingAbility >= 190 orderby p.PotentialPlayingAbility select new { Name = p.ToString(), Club = p.Team.Club.Name, Value = p.Value }).ToList(); } Link to post Share on other sites More sharing options...
Cin-cout Posted November 25, 2008 Share Posted November 25, 2008 thank you DrB Link to post Share on other sites More sharing options...
Cin-cout Posted November 25, 2008 Share Posted November 25, 2008 foreach (Player player in fmDataContext.Players) { int playerMinPA = int.Parse(paMin.Text); int playerMaxPA = int.Parse(paMax.Text); if (player.PotentialPlayingAbility > playerMinPA && player.PotentialPlayingAbility < playerMaxPA) { dataGridView2.AutoGenerateColumns = true; dataGridView2.DataSource = (from p in fmDataContext.Players orderby p.PotentialPlayingAbility select new { Name = p.ToString(), Club = p.Team.Club.Name, Value = p.Value }).ToList(); } } I cant get this to work, it just stalls the application. Link to post Share on other sites More sharing options...
Cin-cout Posted November 25, 2008 Share Posted November 25, 2008 managed to get it working, the foreach was looping indefinately causing it to stall. Link to post Share on other sites More sharing options...
bonsai Posted November 25, 2008 Share Posted November 25, 2008 Are the player reputations not featured (yet), or did I just not find it? Anyone? Thanks Link to post Share on other sites More sharing options...
DrBernhard Posted November 25, 2008 Author Share Posted November 25, 2008 Anyone? Thanks Not implemented, if you have VS 2008 available, you can grab the Framework's source and add a property to the Entities.Ingame.Player object, which makes a call to the Prestige offset. Link to post Share on other sites More sharing options...
DrBernhard Posted November 25, 2008 Author Share Posted November 25, 2008 managed to get it working, the foreach was looping indefinately causing it to stall. The 'from p....' is already a loop, just written differently. You tried to populate the datagridview with (no. of players)^(no. of players), which is quite alot to process ;-) Link to post Share on other sites More sharing options...
bonsai Posted November 26, 2008 Share Posted November 26, 2008 Not implemented, if you have VS 2008 available, you can grab the Framework's source and add a property to the Entities.Ingame.Player object, which makes a call to the Prestige offset. Thanks. Just wanted to be sure before I think about changing the framework. Link to post Share on other sites More sharing options...
Cin-cout Posted November 26, 2008 Share Posted November 26, 2008 The 'from p....' is already a loop, just written differently. You tried to populate the datagridview with (no. of players)^(no. of players), which is quite alot to process ;-) Yes thanks, managed to sort it out. Link to post Share on other sites More sharing options...
Cin-cout Posted November 26, 2008 Share Posted November 26, 2008 Can you only return player positional attributes, or is there a way of returning a player position? Link to post Share on other sites More sharing options...
DrBernhard Posted November 26, 2008 Author Share Posted November 26, 2008 Best way would through the Positional skills attribute, there is no ToString method available at this point but you might want to do something like this string outp = ""; if (player.PositionalSkills.GoalKeeper > 15) outp += "GK "; if (player.PositionalSkills.Defender > 15) { outp += "D/"; if(player.PositionalSkills.Left > 15) outp += "L"; if(player.PositionalSkills.Center > 15) outp += "C"; if(player.PositionalSkills.Right > 15) outp += "R"; outp += " "; } and so on. Link to post Share on other sites More sharing options...
DrBernhard Posted November 26, 2008 Author Share Posted November 26, 2008 http://community.sigames.com/showthread.php?t=72226 for creating shortlists Link to post Share on other sites More sharing options...
Cin-cout Posted November 26, 2008 Share Posted November 26, 2008 Best way would through the Positional skills attribute, there is no ToString method available at this point but you might want to do something like thisstring outp = ""; if (player.PositionalSkills.GoalKeeper > 15) outp += "GK "; if (player.PositionalSkills.Defender > 15) { outp += "D/"; if(player.PositionalSkills.Left > 15) outp += "L"; if(player.PositionalSkills.Center > 15) outp += "C"; if(player.PositionalSkills.Right > 15) outp += "R"; outp += " "; } and so on. thank you DrB, not sure how i'll implement this but I'll figure it out. thank again, and for the shortlists too! Link to post Share on other sites More sharing options...
DrBernhard Posted November 26, 2008 Author Share Posted November 26, 2008 thank you DrB, not sure how i'll implement this but I'll figure it out. thank again, and for the shortlists too! Best way would be creating a function like 'public string GetPosition(Player player) {}' and then in your 'from p in fmDataC...' change your select clause to something like: select new { Name = player.ToString(), Position = GetPosition(player) } Link to post Share on other sites More sharing options...
Cin-cout Posted November 26, 2008 Share Posted November 26, 2008 so.. public string GetPosition (Player player) { string outp = ""; if (player.PositionalSkills.GoalKeeper > 15) outp += "GK "; if (player.PositionalSkills.Defender > 15) { outp += "D/"; if(player.PositionalSkills.Left > 15) outp += "L"; if(player.PositionalSkills.Center > 15) outp += "C"; if(player.PositionalSkills.Right > 15) outp += "R"; outp += " "; } } from p in fmDataContext.Player where p.PotentialPlayingAbility > "190" select new { Name = player.ToString(), Position = GetPosition(p) } that would work? Sorry I'm in work so I cant try it, not that Ive done any work since you actually released this framework. Link to post Share on other sites More sharing options...
DrBernhard Posted November 26, 2008 Author Share Posted November 26, 2008 so.. public string GetPosition (Player player) { string outp = ""; if (player.PositionalSkills.GoalKeeper > 15) outp += "GK "; if (player.PositionalSkills.Defender > 15) { outp += "D/"; if(player.PositionalSkills.Left > 15) outp += "L"; if(player.PositionalSkills.Center > 15) outp += "C"; if(player.PositionalSkills.Right > 15) outp += "R"; outp += " "; } } from p in fmDataContext.Player where p.PotentialPlayingAbility > "190" select new { Name = player.ToString(), Position = GetPosition(p) } that would work? Sorry I'm in work so I cant try it, not that Ive done any work since you actually released this framework. As long as public string GetPosition is outside your 'protected void button1_click' then yes. Link to post Share on other sites More sharing options...
Cin-cout Posted November 26, 2008 Share Posted November 26, 2008 brilliant, thank you Link to post Share on other sites More sharing options...
Cin-cout Posted November 26, 2008 Share Posted November 26, 2008 when querying fmDataContext, are the results case/accent sensitive? Link to post Share on other sites More sharing options...
Julien67 Posted November 26, 2008 Share Posted November 26, 2008 Hello all, Could you tell me what is wrong in my code below ? The ContractExpiryDate is not the good for french player "Stephane Cassard'. In game I have 30/06/2009 and in my application I have 01/01/2056. private void Form1_Load(object sender, EventArgs e) { fmDataContext = new FMDataContext(); String[] JoueurActif = ((Player)fmDataContext.ActiveObject).ToString().Split(' '); lbl_NomJoueur.Text = JoueurActif[0].ToString() + " " + JoueurActif[1].ToString(); Player Joueurs = fmDataContext.Players.Single(cl => cl.LastName.ToLower() == JoueurActif[1].ToLower() && cl.FirstName.ToLower() == JoueurActif[0].ToLower()); Contract Contrat = Joueurs.Contract; lbl_FinContrat.Text = Contrat.ContractExpiryDate.ToShortDateString(); } Other question ? How can I do to update automatically information on my application when I change player in FM09 ? Thanks all in advance. P.S. : sorry for my bad english. Link to post Share on other sites More sharing options...
lurkingwithintent Posted November 26, 2008 Share Posted November 26, 2008 Is there a way to edit board confidence? And also is the program we need free? Link to post Share on other sites More sharing options...
kertiek Posted November 27, 2008 Share Posted November 27, 2008 any chance of adding a atribute in player contracts with the minimum release clause? Link to post Share on other sites More sharing options...
Cin-cout Posted November 27, 2008 Share Posted November 27, 2008 does anyone know how to return Staff teams? I cant seem to find it looking through the framework. I found player clubs by doing player.Team.Name but I cant find staff, any help would be appreciated. Link to post Share on other sites More sharing options...
DrBernhard Posted November 27, 2008 Author Share Posted November 27, 2008 Would be Staff.Contract.Club Link to post Share on other sites More sharing options...
immuner Posted November 27, 2008 Share Posted November 27, 2008 I have tried returning to main menu and reloading the game and then the fmDataContext cannot get initialized. Also, I am not sure whether the players list and the nonplaying staff list contains all the available players and staff in the game. For example, I cannot find my own name and my players. Link to post Share on other sites More sharing options...
Dan Atkinson Posted November 27, 2008 Share Posted November 27, 2008 Just thought I'd drop by and say that this is a really great project. I've just had a quick look at the source, and I'm really impressed! Link to post Share on other sites More sharing options...
SzymonK Posted November 27, 2008 Share Posted November 27, 2008 Is there way to change staff contract club? I've tried to assign Contract.Club but it's read-only, tried to assign MemoryAddress but that doesn't work. So is there such possibility? Link to post Share on other sites More sharing options...
x42bn6 Posted November 27, 2008 Share Posted November 27, 2008 How difficult would this be to reconfigure for Football Manager 2008? Link to post Share on other sites More sharing options...
jd1882 Posted November 27, 2008 Share Posted November 27, 2008 sweet tool! provides me with all i need and i like its simplicity, as my computer is very slooow. Good work Link to post Share on other sites More sharing options...
DrBernhard Posted November 27, 2008 Author Share Posted November 27, 2008 Is there way to change staff contract club? I've tried to assign Contract.Club but it's read-only, tried to assign MemoryAddress but that doesn't work. So is there such possibility? Erm you first have to lookup the memoryaddress of a club (by querying the fmDataContext), then read the memoryAddress into a Int32, and then write the int32 to the Contract.ClubPointer (or clubaddress, don't have source here atm) address. Although I'm not sure that will suddenly works. Had loads of problems doing that for players. Link to post Share on other sites More sharing options...
Cin-cout Posted November 27, 2008 Share Posted November 27, 2008 is it possible to create a search function such as public string searchQuery { }; then use from p in fmDataContext.Players where searchQuery(p) select { blah blah blah } ive tried but my function says "Cannot implicitly convert type 'String' to 'bool'" Link to post Share on other sites More sharing options...
BrickLovesLamp Posted November 27, 2008 Share Posted November 27, 2008 no doubt there will now be loads of scout tools available to us FMers... regardless I am going to start on my own version tonight :-) Link to post Share on other sites More sharing options...
DJLM82 Posted November 27, 2008 Share Posted November 27, 2008 no doubt there will now be loads of scout tools available to us FMers... regardless I am going to start on my own version tonight :-) Positional ratings and importing shortlist please. Main feature I look for and none have this yet :-) Link to post Share on other sites More sharing options...
DrBernhard Posted November 27, 2008 Author Share Posted November 27, 2008 is it possible to create a search function such as public string searchQuery { };then use from p in fmDataContext.Players where searchQuery(p) select { blah blah blah } ive tried but my function says "Cannot implicitly convert type 'String' to 'bool'" You can do by invoking properties using reflection, though not a beginners-topic. Better would be a base list which gets filtered: IEnumerable<Player> base = fmDataContext.Players; if(!string.IsNullOrEmpty(AgeMinTextbox.Text)) base = base.Where(p=>p.Age > int.Parse(AgeMinTextbox.Text)); if(!string.IsNullOrEmpty(AgeMaxTextbox.Text)) base = base.Where(p=>p.Age < int.Parse(AgeMaxTextbox.Text)); etc. Link to post Share on other sites More sharing options...
goldorakiller Posted November 27, 2008 Share Posted November 27, 2008 How can I get stats /20 ? Like Dragutinovic Aggression : Ingame he is 18/20 and with this TextBox2.Text = player.MentalSkills.Aggression I have 90 Link to post Share on other sites More sharing options...
ruci Posted November 27, 2008 Share Posted November 27, 2008 Hi, DrBernhard I've been playing with your framework and it looks great;) but i think that I've found a bug in your BaseObject != opperator, if you compare to null objects, a != b (a = null and b = null) it will return true but they are both null so it should return false public static bool operator !=(BaseObject a, BaseObject b) { if (!System.Object.ReferenceEquals(a, b)) return true; if (((object)a == null) || ((object)b == null)) return true; if (a.MemoryAddress != b.MemoryAddress) return true; else return false; } Link to post Share on other sites More sharing options...
ruci Posted November 27, 2008 Share Posted November 27, 2008 How can I get stats /20 ?Like Dragutinovic Aggression : Ingame he is 18/20 and with this TextBox2.Text = player.MentalSkills.Aggression I have 90 almost every player attribute is stored in memory as a 1-100 attribute, so if you want them to be displayed in 1-20 range, is easy, just divide them by 5..ex 90/5 you will have the 18 that you have in game.. Link to post Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.