[QUOTE=Mr. Smartass;33713745]I'm teaching myself XNA with riemer's tutorials, and I ran into this issue. What am I doing wrong here?
Error on compile is
[/QUOTE]
You are using the effect in loadModel before its loaded.
effect = Content.Load<Effect>("effects");
put that above your call to loadModel.
[QUOTE=Naarkie;33715410]This isn't a programming question, rather a UI/extension question. I got Visual Studio Ultimate today, and I installed the Productivity Power Tools addon. I like it so far, just that it adds a bloody annoying line in the cursor position that doesn't fit with my colour scheme. How do I disable it?[/QUOTE]
[img]http://goo.gl/OYAJ9[/img]
Nevermind, above post helped and got it right. :v:
Any good tutorials on C# chat programs / sending values over the intrawebs. Aka making games multiplayer and so on?
[QUOTE=high;33718214]
[img]http://goo.gl/OYAJ9[/img][/QUOTE]
Wow, can't believe I missed that option. Thanks once again.
[QUOTE=DestWa;33719052]Any good tutorials on C# chat programs / sending values over the intrawebs. Aka making games multiplayer and so on?[/QUOTE]
[URL="http://code.google.com/p/lidgren-network-gen3/"]Lidgren[/URL]
While I don't have a tutorial, this has decent documentation on the wiki, you should be able to figure out what's what.
[QUOTE=ZeekyHBomb;33708002]-1.#IND seems to stand for indefinite or something.
You could check if clock.GetElapsedTime() returns 0 and if so just skip the updating.[/QUOTE]
What do you mean skip updating? If you mean updating the object, then I'm not sure how to check for -1.#INF as that's what I get for dt because its 1 / 0. If you mean skipping the whole while loop, then that would make the next frame be 0 s too and wouldn't solve anything.
Anyway, I fixed it by just moving the clock down, and initializing dt to 0 for the first frame.
Thanks for the help everyone <3
I'm compiling a program that links against a shared library, how do I get it to compile to an object file without errors? It doesn't let me because it thinks that the references to types and functions from the library are undefined.
Actually, it's only erroring with types.
Will do. I've just been caught up with getting some stuff established for this new job I got.
I'm curious about what the an Assembly Emulator should be capable of.
I messed with one but my trial ran out. I want to make my own to distribute freely.
The emulator i tampered with, I don't think it could access files, but it used registries (obviously) and tracked their data, and ... did some other stuff.
I just really think it'd be an interesting project to work on.
So is this list of features short? or does this need a lot of detail?
Thanks!
C++
Is there any way to take a string variable and add a sign to it? For example, I have a string that recieves a user input, now I want to add a ':' sign to it at the end, how can I do this?
[QUOTE=Meatpuppet;33715302]thanks, although I still don't understand. 6%7 is not 0, but it is also not prime.[/QUOTE]
[QUOTE=landizz;33721356]C++
Is there any way to take a string variable and add a sign to it? For example, I have a string that recieves a user input, now I want to add a ':' sign to it at the end, how can I do this?[/QUOTE]
does
[code]
string + ':' ;
[/code]
not work?
Why isn't this working?
[img]http://puu.sh/aEvG[/img]
When i replace dagen[d][u] with dagen[1][4] (Random ints instead of using the ones from the for loop) it suddenly works..
[QUOTE=landizz;33721356]C++
Is there any way to take a string variable and add a sign to it? For example, I have a string that recieves a user input, now I want to add a ':' sign to it at the end, how can I do this?[/QUOTE]
str.append(":");
[url]http://www.cplusplus.com/reference/string/string/append/[/url]
[QUOTE=Meatpuppet;33715302]thanks, although I still don't understand. 6%7 is not 0, but it is also not prime.[/QUOTE]
The % operator returns the remainder of two numbers. It's very useful when trying to find if a number is divisible by another. The way it works is if you have a number like 1 and divide it by 3, you would use 1%3 and the answer would be 1, the same goes for 2; 2 % 3 = 2, however if the number is divisible, it will return 0, so 3 % 3 = 0.
What the program does at that stage is test if the number it's checking is divisible by a possible factor. If the number is divisible, the remainder will be 0 and escape the loop and the number was found to be not prime, however if it returns a number other than 0, it will continue to check the possible factors until there are none left. Once there are no more possible factors to check, the loop will finish and the number was found to be prime.
-snip-
I just finished a school C++ assignment.
I'd appreciate if some people looked and commented on it.
[url]https://github.com/TheLinx/Cinema/[/url]
Oh, and this is a [u]very[/u] basic course. Don't expect anything remotely advanced.
[QUOTE=thelinx;33726075]I just finished a school C++ assignment.
I'd appreciate if some people looked and commented on it.
[url]https://github.com/TheLinx/Cinema/[/url]
Oh, and this is a [u]very[/u] basic course. Don't expect anything remotely advanced.[/QUOTE]
A couple things I've found. You could add something that doesn't accept negative numbers in the entry. I could return -5 tickets and it would show that I've bought 5 tickets. Also, when entering a letter in an entry that requires numbers, it will go into an infinite loop.
[QUOTE=Niteshifter;33726406]Also, when entering a letter in an entry that requires numbers, it will go into an infinite loop.[/QUOTE]
Ah, yeah. Any clues on how to fix that? I thought the fflush would do the trick but I guess not.
Also, any tips on how to read from the file so I can have spaces in movie names?
I'm using C++ and SFML.
Say I have this sprite of a plane that rotates around it's center. How would I go about finding the locations of the guns after the rotation so that I can make it fire from the guns regardless of orientation?
[QUOTE=Jacen;33726629]I'm using C++ and SFML.
Say I have this sprite of a plane that rotates around it's center. How would I go about finding the locations of the guns after the rotation so that I can make it fire from the guns regardless of orientation?[/QUOTE]
Read about vectors: [url]http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/[/url]
The exact info you're looking for is like in part 2
basically, the center of your sprite is (0, 0)
a cannon position might be offset (4, 10) from that. rotate that (4, 10) vector by the rotation of the whole sprite, and use that as an origin for the bullets
[QUOTE=thelinx;33726666]Read about vectors: [url]http://blog.wolfire.com/2009/07/linear-algebra-for-game-developers-part-1/[/url]
The exact info you're looking for is like in part 2
basically, the center of your sprite is (0, 0)
a cannon position might be offset (4, 10) from that. rotate that (4, 10) vector by the rotation of the whole sprite, and use that as an origin for the bullets[/QUOTE]
Thanks. I don't know why I never though about using vectors.
I have another problem that relates to the last one. I have a couple sf::Vector2fs that point to their respective guns and I'm trying to rotate them based on the plane's rotation.
Here's the code for the left:
[code]sf::Vector2f old = attachment1;
attachment1.x = (std::cos(rotation) * old.x) - (std::sin(rotation) * old.y);
attachment1.y = (std::cos(rotation) * old.y) - (std::sin(rotation) * old.x);[/code]
Then when I add a new bullet to bullet list it gets placed at the plane's position + the attachment vector.
The problem is that the bullets are always being placed at the center of the plane. I wrote the attachment's values to the console and for the most part it's always zero.
If I comment out the code to rotate the vector then the bullets come out of the positions where the (obviously) non-rotated vectors point.
Not sure what's going wrong here? None of my prints get printed. It just does nothing, control-C doesn't do anything, I have to kill it from task manager.
[code]
#include<SFML/Window.hpp>
#include<iostream>
int main() {
std::cout << "Hi from main method!" << std::endl;
sf::Window myapp(sf::VideoMode(800, 600, 32), "My SFML Window");
std::cout << "I just created the window!" << std::endl;
bool run = true;
sf::Event windowEvent;
while (run) {
/*
while (myapp.GetEvent(windowEvent)) {
if (windowEvent.Type == sf::Event::Closed) run = false;
}
*/
myapp.Display();
std::cout << "Hi from main loop!" << std::endl;
}
return EXIT_SUCCESS;
}
[/code]
I'm compiling it with this:
[code]
g++ -c myapp.cpp -o myapp.o
g++ myapp.o -o myapp.exe -lsfml-window -lsfml-system
[/code]
I see you're using SFML 1.6, Laurent has stated that it has problems with the latests ATI drivers (from a long time ago), It's the reason why the program "freezes" like you're experiencing.
You should really convert to 2.0
[QUOTE=AtomiCasd;33732373]I see you're using SFML 1.6, Laurent has stated that it has problems with the latests ATI drivers (from a long time ago), It's the reason why the program "freezes" like you're experiencing.
You should really convert to 2.0[/QUOTE]
Ah okay. I do have an ATI card with recently updated drivers. That worked, window shows fine now. Cheers!
So I have this file [url]http://projecteuler.net/project/names.txt[/url]
And I'm trying to read in the names from it one by one, using this
[cpp]fscanf(file, "\"%s\",", buffer);[/cpp]
However instead of getting one name and stopping, it tries to put the entire file except the first " in the buffer. How do I get it to stop at the , ?
[QUOTE=Niteshifter;33725602]The % operator returns the remainder of two numbers. It's very useful when trying to find if a number is divisible by another. The way it works is if you have a number like 3 and divide it by 1, you would use 3%1 and the answer would be 1, the same goes for 2; 3 % 2 = 2, however if the number is divisible, it will return 0, so 3 % 3 = 0.
What the program does at that stage is test if the number it's checking is divisible by a possible factor. If the number is divisible, the remainder will be 0 and escape the loop and the number was found to be not prime, however if it returns a number other than 0, it will continue to check the possible factors until there are none left. Once there are no more possible factors to check, the loop will finish and the number was found to be prime.[/QUOTE]
These examples are backwards. 1%3 is 1, 3%1 is 0. A tip to remember is modulus of any number by a larger number returns the original number.
[QUOTE=artanis;33733355]These examples are backwards. 1%3 is 1, 3%1 is 0. A tip to remember is modulus of any number by a larger number returns the original number.[/QUOTE]
Ah, you're right. I've fixed it, thanks for pointing that out.
Mental note to self - talking to a faulty shader as if it was a frightened child does not help.
[QUOTE=artanis;33733355]These examples are backwards. 1%3 is 1, 3%1 is 0. A tip to remember is modulus of any number by a larger number returns the original number.[/QUOTE]
Thanks.
Sorry, you need to Log In to post a reply to this thread.