Computer Science Canada RPG Game - Varriable has no value |
Author: | Degensquared [ Tue Sep 11, 2007 2:25 pm ] | ||
Post subject: | RPG Game - Varriable has no value | ||
I am trying to write a game after my first week of turing lessons, and I keep getting the error "variable has no value" although I am sure that I have set those values. This might be the order of my proccess, I have found out how to make a temporary fix by declaring them in the input step, but this just resets the round # to zero and player health to full, which is inconvenient.. I would like some help please XD
|
Author: | MichaelM [ Tue Sep 11, 2007 2:58 pm ] |
Post subject: | Re: RPG Game - Varriable has no value |
I found youre problem. I noticed that your variables roundnumber, playerhealth, playermana and playeraction are declared both at the beginning of your program, and in your input proc. Inside the proc they are created as local variables, which at that point have no value. You also have global variables with the same names (which you declared at the start of your program), however your proc is using the local variables, such as roundnum, which has no value currently. It looks to me like these declarations in your proc are unnecessary and are what cause the problem. Just to test it out, I commented out variables roundnumber, playerhealth, playermana and playeraction from your input proc, and then it runs fine. A pretty cool game if i may add, however if you keep playing it you'll notice that as the screen scrolls down the background is no longer white. Good Luck, I hope that helps. |
Author: | rdrake [ Tue Sep 11, 2007 3:30 pm ] |
Post subject: | RE:RPG Game - Varriable has no value |
Oh my... Might I recommend creating a class to represent the player? This should get you started. |
Author: | CodeMonkey2000 [ Tue Sep 11, 2007 3:57 pm ] |
Post subject: | RE:RPG Game - Varriable has no value |
Silly grade 10 classes, they teach you to make silly games, rather than teaching proper programming techniques. |
Author: | Degensquared [ Tue Sep 11, 2007 6:24 pm ] |
Post subject: | RE:RPG Game - Varriable has no value |
Tyvm! I hope this solves it (I was unsure whether turing differentiated between local and global XD) I just need to wait until I can test this out at school tomrrow (darn holtsoft and their pricey compiler!) |
Author: | Tony [ Tue Sep 11, 2007 6:44 pm ] |
Post subject: | Re: RE:RPG Game - Varriable has no value |
Degensquared @ Tue Sep 11, 2007 6:24 pm wrote: I just need to wait until I can test this out at school tomrrow (darn holtsoft and their pricey compiler!)
OpenT should be able to compile Turing programs soon.. ish. Stay tuned! Or better yet, find out how you can contribute to the project. |
Author: | Nick [ Tue Sep 11, 2007 6:47 pm ] |
Post subject: | RE:RPG Game - Varriable has no value |
hey i've been seeing a lot of turing problems ever since school has started and thats why i worte this a bit back (like a month or so iunno... not important) its a guide to help ur program... debugging as its called... here is the link |
Author: | Degensquared [ Tue Sep 11, 2007 7:37 pm ] |
Post subject: | Re: RE:RPG Game - Varriable has no value |
Tony @ Tue Sep 11, 2007 6:44 pm wrote: OpenT should be able to compile Turing programs soon.. ish. Stay tuned! Or better yet, find out how you can contribute to the project. I'd love to help out if I knew anything more than basic programming XD, If there are any other jobs that didn't require me to understand a heck of a lot of programming, I'll help out in a heart beat(I think it's being written in java right?). I'm reading up on classes, as we speak, hoping to learn how to incorporate that into my game for when I can start tomorrow. |
Author: | Tony [ Tue Sep 11, 2007 8:16 pm ] |
Post subject: | Re: RE:RPG Game - Varriable has no value |
Degensquared @ Tue Sep 11, 2007 7:37 pm wrote: I'd love to help out if I knew anything more than basic programming
There's more to it than just programming. There's testing and documentation and a load of other things to do. For example, right now we are looking for a new logo design. Or simply increasing the awareness and finding more people who would be interested in the project would help as well. |
Author: | Nick [ Tue Sep 11, 2007 8:19 pm ] |
Post subject: | RE:RPG Game - Varriable has no value |
i didnt know u needed help testing.. id be glad to help ![]() |
Author: | Degensquared [ Tue Sep 11, 2007 8:34 pm ] |
Post subject: | Re: RPG Game - Varriable has no value |
Hey I'd love to try my hand at a logo, XD I'm pretty handy with that there Photoshop ![]() Testing would also be an option ![]() |
Author: | Tony [ Tue Sep 11, 2007 8:59 pm ] |
Post subject: | RE:RPG Game - Varriable has no value |
Well here's the OpenT logo contest thread. At the very least, make a post about your interest in the subject - they might extend the date. Talk to rizzix and rdrake about what you could do to contribute. |
Author: | d2bb [ Thu Sep 13, 2007 4:50 pm ] |
Post subject: | Re: RE:RPG Game - Varriable has no value |
CodeMonkey2000 @ Tue Sep 11, 2007 3:57 pm wrote: Silly grade 10 classes, they teach you to make silly games, rather than teaching proper programming techniques.
lol. i used to be like that. little more practice and 100% better. |