[QUOTE=Confuzzed Otto;37016091]Oh, I see. Thanks!
[editline]31st July 2012[/editline]
God damnit, this is so confusing. The course told me to make my own if/else statement, I make one that I think is working as no errors show up, but the course says this:
My code:
[code]if (1 === 1) {
console.log("This is horrendous"); }
else {
console.log("Something went wrong"); }[/code][/QUOTE]
This may sound stupid, but make sure the syntax is correct on that string. Are you meant to be returning "This is horrendous"? Check what they want you to return.
I have a Vector defined like this:
vector<vector<*Class> >
When I want to access something inside this Vector, I do the following:
vector[0][0]->arrayInsideObject[0] = 0.5f;
But this gives me:
"Unhandled Exception at 0x00381435 in Game of Life.exe: 0xC0000005: Access violation while writing at Position 0x00000084"
The original Message is in German, here it is:
"Unbehandelte Ausnahme bei 0x00381435 in Game of Life.exe: 0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x00000084."
I would be glad if someone could help me with this.
It was supposed to be my own, nothing in there stands what the string should be. I skipped it anyways, since the code works, even though I don't have any use for it yet.
[QUOTE=Confuzzed Otto;37019187]It was supposed to be my own, nothing in there stands what the string should be. I skipped it anyways, since the code works, even though I don't have any use for it yet.[/QUOTE]
Hm. Just odd that they say "You didn't log the correct string to console" in that case, that implies that there's a particular string they want to receive.
Anyone here with an i7/Powerful CPU and Adobe After Effects CS5.5? I need a file to be rendered, and it takes too long for my PC.
[url]http://www.steamcommunity.com/id/thelastbyte[/url]
[QUOTE=xxxkiller;37019176]I have a Vector defined like this:
vector<vector<*Class> >
When I want to access something inside this Vector, I do the following:
vector[0][0]->arrayInsideObject[0] = 0.5f;
But this gives me:
"Unhandled Exception at 0x00381435 in Game of Life.exe: 0xC0000005: Access violation while writing at Position 0x00000084"
The original Message is in German, here it is:
"Unbehandelte Ausnahme bei 0x00381435 in Game of Life.exe: 0xC0000005: Zugriffsverletzung beim Schreiben an Position 0x00000084."
I would be glad if someone could help me with this.[/QUOTE]
Show us the order of adding items - it may be that you are adding a vector to the list (which is a copy) then adding an item to the original vector (which is not the same as the one in the list).
[editline]31st July 2012[/editline]
Or you're trying to use a null pointer
I actually seem to have fixed it, but I have no clue why it worked.
The original looked like this:
Cell* vCell;
for (int i = 0; i < xIter; i++)
{
xCells.push_back(vCell);
std::cout << "x ";
}
for (int i = 0; i < yIter; i++)
{
yCells.push_back(xCells);
std::cout << "\nx";
}
Now I changed it to this and it seems to work:
Cell vCell;
for (int i = 0; i < xIter; i++)
{
xCells.push_back(&vCell);
std::cout << "x ";
}
for (int i = 0; i < yIter; i++)
{
yCells.push_back(xCells);
std::cout << "\nx";
}
If someone could explain to me why this works, please do so.
I am also not sure, as I have not implemented the rest of my program, if all pointers in the vector now actually point to the SAME object, which would mean, if I change the value of one Cell, all Cells would change too (because they are the same one). Obviously, if this is really is the case, then I would still need help, as I need to be able to change every Cell individually.
EDIT: It seems I have not really fixed it, it does not crash anymore, but I still get the error.
[QUOTE=Hack;37021000]Anyone here with an i7/Powerful CPU and Adobe After Effects CS5.5? I need a file to be rendered, and it takes too long for my PC.
[url]http://www.steamcommunity.com/id/thelastbyte[/url][/QUOTE]
I added you 3 hours ago but you didn't accept.
[QUOTE=xxxkiller;37021865]Now I changed it to this and it seems to work:
Cell vCell;
for (int i = 0; i < xIter; i++)
{
xCells.push_back(&vCell);
std::cout << "x ";
}
for (int i = 0; i < yIter; i++)
{
yCells.push_back(xCells);
std::cout << "\nx";
}
If someone could explain to me why this works, please do so.
I am also not sure, as I have not implemented the rest of my program, if all pointers in the vector now actually point to the SAME object, which would mean, if I change the value of one Cell, all Cells would change too (because they are the same one). Obviously, if this is really is the case, then I would still need help, as I need to be able to change every Cell individually.
EDIT: It seems I have not really fixed it, it does not crash anymore, but I still get the error.[/QUOTE]
Ooh bad idea, you're using the address of an object that is deleted when it goes out of scope. Try this:
[code]
Cell* vCell = new Cell();
for (int i = 0; i < xIter; i++)
{
xCells.push_back(vCell);
std::cout << "x ";
}
for (int i = 0; i < yIter; i++)
{
yCells.push_back(xCells);
std::cout << std::endl << "x";
}
[/code]
[editline]31st July 2012[/editline]
and don't forget to delete it later. clearing xCells will only delete the pointers, not the object they are pointing to.
It did not seem to affect anything. :(
I don't think I need to delete, as I am using vector.clear() before generating a new grid of cells.
If you're new'ing stuff, you need to delete it manually - clearing or removing entries from the vector only deletes the pointers not the actual objects. You'll get a memory leak if you don't delete them.
[editline]31st July 2012[/editline]
although, you could just scrap the pointers and make the vectors hold the actual objects.
[code]
Cell vCell;
//make xCells the following: std::vector<Cell>, and yCells std::vector<std::vector<Cell>>
for (int i = 0; i < xIter; i++)
{
xCells.push_back(vCell);
std::cout << "x ";
}
for (int i = 0; i < yIter; i++)
{
yCells.push_back(xCells);
std::cout << std::endl << "x";
}
[/code]
then they'll be cleaned up properly without needing to manually delete. If you do this, be aware that the Cells in the vectors will all be copies of the first one (not the same object).
[QUOTE=Overv;37021930]I added you 3 hours ago but you didn't accept.[/QUOTE]
I added you sorry bud I was working on something :S
That was the way I did it way at first, then I got the error and tried to fix it using pointers, hoping that pointers would just miraculously work better.
I also noticed something. I only get the error when the new grid that gets generated actually has different dimensions than the old grid had.
[editline]31st July 2012[/editline]
Ok, here is the whole function:
[url]http://pastebin.com/8065DE3i[/url]
It is executed every time the window size changes in order to generate a new grid of Cells which match the new window size. The code that takes care of the vertex positions of the individual Cells is just a placeholder for now, if the function would work properly, the screen should be white, because all Cells are drawn ontop of each other and are the size of the viewport.
The actual drawing is taken care of, in a different place. I know the drawing method works, because I have manually created a single Cell, given it it's verticies and drawn it completely disregarding the existance of this function.
[editline]31st July 2012[/editline]
I also know that the dimensions of the Grid are generated correctly ( xIter and yIter), because the grid is cruedly outputted to the console.
How are you initialising the vert arrays?
GLfloat vVerts[12];
It compiles and runs great. It's just that it does'nt do what it should and that the debugger keeps telling me about these access violations.
[editline]31st July 2012[/editline]
Ok, I got the Cells to draw now, but the program is very unstable, now crashing after a while of resizing the window with the following error:
HEAP: Free Heap block 3742f0 modified at 37430c after it was freed
[QUOTE=T3hGamerDK;37003497]Whichever would you guys prefer? size_t or unsigned int?
I'm currently using unsigned int, after having transfered from size_t as it required <cstring>.[/QUOTE]
size_t is actually defined in <cstddef>, not <cstring>. It's included in <cstring> because it's used in the declaration of functions like strlen().
Anyway, size_t is preferable because it's guaranteed to be big enough to represent the size of anything that fits in your address space; an integer isn't. For example, unsigned int is typically 32 bits even on a 64-bit system, but you might have a 5GB array.
Is the word Battlefront copyrighted by Lucas Arts in any ways?
I want my game to be named: Paradox: Battlefront
:D And it has concepts similar to battlefront, like two teams with a certain amount of players.
[QUOTE=Wyzard;37026011]size_t is actually defined in <cstddef>, not <cstring>. It's included in <cstring> because it's used in the declaration of functions like strlen().
Anyway, size_t is preferable because it's guaranteed to be big enough to represent the size of anything that fits in your address space; an integer isn't. For example, unsigned int is typically 32 bits even on a 64-bit system, but you might have a 5GB array.[/QUOTE]
I'll keep that in mind. And I didn't know it was defined there, my compiler advised me to include <cstring> to get size_t (as it wasn't defined, and I was compiling with clang. I guess it got that one a bit wrong).
I'll start using size_t again then, thanks to you all!
[QUOTE=Hack;37026067]Is the word Battlefront copyrighted by Lucas Arts in any ways?
I want my game to be named: Paradox: Battlefront
:D And it has concepts similar to battlefront, like two teams with a certain amount of players.[/QUOTE]
[URL="http://tess2.uspto.gov/bin/showfield?f=doc&state=4001:nn3v98.2.1"]It's trademarked, yes.[/URL] (Actually, it's currently awaiting a Statement of Use; if that's not sent by November 8, 2012, then the trademark will expire.)
[QUOTE=ShaunOfTheLive;37026523][URL="http://tess2.uspto.gov/bin/showfield?f=doc&state=4001:nn3v98.2.1"]It's trademarked, yes.[/URL] (Actually, it's currently awaiting a Statement of Use; if that's not sent by November 8, 2012, then the trademark will expire.)[/QUOTE]
Alright I guess I will be naming my game something else :D Probably Paradox: War or some random shit lol
I knew making a thread for what I'm about to ask is unnecessary so I might as well ask here, would it be smart to start working with CE3 if I know only the basic syntax of C++ but more than enough about Lua?
if so can anyone help me start off, the wiki really isn't all that helpful :v:
Understanding and using a massive complicated framework is a challenge even for a proficient C++ programmer.
So It's upto you what you want to do but I wouldn't consider it smart.
Gah, been using codecademy.com or something like that to learn java but lots of the courses are just unclear. Anyone that can send me a link to somewhere good to learn javascript and/or add me on Steam to help when I get stuck?
[QUOTE=Confuzzed Otto;37031217]Gah, been using codecademy.com or something like that to learn java but lots of the courses are just unclear. Anyone that can send me a link to somewhere good to learn javascript and/or add me on Steam to help when I get stuck?[/QUOTE]
You seem to be using the terms Java and Javascript interchangeably. Java is not the same as Javascript.
I need to write a simple program but I need that same program to work across Windows and Android. Is there anything out there which can help me with that?
I was thinking Unity, It's not a game I am making but it is a graphics based GUI. Bit of a sledgehammer to crack a nut though.
Actually, Maybe something web based using HTML5 Web sockets or simple AJAX would work. Not a daft idea at all since the application it controls could easily host a small web server... it would cover all decent platforms in one go.
But yeah, if anyone has any ideas, help is much appreciated!
Tezzanator, sounds like it could be done in PHP although your requirements are none too specific.
-----------------------------
[B]My question: [/B]
Is it possible to make calls to Source Engine functions from outside a game? In particular I'm interested in getting the names of the current player entities and displaying them in a different program without requiring a client plugin.
The purpose would be so that [url=http://natf2.com/topics/6320]my SourceTV application[/url] can be used without needing the host server IP as the player names could just be taken from the STV entities.
[QUOTE=atmo;37032339]Tezzanator, sounds like it could be done in PHP although your requirements are none too specific.
-----------------------------
[B]My question: [/B]
Is it possible to make calls to Source Engine functions from outside a game? In particular I'm interested in getting the names of the current player entities and displaying them in a different program without requiring a client plugin.
The purpose would be so that [url=http://natf2.com/topics/6320]my SourceTV application[/url] can be used without needing the host server IP as the player names could just be taken from the STV entities.[/QUOTE]
You can always read from RAM and detect these kind of things, but I think the easiest way is to do a server or client plugin.
Thanks for the reply.
Sadly the easier methods to code are the harder methods to put into use ... it's difficult enough to convince teams to give SourceTV connect strings before matches without then asking them to install a plugin as well (if they even knew how), and Valve have a history of not ever signing client plugins which means the game would have to be run in -insecure which creates other issues.
How would I go about reading it from RAM? There is actually already a client plugin (unsigned of course) which goes part of the way towards doing what I want.
[url]https://github.com/miek/spectate_helper_plugin/blob/master/spec_plugin.cpp[/url]
You can see lines 99-110 and 270 onwards implementing the process I'm interested in, but obviously this is run within the game and in -insecure.
[QUOTE=MakeR;37031391]You seem to be using the terms Java and Javascript interchangeably. Java is not the same as Javascript.[/QUOTE]
I know, I just forgot to put the script after java. What's the difference though?
I'm trying to learn to make small and simple 2d games as a start but first I need to learn a language (I think). Someone said javascript and I tried it, but are there any better ones to use?
[QUOTE=Confuzzed Otto;37032827]I know, I just forgot to put the script after java. What's the difference though?
I'm trying to learn to make small and simple 2d games as a start but first I need to learn a language (I think). Someone said javascript and I tried it, but are there any better ones to use?[/QUOTE]
The difference is that Java and Javascript are two entirely different languages, just like how C++ and Java are two entirely different languages. And no, I don't really know why they have such similar names.
Sorry, you need to Log In to post a reply to this thread.