Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Wolff

Pages: [1] 2
1
General / Re: Making a game playble on other computers
« on: January 19, 2019, 08:39:34 pm »
Yea, I guess there's little to no point in encrypting files then. Also, form what I understood my old project from way back when was literally a xor encryption program hahah, I didn't get that because it's called completely different in my language, it was only able to encrypt .txt files though.
Thanks again for all the help, I've learned a lot!

2
General / Re: Making a game playble on other computers
« on: January 17, 2019, 04:46:45 pm »
That's super intersting!
So using xor would look like writing a program that would encrypt .txt file with a key, then use a similar function in the game that would decrypt it with the key and use it in the game? I wrote a similar thing some time ago.
I wonder if you can somehow use it on .jpg or .png files as well.
It's not like I want the game to be super solid, I just think that having everything out in the open might seem unproffesional even if the game isn't like a huge project. And it might tempt people to take a peek at the story/dialogues, or graphics that they havn't yet expirience in game.
Thanks for all the help!!

3
General / Re: Making a game playble on other computers
« on: January 16, 2019, 10:07:54 pm »
Thank you so much!
One thing, when I tried to put them how they were in my projects folder (.exe in debug folder, rest of the files in a neighboring one) it didn't seem to find the .dll files, when I put everything into one folder it worked perfectly!
One last quick question, what advantage does compiling in release mode has over the debug one (just runs faster + won't initiate if your code isn't "complete" ?).
Oh and also, if I were to one day hopefully release a game, are there programs that make it hard to tamper with all the loose .txt and .jpg files, or do developers just code their own methods of securing these files into the game?
Thanks so much for your help!   :D :D

4
General / Re: Making a game playble on other computers
« on: January 16, 2019, 07:26:33 pm »
FRex, form the small games that you've made (like snake), it's just the .dll files and the .exe file.
Is that all I'd need to do? Just go into the games folder, copy all .dll files there are and my .jpg and .txt files, zip it alongside with the .exe file and that's it? The release mode when building isn't necessary?

5
General / Re: Making a game playble on other computers
« on: January 16, 2019, 07:22:32 pm »
If I include like how? Do I just take the .exe file from my programs folder, put it in a new one, move every file from debug and other folders that my program oparates on and put it in the same folder zip it up and move to another computer it's going to work there?
I've heard about building the project not in a debug mode but in release mode but I'm not sure how that works and I dont want to screw anything up. Also what about libraries like SFML, doesnt the program need them?
I talked about an installer because I'd like it to be legit in a way, with a desktop shortcut which you could just run and the program would fetch everything it needs from another folder etc.
It's so weird, I havn't seen people talk about it like at all on forums.
Thanks for any and all input!

6
General / Making a game playble on other computers
« on: January 15, 2019, 06:10:56 pm »
So that's a thing I've never thought about. I made a couple of games/programs but now that I want to show it to someone I'm at loss.
How do I turn my game into a legit .exe file with maybe an installer if it's necessary?
It's written in c++ in VS, with couple of standard libraries and SFML. It also has some .txt and .jpg files.
I looked on google and youtube but never found a solid tutorial.
Thanks for all the help!

7
General / Re: Access violation reading location
« on: January 13, 2019, 01:03:47 pm »
One last question, it started woking when I added &. Why make it a constant, does that change things much? I never actually use it tbh.

8
General / Re: Access violation reading location
« on: January 13, 2019, 01:02:07 pm »
Oh my God, obviously. I wanted to try that out so fast that I completely missed that. Thanks so much!!!
I still dont understand how that works ("keeping the font alive" or what issue does it have with having just a copy not an original), but now everything is fine. Thanks again!

9
General / Re: Access violation reading location
« on: January 13, 2019, 12:56:42 pm »
It actually didn't change anything  :'( :'(
I changed my code to that:
void Player::setTextLoc(int numb, sf::Font font)
{
        float pos_ay = 300.f;
        int n = numb;
       
        for (auto& a : myclues)
        {
                a.setFont(font);
                a.setPosition(30.f , pos_ay);
                a.setCharacterSize(20);
                a.setFillColor(sf::Color(0, 0, 0, 255));
                pos_ay += 10.f;        
        }
}
 
And then made sf::Font in main and called the function:
sf::Font font;
        if (!font.loadFromFile("28_Days_Later.ttf")) { std::cerr << "ERROR loading font from file" << std::endl; }
        for (auto & a : vPlayers)
        {
                a.setTextLoc(numb, font);
        }
 
But it throws the exception just the same.  :'(

10
General / Re: Access violation reading location
« on: January 13, 2019, 12:37:13 pm »
I've read somewhere that maybe the font isn't ketp alive? Not sure what that means, the font and everything for the sf::Text is created and added in another of the classes function, looks like this:
void Player::setTextLoc(int numb)
{
        sf::Font font;
        if (!font.loadFromFile("28_Days_Later.ttf")) { std::cerr << "ERROR loading 28_Days_Later.ttf" << std::endl; }
       
        float pos_ay = 300.f;
       
        for (auto& a : myclues)
        {
                a.setFont(font);
                a.setPosition(30.f , pos_ay);
                a.setCharacterSize(20);
                a.setFillColor(sf::Color(0, 0, 0, 255));
                pos_ay += 10.f;        
        }
}
 

11
General / Re: Access violation reading location
« on: January 13, 2019, 12:27:06 pm »
I dont think anything in the setup is wrong, before it was compiling and everything was fine, just this one thing gives me an error.
So is it a valid way to do this? I started to think that it just cannot be done this way.

12
General / Access violation reading location
« on: January 13, 2019, 02:01:24 am »
I found a few topics with this error but none really looked similarly to my issue so here I go.
I have a class that has a vector of sf::Text. Then it has functions to set everything up like fonts sizes and coordinates so thats fine. Next I'd like to draw the text from main, as it's private in a class I tried to do it from the classes function like that:
void Player::drawCards(sf::RenderWindow &window)
{
        for(int i = 0; i<3; i++)
        {
        window.draw(myclues[i]);
        }
}
 
That didn't work out, so I made a function that returns the text.
sf::Text Player::retClu(int i)
{
        return myclues[i];
}
 
And then use it in main.cpp like so (the class - player, is also in a vector so I can do this for each generated class) :
for (int i = 0; i < numb_of_players; i++)
                {
                        for (int j = 0; j < 3; j++)
                        {
                                window.draw(vPlayers[i].retClu(j));  
                        }
                }
 
And yet again I get the error:
Exception thrown at 0x508D485F (sfml-graphics-d-2.dll) in forensic_15.exe: 0xC0000005: Access violation reading location 0x00000004.
 
I've tried many different ways of coding this but I must have some misunderstanding of how it can/should be done because I get this error every time.
Thanks for any replies.

13
General / Re: Infinite loop with loading text from file
« on: August 14, 2018, 12:09:22 pm »
If anyone thinks some snippets of code would help I would gladly provide them, although the issue seems more general like the placement of my function(?).

14
General / Infinite loop with loading text from file
« on: August 14, 2018, 01:01:34 am »
Hello,
I have written a function that basically takes in a number and then looks for it in a file, then loads the text beneath does some things and stops when it encounters the next number.
It works perfectly on it's own, but when I put it in my SFML project (you guessed it - it's a game) it never stops and freezes the entire program.
For it to start running first the user has to input some things so when the list of things to do is complete it switches a bool statement to true, and when it does my function that's been waiting inside an if statement can run.
I've tried everything to make it stop after one iteration, but once the program goes into the function it never leaves ignoring my code that literally says - stop it when you load a certain line. Using the debugger I confirmed that it indeed loads that line, but then it just goes back to the start.
Might it be the fault of the main loop of an SFML window?

15
General / Re: Switching between states
« on: August 11, 2018, 03:27:01 am »
Thank you so much for your time and help!
Now I understand the problem and a way to improve my code. Thanks once again!

Pages: [1] 2
anything