1. Post #321
    Clops with bisousbisous daily <3
    Mr. Smartass's Avatar
    December 2010
    9,176 Posts
    Put a break point on that line and ensure that Content.Load<EFfect>("effects"); isn't returning null.
    I did, and it isn't;
    The thing is, the error started after I changed the second model's effect type to textured from colored, so I'm 100% sure that that's where the error is coming from;
     private void drawWeapon()
            {
                SamplerState ss = new SamplerState();
                ss.AddressU = TextureAddressMode.Clamp;
                ss.AddressV = TextureAddressMode.Clamp;
                device.SamplerStates[0] = ss;
    
                DepthStencilState dss = new DepthStencilState();
                dss.DepthBufferEnable = true;
                device.DepthStencilState = dss;
                //Matrix worldMatrix = weaponPositionMatrix;
    
                Matrix[] weaponTransforms = new Matrix[shipModel.Bones.Count];
                shipModel.CopyAbsoluteBoneTransformsTo(weaponTransforms);
                int i = 0;
                foreach (ModelMesh mesh in shipModel.Meshes)
    
                {
                    //sets the effects for all meshes in the model
                    foreach (Effect currentEffect in mesh.Effects)
                    {
                        worldMatrix = weaponTransforms[mesh.ParentBone.Index];
                        currentEffect.CurrentTechnique = currentEffect.Techniques["Textured"];
                        currentEffect.Parameters["xWorld"].SetValue(weaponTransforms[mesh.ParentBone.Index] * worldMatrix);
                        currentEffect.Parameters["xView"].SetValue(viewMatrix);
                        currentEffect.Parameters["xProjection"].SetValue(projectionMatrix);
                        currentEffect.Parameters["xEnableLighting"].SetValue(true);
                        currentEffect.Parameters["xLightDirection"].SetValue(sunAngle);
                        currentEffect.Parameters["xTexture"].SetValue(grenadeLauncherTextures[i++]);
                        currentEffect.Parameters["xAmbient"].SetValue(0.5f);
                    }
                    mesh.Draw();
                }
            }
            
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  2. Post #322
    genkaz92's Avatar
    July 2007
    1,862 Posts
    I have a more conceptual question about pseudocode and planning the actual structure. How thoroughly do you prepare a relatively serious project theoretically before actually starting to code it? As far as I am aware, it is the best idea to create a language independent pseudocode structure before actually starting to create it.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #323
    Wyzard's Avatar
    June 2008
    1,242 Posts
    If it's a complex enough program I'll spend some time thinking about overall architecture first, but I don't see much value in creating a pseudocode mockup of a whole program before starting to write the "real" code. To the extent that your real code matches what you wrote in pseudocode, you're just doing the same work twice. And you'll probably discover problems and design considerations while working on the real code that you didn't foresee while writing pseudocode, so you'll end up deviating from your plans anyway.

    Some people like to use UML to design a program in advance. That can be useful for high-level planning, but IMO trying to plan out all the details (like every method's argument list) is a waste,

    Pseudocode is more useful for smaller things, like figuring out an algorithm without having to worry about details like memory management.
    Reply With Quote Edit / Delete Linux United States Show Events Agree Agree x 1 (list)

  4. Post #324
    Post artwork of Storm Spirit on my profile and get a free cookie!
    Bumrang's Avatar
    August 2011
    1,694 Posts
    I can't actually start something.

    I just got an idea, but I can't make myself open Code::Blocks and start programming. It's kind of a...laziness?

    Really need help on this, I don't understand why I can't get myself to do any programming.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Optimistic Optimistic x 1Dumb Dumb x 1 (list)

  5. Post #325
    HQRSE FUCKER
    ief014's Avatar
    September 2009
    2,579 Posts
    I can't actually start something.

    I just got an idea, but I can't make myself open Code::Blocks and start programming. It's kind of a...laziness?

    Really need help on this, I don't understand why I can't get myself to do any programming.
    I find just talking to other programmers [about programming] motivating
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 2Friendly Friendly x 1Programming King Programming King x 1 (list)

  6. Post #326
    Gold Member
    KillerJaguar's Avatar
    October 2006
    1,621 Posts
    I find just talking to other programmers [about programming] motivating
    Or, if making a game, having an artist to create sprites for you. It helps me want to continue working when I can keep expanding instead of being limited in assets.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2 (list)

  7. Post #327
    Dreams of chronic and sustained critglows.
    ned_ballad's Avatar
    December 2010
    14,773 Posts
    Obj-C

    passing a mutable array from the appDelegate to the view controller. It's a big long array of restaurants that are tagged on a map. The appDelegate pulls the data from a plist and makes a nice array and then passes it to the viewController to add the info to the map.

    The appDelegate does it's job right, the NSLogs prove it. But once the viewController gets it... it's a null array.

    App Delegate code
    self.viewController.restaurants = restaurants;

    And in View Controller
    NSLog(@"THIS IS, %@",restaurants);

    returns "THIS IS (null)"


    What's going on and why doesn't this work?
    Reply With Quote Edit / Delete Mac United States Show Events

  8. Post #328
    ffFf
    Uber|nooB's Avatar
    June 2005
    4,544 Posts
    I don't really know if anyone would be willing to help with this, as (at least to me) it seems possibly pretty complicated, but here goes:

    I have a rectangle with known coordinates. Inside this rectangle is another, smaller polygon; its coordinates are also known. I then have a large set of coordinates that represent another polygon, which may or may not be concave.

    I'm hoping to come up with a way of finding the best way to fit said curve so that all its points are inside the outer rectangle, but the inner polygon must be inside this curve. The inner polygon must remain in a fixed position, and the set of points representing the curve can be translated, rotated and scaled (as long as the scaling is done in both x and y simultaneously and by an equal factor).

    So uh, yeah. I have absolutely no idea as to where I should even begin with this.

    If anyone could even just point me in the vaguely right direction regarding to where the hell I should start, I would be very, very grateful.



    also i hope this is in the right section, as the problem seems to be leaning more towards a maths problem than a programming problem, i guess
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  9. Post #329
    mlbfan560's Avatar
    June 2005
    72 Posts
    Obj-C

    passing a mutable array from the appDelegate to the view controller. It's a big long array of restaurants that are tagged on a map. The appDelegate pulls the data from a plist and makes a nice array and then passes it to the viewController to add the info to the map.

    The appDelegate does it's job right, the NSLogs prove it. But once the viewController gets it... it's a null array.

    App Delegate code
    self.viewController.restaurants = restaurants;

    And in View Controller
    NSLog(@"THIS IS, %@",restaurants);

    returns "THIS IS (null)"


    What's going on and why doesn't this work?
    If the View Controller's array is a property try [self restaurants] or self.restaurants in NSLog.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  10. Post #330
    Dreams of chronic and sustained critglows.
    ned_ballad's Avatar
    December 2010
    14,773 Posts
    it ended up being that I was passing the array before the view controller was created

    6 hours...

    SIX HOURS

    and it was the wrong order messing me up

    :(
    Reply With Quote Edit / Delete Mac United States Show Events

  11. Post #331
    Leonmyster's Avatar
    June 2009
    535 Posts
    Hey guys, more recursion...

    #include <iostream>
    using namespace std;
    
    double findLargestElement(double arr[], int, int);
    
    int main()
    {
    	const int SIZE = 50;
    	double arr[SIZE];
    	double largest;
    	int n;
    
    	cout << "How many elements are in the array, arr? ";
    	cin >> n;
    
    	cout << "Please enter the numbers for the array, arr:\n";
    	for (int i = 0; i < n; i++)
    	{
    		cout << "Enter arr[" << i << "]: ";
    		cin >> arr[i];
    	}
    
    	largest = findLargestElement(arr, SIZE, n);
    
    	cout << "The largest value of array, arr is " << largest << ".\n";
    
    	return 0;
    }
    
    double findLargestElement(double arr[], int SIZE, int n)
    {
    	if (n == 0)
    		return arr[0];
    	return findLargestElement(arr, SIZE, n - 1);
    }

    I seriously can not figure this out, I am suppose to find the largest element of the array recursively, but I have no idea how to do it.

    My professor gave me this hint.

    I could find the largest among arr[0] through arr[j] if I could find the largest among arr[0] through arr[j - 1]. I would compare that answer with ....
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #332
    Gold Member
    mechanarchy's Avatar
    September 2009
    1,200 Posts
    My professor gave me this hint.

    I could find the largest among arr[0] through arr[j] if I could find the largest among arr[0] through arr[j - 1]. I would compare that answer with ....
    What your professor is saying is he can find the largest element in the interval\range 0 to j, by comparing that value with the largest element in the interval 0 to j-1. That's how the recursion works.

    If you're trying to find the largest element in the interval 0 to 0, it's gotta be whatever value you have, you can't recurse further.

    This should be more than enough help.
    Reply With Quote Edit / Delete Linux Australia Show Events

  13. Post #333
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,117 Posts
    Hey guys, more recursion...

    ..code..

    I seriously can not figure this out, I am suppose to find the largest element of the array recursively, but I have no idea how to do it.

    My professor gave me this hint.

    I could find the largest among arr[0] through arr[j] if I could find the largest among arr[0] through arr[j - 1]. I would compare that answer with ....
    The max of a list with one element in it is that element.

    The max of a list with two elements in it is the max of the first and the second. You can take this rule and generalize it to any list by looking at the list like this:

    [1, 2, 3, 4] => [1, [2, [3, [4]]]]

    So to get the max of a list, you compare the first item with the max of the list in the second slot:

    Reply With Quote Edit / Delete Mac Australia Show Events

  14. Post #334
    Jaykin' Bacon: Episode 3
    Jimbomcb's Avatar
    February 2005
    18,180 Posts
    It's a long shot, but does anyone have any experience with networking on source? I need to pass an entity handle to the client (and read networked values from the entity) through a usermessage.

    When encoding it for a usermessage, it encodes it as a long (through WRITE_EHANDLE). I can't find any examples of how to get the entity back from this long value on the client. Anyone able to point me in the right direction? Struggling to find any examples of it being used anywhere in the code so I'm a bit confused, I'm probably going about it the totally wrong way.
    Reply With Quote Edit / Delete Windows 7 Show Events

  15. Post #335
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    It's a long shot, but does anyone have any experience with networking on source? I need to pass an entity handle to the client (and read networked values from the entity) through a usermessage.

    When encoding it for a usermessage, it encodes it as a long (through WRITE_EHANDLE). I can't find any examples of how to get the entity back from this long value on the client. Anyone able to point me in the right direction? Struggling to find any examples of it being used anywhere in the code so I'm a bit confused, I'm probably going about it the totally wrong way.
    IClientEntityList provides methods for getting entity from the handle.

    abstract_class IClientEntityList
    {
    public:
    	// Get IClientNetworkable interface for specified entity
    	virtual IClientNetworkable*	GetClientNetworkable( int entnum ) = 0;
    	virtual IClientNetworkable*	GetClientNetworkableFromHandle( CBaseHandle hEnt ) = 0;
    	virtual IClientUnknown*		GetClientUnknownFromHandle( CBaseHandle hEnt ) = 0;
    
    	// NOTE: This function is only a convenience wrapper.
    	// It returns GetClientNetworkable( entnum )->GetIClientEntity().
    	virtual IClientEntity*		GetClientEntity( int entnum ) = 0;
    	virtual IClientEntity*		GetClientEntityFromHandle( CBaseHandle hEnt ) = 0;
    	
    	//...
    };

    For example:
    C_BaseEntity *ent = static_cast<C_BaseEntity*>(source::g_interfaces->EntityList->GetClientEntityFromHandle(hnd));
    if (!ent) return nullptr;

    e: EHANDLE is a typedef of CHandle<CBaseEntity>, which in turn is derived from CBaseHandle, so it should work with this.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  16. Post #336
    Jaykin' Bacon: Episode 3
    Jimbomcb's Avatar
    February 2005
    18,180 Posts
    IClientEntityList provides methods for getting entity from the handle.

    abstract_class IClientEntityList
    {
    public:
    	// Get IClientNetworkable interface for specified entity
    	virtual IClientNetworkable*	GetClientNetworkable( int entnum ) = 0;
    	virtual IClientNetworkable*	GetClientNetworkableFromHandle( CBaseHandle hEnt ) = 0;
    	virtual IClientUnknown*		GetClientUnknownFromHandle( CBaseHandle hEnt ) = 0;
    
    	// NOTE: This function is only a convenience wrapper.
    	// It returns GetClientNetworkable( entnum )->GetIClientEntity().
    	virtual IClientEntity*		GetClientEntity( int entnum ) = 0;
    	virtual IClientEntity*		GetClientEntityFromHandle( CBaseHandle hEnt ) = 0;
    	
    	//...
    };

    For example:
    C_BaseEntity *ent = static_cast<C_BaseEntity*>(source::g_interfaces->EntityList->GetClientEntityFromHandle(hnd));
    if (!ent) return nullptr;

    e: EHANDLE is a typedef of CHandle<CBaseEntity>, which in turn is derived from CBaseHandle, so it should work with this.
    Thanks for the help. I must be messing up somewhere else along the line. The handle I'm getting on the receiving end of the usermessage isn't valid according to "ClientEntityList().IsHandleValid" and it just returns a null pointer using the code you suggested, time to have a dig around and see why it's doing this.

    Edited:

    sorted!
    Reply With Quote Edit / Delete Windows 7 Show Events

  17. Post #337
    Gold Member
    xxxkiller's Avatar
    July 2006
    626 Posts
    Hey guys! I have been fascinated by the mandelbrot and other fractals for a while now, but I never expected the maths behind them to be so simple. Anyway, i tried programming the mandelbrot, but apparently it is not quite as simple as I thought:

    Code:
    	int xPix = 0, yPix = 0;
    	float x0, y0 ,x, y, x2, y2;
    
    	int iteration;
    	int max_iteration = 10;
    
    	for(xPix = 0; xPix < 800; xPix++)
    	{
    		for(yPix = 0; yPix < 600; yPix++)
    		{
    			x0 = xPix / 228.5714f - 2.5f;
    			y0 = yPix / 300 -1.0f;
    
    			x = x0;
    			y = y0;
    
    			x2 = x*x;
    			y2 = y*y;
    
    			iteration = 0;
    
    			while (x2 + y2 < 4 && iteration < max_iteration)
    			{
    				y = 2*x*y + y0;
    				x = x2 - y2 + x0;
    				x2 = x*x;
    				y2 = y*y;
    
    				iteration++;
    			}
    
    			if(iteration <= 0)
    			{
    				mandelbrot.SetPixel(xPix, yPix, sf::Color(0,0,0));
    			}
    			else
    			{
    				mandelbrot.SetPixel(xPix, yPix, sf::Color(255*sin((float)iteration), 255*cos((float)iteration), 255*-sin((float)iteration)));
    			}
    		}
    	}
    This is what I get, I call it the Mandelnot:


    I have tweeked so many things, that I am sure I have done something fundamentally wrong. I just don't know where. If anyone can help me I would be quite happy!
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Funny Funny x 4 (list)

  18. Post #338
    Follow me on github
    Ziks's Avatar
    June 2011
    805 Posts
    Code:
    y0 = yPix / 300 -1.0f;
    Put a .0f at the end of 300.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 3 (list)

  19. Post #339
    Gold Member
    xxxkiller's Avatar
    July 2006
    626 Posts
    Oh.. My.. God.....
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Funny Funny x 1 (list)

  20. Post #340
    Wyzard's Avatar
    June 2008
    1,242 Posts
    A simpler way to write the second definition is:

    Code:
    my_max (x:xs) = max x $ my_max xs
    Reply With Quote Edit / Delete Linux United States Show Events Programming King Programming King x 1 (list)

  21. Post #341
    Gold Member
    xxxkiller's Avatar
    July 2006
    626 Posts
    It works! Thanks! Could you explain to me why this was the problem?
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  22. Post #342
    Wyzard's Avatar
    June 2008
    1,242 Posts
    ...and a simpler way to write the whole thing is:

    Code:
    my_max = foldl1 max
    Reply With Quote Edit / Delete Linux United States Show Events

  23. Post #343
    NovembrDobby's Avatar
    April 2007
    1,121 Posts
    It works! Thanks! Could you explain to me why this was the problem?
    Code:
    y0 = yPix / 300 -1.0f;
    The 300 was being evaluated as an int, and was demoting the result so that yPix / 300 always yielded an int.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Friendly Friendly x 2Disagree Disagree x 1 (list)

  24. Post #344
    Gold Member
    ROBO_DONUT's Avatar
    March 2005
    3,028 Posts
    It works! Thanks! Could you explain to me why this was the problem?
    If you divide an integer by an integer, you get an integer.
    Reply With Quote Edit / Delete Windows 7 Show Events Friendly Friendly x 2Agree Agree x 1 (list)

  25. Post #345
    Gold Member
    xxxkiller's Avatar
    July 2006
    626 Posts
    Ahh ok! I understand why I was getting boxes then! Thanks for the quick and swift replies!
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Friendly Friendly x 1 (list)

  26. Post #346
    sim642's Avatar
    July 2010
    1,038 Posts
    What is this language?
    Reply With Quote Edit / Delete Windows Vista Estonia Show Events

  27. Post #347
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    What is this language?
    Haskell.
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  28. Post #348
    Gold Member
    Chris220's Avatar
    May 2008
    5,325 Posts
    I'm attempting to write a wrapper for the Windows command shell, allowing for things like fullscreen usage in an Aero environment (damn you, Microsoft) and custom colour schemes, aliases, profiles ETC.
    At the moment I'm using _popen and _pclose to execute the command and pipe the results back to my code, but since I'm on Windows, it's popping up a console every time I execute something. How can I get around this?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  29. Post #349
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    8,700 Posts
    I'm attempting to write a wrapper for the Windows command shell, allowing for things like fullscreen usage in an Aero environment (damn you, Microsoft) and custom colour schemes, aliases, profiles ETC.
    At the moment I'm using _popen and _pclose to execute the command and pipe the results back to my code, but since I'm on Windows, it's popping up a console every time I execute something. How can I get around this?
    Are you writing a Win32 GUI application? If so, _popen and _pclose aren't even supposed to work. You need to use Win32 API functions.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Friendly Friendly x 1 (list)

  30. Post #350
    NovembrDobby's Avatar
    April 2007
    1,121 Posts
    Urgh. Moving all my (xbox) gamepad logic from xinput (windows) to SFML's system. It seems to use one single kind of weird pseudo-axis for both the left and right triggers (hold left - it goes to 100, hold right and it goes to -100), which won't work properly because you can hold both triggers and it thinks neither is held.

    Anyone know how to get around this?

    Edited:

    Oh and another thing: the dpad is treated as a joystick too (what) which is all fine and manageable, except that there's no way to know if no dpad buttons are actually pressed. All you have is the angle the user is pointing to.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  31. Post #351
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    8,700 Posts
    Urgh. Moving all my (xbox) gamepad logic from xinput (windows) to SFML's system. It seems to use one single kind of weird pseudo-axis for both the left and right triggers (hold left - it goes to 100, hold right and it goes to -100), which won't work properly because you can hold both triggers and it thinks neither is held.

    Anyone know how to get around this?

    Edited:
    SFML uses DirectInput, which in an older API than XInput. The trigger issue is an intentional "feature" by Microsoft when using an XBox360 controller with DirectInput. I don't think there is any way to get around it, since Microsoft recommends the use of XInput.

    See here: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    In order to test the trigger values separately, you must use XInput.
    This is why I prefer the days when everybody used Logitech gamepads instead of 360 controllers.

    EDIT: Actually, I think SFML doesn't even use DirectInput, but basic WinApi functions.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Friendly Friendly x 1 (list)

  32. Post #352
    Gold Member
    Z_guy's Avatar
    July 2005
    466 Posts
    It seems to use one single kind of weird pseudo-axis for both the left and right triggers (hold left - it goes to 100, hold right and it goes to -100), which won't work properly because you can hold both triggers and it thinks neither is held.
    -snip-
    Oh nevermind, I got ninja'd with information.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events

  33. Post #353
    Gold Member
    vexx21322's Avatar
    December 2008
    9,848 Posts
    Two questions:
    1. How can I change the icon of files that are opened with my program.
    2. I can't seem to set files to open with my program by default, it doesn't show up when I double click it.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #354
    Gold Member
    Chris220's Avatar
    May 2008
    5,325 Posts
    Are you writing a Win32 GUI application? If so, _popen and _pclose aren't even supposed to work. You need to use Win32 API functions.
    Thank you very much :)
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  35. Post #355
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,117 Posts
    A simpler way to write the second definition is:

    Code:
    my_max (x:xs) = max x $ my_max xs
    thanks!
    Reply With Quote Edit / Delete Mac Australia Show Events

  36. Post #356
    Gold Member
    Chris220's Avatar
    May 2008
    5,325 Posts
    Ok, so I'm spawning cmd.exe and redirecting its standard input and output streams to my application, so I can read its output.

    Here's the code I'm using to actually read the output:
    char commandResult[2048];
    ZeroMemory(commandResult, 2048);
    unsigned long bytesRead;
    	
    ReadFile(stdOutR, commandResult, 2048, &bytesRead, NULL);
    Now, can someone please explain why if I run that it only returns the first line of the output, but if I put a breakpoint on the ReadFile line, then continue execution as soon as it breaks, it captures the entire output?
    I've already tried putting a 10 second wait after ReadFile to make very sure that it's not a race condition or something, and I can't think of what else to try!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  37. Post #357
    Gold Member
    ShaunOfTheLive's Avatar
    November 2007
    8,700 Posts
    Now, can someone please explain why if I run that it only returns the first line of the output, but if I put a breakpoint on the ReadFile line, then continue execution as soon as it breaks, it captures the entire output?
    I think you have to loop until bytesRead == 0
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Agree Agree x 1 (list)

  38. Post #358
    ToXiCsoldier's Avatar
    March 2008
    1,085 Posts
    Can anyone point me in a way for a library/ tutorial/ anything for making a music visualizer with C#?

    Aswell as this problem:
    I have a XNA game that saves the player and the score's for each level in a ACCES .accdb database.
    Inserting new players, retrieving already existing players and updating them with new scores and getting all scores from it goes without a problem.
    Only when i close the game it deletes all new records from the database but i don't have any sql DELETE statements in my game?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events

  39. Post #359
    Tamschi's Avatar
    December 2009
    1,012 Posts
    Can anyone point me in a way for a library/ tutorial/ anything for making a music visualizer with C#?

    Aswell as this problem:
    I have a XNA game that saves the player and the score's for each level in a ACCES .accdb database.
    Inserting new players, retrieving already existing players and updating them with new scores and getting all scores from it goes without a problem.
    Only when i close the game it deletes all new records from the database but i don't have any sql DELETE statements in my game?
    You can use NAudio to decode and play some audio formats. The WPF demo has some example visualizations.

    Are you commiting the transactions?
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  40. Post #360
    ToXiCsoldier's Avatar
    March 2008
    1,085 Posts
    You can use NAudio to decode and play some audio formats. The WPF demo has some example visualizations.

    Are you commiting the transactions?
    Thanks for the NAudio link, ill give it a try tomorrow.

    About the database:

    At the beginning of the game a player can insert it's name, if he pressed "continue" a SELECT command will check if the playername exists in the list.
    If it exists it will get all the player information with a SELECT command.
    If not then it will create a new one use the INSERT command to insert it into the database.
    If the player leaves the options menu, the database will be updated with the UPDATE command
    If a player completes a level the database will be updated aswell, same command.
    The highscore menu asks all the playernames and respective scores.

    It all works and the data is inserted into ACCES, until i close the game (either via stop debugging or use my close button (game1.exit)) then it loses all the new data i inserted that debug session.
    I use a object in my project to keep the current playerinformation (name, difficulty, and score for each level).
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events