
-----------------------------------
AFG34
Sat Jun 16, 2007 3:23 pm

&quot;Variable has no value&quot; error
-----------------------------------
Hi
I am making a shooting game where there is a target, and the close you shoot to the centre of the target, the more points you earn. You only get to shoot for 30 seconds though. I am having difficulty with adding a high score. When i get a high score in game, it calls upon a procedure which asks you for your name and then stores it. But i cant call it i get this:



http://i19.tinypic.com/543ssd2.jpg
variable has no value

Can someone please tell me what i am doing wrong?



Also i have uploaded the game with all the files for you guys for some feedback:
http://www.megaupload.com/?d=AX4MQ5PJ

Please give it a try and i am open for feedback :)

-----------------------------------
Tony
Sat Jun 16, 2007 5:16 pm

RE:&quot;Variable has no value&quot; error
-----------------------------------
well it just means that either score or list(7).score (or both actually) have no value.


var foo:int % has no value
var bar:int := 42 % has value of 42


So just don't forget to initialize all the variables to some default value (for scores, it would likely be 0 ).

-----------------------------------
AFG34
Sat Jun 16, 2007 6:10 pm

Re: &quot;Variable has no value&quot; error
-----------------------------------
i have score set to zero, before the game starts

and list(7).score is set to 300.

-----------------------------------
Clayton
Sat Jun 16, 2007 6:19 pm

RE:&quot;Variable has no value&quot; error
-----------------------------------
Just a query: Why is an if statement that only has one option in an infinite loop? Get rid of the loop around that if statement. Also, nowhere do I see that you have given list (7).score the value of 300 like you said you have.

-----------------------------------
AFG34
Sat Jun 16, 2007 7:05 pm

Re: &quot;Variable has no value&quot; error
-----------------------------------
I have written it to the data file: high_scores
In the main menu, click on high scores, and you will see.

And thank you both for your replies :D

-----------------------------------
AFG34
Sat Jun 16, 2007 8:33 pm

Re: &quot;Variable has no value&quot; error
-----------------------------------
edit: I did a little tweaking and it works now :P

But the ranks don't work. For example if you score between certain numbers, i have it so it gives your a rank, like n00b or godl1ke.

Here is the updated code: http://www.megaupload.com/?d=U9H0DDFT

if you dont like mega upload, give me a link to another host thats more suitable for you.


Thanks for your reply m8 :D



EDIT:  Ok did a little more tweaking and finally got it to work. When im done i will post the complete game.
