Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 25 Sep 2012
Offline Last Active Dec 14 2012 10:29 AM

Posts I've Made

In Topic: Need a little help with text game

17 October 2012 - 10:00 AM

If I'm understanding you correctly, you would like to load a file from a string rather than a digit, that is you would like to load "b.txt" instead of "1" or some variation of that. To do this you can change:
[source lang="cpp"]fgets(file, "%d\n", &locsToGo[t]);[/source]
to load the a string into locsToGo instead of an int.
The declaration of locsToGo would be:

[source lang="cpp"]#define FILENAME_LEN 10char locsToGo[100][FILENAME_LEN];[/source]

Hope this helps and good luck with your text game. :)

In Topic: While loop trouble

13 October 2012 - 11:14 AM

I'm Unable to see the second part of the code. I had this problem before, try an replace all <= into < because the code tags break when they see <= for some reason. It is also better for help_credits to be compared to zero like this: help_credits <= 0 because this is safer than help_credits == 0. I'm going to have to see the rest of the code before I can tell why it is unresponsive.

In Topic: Is this a case for smart pointer usage or is my design wrong,help needed.

13 October 2012 - 01:02 AM

Sednihp is right you should not have the unit controlling the particle but the particle system. Once it is spawned the particle should not need the the emitter at all. This is the best way to implement it and how professional particle systems work.

In Topic: While loop trouble

12 October 2012 - 11:36 AM

Yes you need to follow this format for this to work correctly:
[source lang="python"]#Initialize herewhile True: #Some code can go here while game: # First while loop code here # Transition code here while elect_new: # Second while loop code here # More Transition code here[/source]

If you do not have an outer while loop, it will not return back to the first loop.

In Topic: While loop trouble

12 October 2012 - 11:29 AM

From what I understand now both while loops are not inside an outer loop are they? If they are, ensure that the code loops back around to the beginning and that p is above 15. If not you need a while loop that wraps around both inner while loops.
The reason why I suspect this is because you have no indent in front of your while loops in your pasted code. Did you remove the indentation when you pasted the code?