Computer Science Canada

Guitar hero Help

Author:  death bringer [ Tue Jun 24, 2008 1:14 pm ]
Post subject:  Guitar hero Help

Ok so what im really wanting help with is positioning the keys. I know a longer way of doing this (see lines 431-434) but im just wondering is there a faster way of doing this because I don't feel like placing the keys 914 times (only have 105 done) anyways Can someone help me so this can be done faster? But still keeping the game the way it is. Also is there some things i can do in the code to make it more neat? open to all comments and ideas

Author:  MichaelM [ Tue Jun 24, 2008 2:56 pm ]
Post subject:  Re: Guitar hero Help

Well, I'd like to offer some help, but when I try to run it, I get "illegal picture ID number '0'. (On line 32). Did you forget to include one of the pictures?

Also, its very difficult to see how to help (starting line 431) when your code is not properly indented. When its all in one huge horizontal line its very hard to read
and understand. If indentation is not a habit, I suggest using ctrl+i , which does it for you. In this case, since there is so much to indent Turing does not have
enough memory to indent it. I began to do it manually, and I think I see the pattern in your code which can probably be simplified using loops. Otherwise, to quicken a long sequence of ifs you can use elsifs.

Heres my suggestion based on a small section of that big line of ifs. I based it on my assumption that your comparisons are always going up by twos, and your assingment to the variable notesdiff is going from 1 to 5 then back down to 1 (1,2,3,4,5,4,3,2,1,2,3,4,5 and so on). If this pattern does not continue, the following code may not work for all the way to 914 notes or whatever.

First of all, elsifs will shorten the length of your code (see tutorial: http://compsci.ca/v3/viewtopic.php?t=14656&highlight=elsif) as follows

code:

if totalnotes > 1 then
    DIFF := 150
elsif totalnotes > 3 then
    notesdiff := 3
elsif totalnotes > 5 then
    notesdiff := 4
elsif totalnotes > 7 then
    notesdiff := 5
elsif totalnotes > 9 then
    notesdiff := 4
elsif totalnotes > 11 then
    notesdiff := 3
elsif totalnotes > 13 then
    notesdiff := 2
elsif totalnotes > 15 then
    notesdiff := 1
end if


However, the above will not help in your case, since Turing looks over these ifs chronologically, and once one of them is met, the check is complete.
Ex. if totalnotes is 4, the first if just wants greater than 1, and 4 is greater than 1, so notesdiff would be 1. I am guessing that you want notesdiff to
be 3 when totalnotes is 4. You'll have to fix that for checking if totalnotes is between certain numbers.
Your ifs check greater than 3, and then greater than 5. Im guessing your greater than 3 wants the numbers that are greater than 3, but not greater
than 5, meaning the numbers 4 and 5 are acceptable. You'll need two checks in each line to do that:

code:

if totalnotes > 1 and totalnotes<4 then
    DIFF := 150
elsif totalnotes > 3 and totalnotes<6 then
    notesdiff := 3
elsif totalnotes > 5 and totalnotes<8 then
    notesdiff := 4
elsif totalnotes > 7 and totalnotes<10 then
    notesdiff := 5
elsif totalnotes > 9 and totalnotes<12 then
    notesdiff := 4
elsif totalnotes > 11 and totalnotes<14 then
    notesdiff := 3
elsif totalnotes > 13 and totalnotes<16 then
    notesdiff := 2
elsif totalnotes > 15 and totalnotes<18 then
    notesdiff := 1
end if


Now thats still a lot of code to go all the way to 914, but the between checks are always going up by twos, and notesdiff is 1 to 5 and down to 1.
The following should help, although the loop is still a little lengthy ( still shorter than 914 lines or so Smile )

code:

for interval:1..number_notes by 16 %you can treat 1,2,3,4,5,4,3,2 as one block, which is 8 numbers
                                   %but each check is by twos, so you'll go by 16, which will continue
                                   %that cycle 
    if totalnotes>interval and totalnotes<(interval+3) then   %if its between say 1 and 4, then its 1
        notesdiff:=1
    elsif totalnotes>interval+2 and totalnotes<(interval+3+2) then  %if its between 3 and 6, then its 2 (and so on)
        notesdiff:=2   
    elsif totalnotes>interval+4 and totalnotes<(interval+3+4) then  %I showed it in +3 and +4 instead of +7 so you see the pattern
        notesdiff:=3     
    elsif totalnotes>interval+6 and totalnotes<(interval+3+6) then
        notesdiff:=4     
    elsif totalnotes>interval+8 and totalnotes<(interval+3+8) then       
        notesdiff:=5
    elsif totalnotes>interval+10 and totalnotes<(interval+3+10) then
        notesdiff:=4   
    elsif totalnotes>interval+12 and totalnotes<(interval+3+12) then
        notesdiff:=3     
    elsif totalnotes>interval+14 and totalnotes<(interval+3+14) then
        notesdiff:=2   
    end if
end for


I hope that helps quicken your task, although I cant get your code to run, so I don't know if it works properly, or If I made some errors.
It still seems like I could shorten the loop a little. Oh well, i hope I at least gave you some ideas of how to use loops to help you shorten lengthy ifs.

Good luck, and I look forward to seeing the finished product Very Happy

Author:  DemonWasp [ Tue Jun 24, 2008 3:25 pm ]
Post subject:  RE:Guitar hero Help

First, to answer your specific question: it looks like you're repeatedly setting notesdiff based on which note the player has gotten to in the song (or something like that). This can be done MUCH better by using an array of notesdiff values; you can then load all those values from a file using maybe 10 lines of code, total.

This provides the additional massive benefit that you don't have to hard-code every single song - you can just choose your [song name].song file and then run using that. I can provide additional hints and help if you need them, but you're probably better off thinking it through on your own first.

Also, congrats on using types - they're one of the topics that isn't part of the standard curriculum, as I recall. I certainly wasn't taught types in school until grade 12. Sad

To make your code better:
This isn't intended to be harsh criticism, just stuff you should do to make your code better. Just because you don't do all of these doesn't make you a bad coder - but doing all of them will make your code much easier to read, maintain and help with. So, in no particular order:

1. Choose more descriptive variable names. I know that "notesdiff", "multiply" and so on make perfect sense to you right now, but they don't mean very much to me, or anybody else - and if you left the code alone for 6 months or so and then came back, you'd probably experience the same effect. Generally, the standard is something like "how it would read in a sentence"...so instead of "diffgame", one of "gameDifficulty", "game_difficulty", "GameDifficulty" would be expected. Capitalisation and use of underscores depends on environment, language, and your coworkers (though Turing has no established standard for how to name variables / functions / procedures / types).

2. Comment to describe HOW things work. It's good to start with "these are the end game functions", but without any explanation of what each part does, and how it does it, I'm pretty lost. Reading the code takes a lot longer than reading a comment, and writing a comment doesn't take long at all. It also helps out a lot if your comment is different from what the code seems to be doing - then you know one of the two is wrong.

3. Try hitting F2. Your code should be properly indented at all times. It makes blocks (if-end if , loop-end loop , for - end for , proc - end , function - end, etc) MUCH more obvious, and makes determining the flow of control way easier. Alternately you could indent properly on your own (I did this, as I had a different indentation scheme than Turing liked - less spacing out).

4. This is a recommendation in general, but I'm going to use a specific example to show it. In a few different places you have a lot of equations with the same computation in them, such as "sqrt (node (i).p.z)))". In this case, for both readability and performance, it's best to make a temporary variable (a descriptively-named one) that stores that value and is used in the calculations. That way, you don't have to do "sqrt (node (i).p.z)))" over and over and over.

Author:  death bringer [ Tue Jun 24, 2008 8:04 pm ]
Post subject:  RE:Guitar hero Help

Ok for line 35 just delet it sorry and you can run the program also i will look over my code and use what you have said anything else I should know or does anyone also have a faster way of doing this?

Author:  DemonWasp [ Wed Jun 25, 2008 7:35 am ]
Post subject:  RE:Guitar hero Help

On running the game, it looks like you've done a pretty good job. Some nitpicks/advice:

Unrelated to speed, some suggestions on the game:
1. You really need some better feedback about whether I'm missing or hitting notes - I can't tell if I am or not.
2. That song is insanely hard, and I'm a terribly Guitar Hero player. If you switch to using files, I can play something more my speed (perhaps Mary had a little Lamb).
3. As mentioned, I'm terrible. Even so, I was able to hit a 700 note streak before the song ended. How? Your program checks that I hit each note, but it doesn't actually check that I strum for each one, so if I just hold down Enter and hold down the right keys for the notes, I get them. It also doesn't appear to check that I don't press other keys (ie I shouldn't be able to play 3 keys if it only wants one, but I can).
4. What the devil are those box things? They're annoying, and appear to be malfunctioning.
5. Cute loading screen, but you should know it looks a little fake (nothing ever loads that smoothly).
6. Generally, a GH game starts with a little bit of space between where you have to hit the notes and where they start.
7. You might want to draw pegs that are further away before ones that are closer - this prevents weird issues with further pegs appearing over nearer ones.
8. The multiplier display doesn't like actually displaying a number until I get to X8, where it sticks.

Speed-wise, I really can't comment. The machine I'm on is basically the supercomputer of home systems, so I had absolutely ZERO speed issues. If you can give more information about what "feels" slow, then I may be able to help you there.

Author:  death bringer [ Wed Jun 25, 2008 11:16 am ]
Post subject:  RE:Guitar hero Help

Ok I also Might decide To do a song from guitar hero 3 the one im playing on (I Play Expert thats why my programs so hard sorry ;pWink also in the past i had my guitar hero using random integers so you could change diffgame (a var) and diffgame would affect speed, spacing, and make it easy medium or hard. For the multiplier I know it some what jibs out but To get the star power going and make the multiplier double is causeing problems mathimaticly also what do you mean by those box things? loading screen is fake but it was mainly to prepair the player form the game so he/she has more time to get ready.
(PS. all acuall loading is done before running) Also the speed is the running without lagg if thats what you are saying it's just the game spacing i would like to be able to change it but whenever I attempt to change the var DIFF nothing happens know how i can fix it? Lastly for the difficulty I would have to keep it at a consitant because i dont know what i would do for positioning if the diff was changed (i'm sure it would take a long time for me to do this)
anyways again thank you and iif possible post more thing i can maybe do to make this program better cause i am starting to reach my limit of what i think I should do next.
kk now im goping to play my acuall guitar hero so i can find a good son to use for my program. Very Happy

Author:  DemonWasp [ Wed Jun 25, 2008 12:50 pm ]
Post subject:  RE:Guitar hero Help

First, I have a request: think through what you're going to post as clearly as you can, and post in complete sentences, with paragraph spacing, and a clear explanation of what you need / don't understand / want help with. I know this makes me sound like an ass, but I'm much more willing to help people who can communicate clearly. I'm having trouble understanding what you're wanting help with at times.

A lot of your problems seem to be with selecting difficulty for the song. Rather than doing something in your code, it's probably best to have something like this:

- <song name>.mp3
- <song name>_hard.song
- <song name>_medium.song
- <song name>_easy.song

Then, when the player selects their song, you can just look for the _hard, _medium and _easy files, and give them only the options that are available. Once they choose, load the .song file they chose and play that. This lets you use a different set of notes for each easy, medium and hard, as well as allowing for more than one song.

Try to implement that (make a backup copy of your code before making changes), then get back to us. Oh, and post an updated version of your code.

Author:  SNIPERDUDE [ Wed Jun 25, 2008 3:46 pm ]
Post subject:  RE:Guitar hero Help

death bringer seems to have organizational problems, lol.

But all doesn't seem to lost quite yet, thanks DemonWasp for helping out and taking your time to help others.
Smile

Author:  death bringer [ Wed Jun 25, 2008 7:40 pm ]
Post subject:  RE:Guitar hero Help

I do have trouble organizing, and spelling, all grammer, and well really just all of my english....
But I was starting to think of a way to do this positioning and still keep the same song

1. bring back my diffgame var for use

2 if diffgame=3
then fork easy
else if diffgame=4
then fork medium
else if diffgame=5
then fork hard

3 process easy
(then I do if's and else if's)
end easy

process ect ect

DO you think that this may work i will get back to you if it does or I find a new way of doing this.

Author:  DemonWasp [ Wed Jun 25, 2008 8:44 pm ]
Post subject:  RE:Guitar hero Help

It will work, but it's NOT an ideal way of solving the problem. The solution I have given you will make for a better program (and be easier to maintain). I'll describe it more clearly below. And thanks for posting more legibly.

You'll want something like this:

1. Player chooses [easy, medium, hard]
2. Load the song-file for their choice. It can still play the music from the "deathbringer" song you already have, all it has to do is read in a different set of notes for the player to play. Your file could look like the following (very basic version of the game, like what you have right now).
3. Play the game, using the information loaded from the file.

Example: deathbringer_easy.song (defines what keys need to be pressed.
code:

--x--
-----
---x-
-----
----x
-----
---x-
-----
--x--
-----


...etc. In this scheme, each line represents a set of keys to press at that time; a dash (-) means "don't press this one", while x means "you'd better press that one though". You would then use the lines of five dashes (-----) as spacers between the notes (remember, this is on easy). In the hard file, you might have something more like this:

code:

--x--
--x--
---x-
---x-
----x
----x
---x-
---x-
--x--
--x--


You'll note that these sections both take the same length of time (10 lines), so they'll line up with the song the same ... but the "hard" version would be substantially more difficult.

If you need help figuring out how to load the file, I can help you with that. I'm deliberately trying to leave some problems for you to solve on your own here.

Author:  SNIPERDUDE [ Wed Jun 25, 2008 9:42 pm ]
Post subject:  RE:Guitar hero Help

I saw one version where it was something like this, although I recomend what Demonwasp suggested

code:

00100 10
01010 5
01000 5

etc...


the first 5 are the frets obviously, and the number that follows is the delay time.

EDIT:

All of this talk about guitar hero makes me want to make a version, but that is at the end of a very long line of projects underway right now.

ANYWHO good luck to you.

Author:  death bringer [ Wed Jun 25, 2008 10:23 pm ]
Post subject:  RE:Guitar hero Help

OK I domewhat get what your saying but
How would i do the vars for this?

--x--
-x---
x----
-x---
--x--
---x-
----x

for example

PS I found out what was wrong with my Spacing and now i can control it (will post neater file l8r)

Author:  DemonWasp [ Wed Jun 25, 2008 11:03 pm ]
Post subject:  RE:Guitar hero Help

You could choose a lot of different variables to represent that. Consider exactly how it needs to be used:

1. Must be readable, one line at a time, from a file. This should take you perhaps 10 lines. I'm fairly certain you could do it in 4 if you thought about it for a minute.
2. Must be accessible to determine which notes are being played at any point in time.

So basically you just have to store a long (but known-length) set of lines (each of which is a string).

So, I would use an array of strings (keep in mind that you need to know the size of the array when the song loads, so you may want to put that at the top of the file):

code:

7
--x--
-x---
x----
-x---
--x--
---x-
----x


Then your access code should be really, really easy, as should your loading code - just check whether the character at the key-index (1 for the left-most, 5 for the right-most) is a dash or an X.

Author:  death bringer [ Wed Jun 25, 2008 11:24 pm ]
Post subject:  RE:Guitar hero Help

wow ok to be honest i dont know how i would still do this cause I ju finished grade 9 and I really was teaching myself how to use turing so um can you give me an example or help me out a bit cause I still don't know how to do the varriables for that I'm not the best in turing yet cause I learned from observeing

(ps I do understand a bit of what you are saying demonwisp but i just don't know what triggering i would use) would this be using arrays and vars or const also how would i get turing to read thats it's a space ( - ) or a key (x) I need more info for this.

Also i don't mind any critisism

Author:  DemonWasp [ Wed Jun 25, 2008 11:46 pm ]
Post subject:  RE:Guitar hero Help

Let me give you some more "formal" education then. Since you're not working on a summative project, I'll be more helpful than I would normally be.

"var" stands for "variable", which means that the value held by that thing can be changed (ie it can be 5 one moment, then 10 the next, etc).

"const" means that it's a "constant", so it never changes. Some examples you may already know are pi = 3.141592... and e = 2.718... .

"array" just means that it's a table of either variables or constants (or records, when you get to that point). Basically it's just a bunch of things that you can get the Nth one from at any time.

To get the value of a variable or constant, you just use its name. To get a single value from an array, you use it's name and a number:
arrayName ( indexNumber )

To solve your problem, you will need an array, capable of storing the same number of lines as you have in your file, of strings. You can do this like so:

Turing:
% Open a file for input. The "fileId" variable is used by Turing to track which
% file we want to access; "filename" should be replaced by the name of the file
% you want to load, and "read" means that we're reading from the file (using
% "get" only, never "put").
var fileId : int
open : fileId, "filename", read

% Variable initialisation for storage of the notes. 
var numNotes : int      % Contains the number of notes in the song
get : fileId, numNotes  % Get the number of notes from the song (first line)
var notes : array 1..numNotes of string % Make an array that's just big enough

% Load the notes from the file. Each element in the array will represent the
% n-th set of notes in the song. Once this has completed, you can access the
% n-th line in the song with < notes ( n ) >
for i:1..numNotes
    get : fileId, notes ( i )
end for


For each line in the file, you can then determine which is a space and which is a note by using an index into the string (it's like an array - the first letter is at (1), the second at (2) and so on). You would do something like:

notes ( lineNumber ) ( noteIndex )

where lineNumber is the number of the line you're looking at, and noteIndex is the number of the note (1 is leftmost, 5 rightmost).

If you have problems understanding or implementing that, I can help more, or we can move onto the next step of implementing the program. I'll wait for your response.

Author:  death bringer [ Thu Jun 26, 2008 12:12 pm ]
Post subject:  Re: Guitar hero Help

ok you had given me this

% Open a file for input. The "fileId" variable is used by Turing to track which
% file we want to access; "filename" should be replaced by the name of the file
% you want to load, and "read" means that we're reading from the file (using
% "get" only, never "put").
var fileId : int
open : fileId, "filename", read

% Variable initialisation for storage of the notes.
var numNotes : int % Contains the number of notes in the song
get : fileId, numNotes % Get the number of notes from the song (first line)
var notes : array 1..numNotes of string % Make an array that's just big enough

% Load the notes from the file. Each element in the array will represent the
% n-th set of notes in the song. Once this has completed, you can access the
% n-th line in the song with < notes ( n ) >
for i:1..numNotes
get : fileId, notes ( i )
end for


For the file load is that supposed to be a turing file or musicfile or what because i'm not geting what file you want me to load.
if this is a turing file i have to load while runing my program what's the deal with this?
What would the code be in the loaded file?
How would i do this?

As you can tell i've nv loaded a file in a game b4

Author:  DemonWasp [ Thu Jun 26, 2008 12:56 pm ]
Post subject:  RE:Guitar hero Help

There are a few different ways to distinguish files:

Text - these files are the kind that you write using Turing (your .t files), in Notepad (usually .txt and so on) and so on. These files are then human-readable when opened with Notepad or similar tools.
Binary - these files contain data in a more compressed format, and are unreadable to (most) humans. You need special tools to make sense of these files. Your .mp3 files fall into this category, as they contain song information represented as something other than letters - just straight numbers.

"Data" files - these contain information that your program will use, but do not actually contain code that gets executed. Your .mp3 file is an example of this: it just describes what the song sounds like; the program you use to play mp3 files describes HOW to play .mp3 files.
"Code" files - these are usually text files which contain code that tells the computer what you want it to do (such as your .t files)
"Executable" files - these tell your computer exactly what to do, without it having to try to understand the code files (which are designed to be human-readable, not machine-readable). These usually have a .exe ending, and will run without any special programs.

This solution requires the following:

1. Your CODE file (guitar_hero.t or whatever). This contains all of your Turing code, BUT it does NOT contain any information on where the notes are, and it has NO information on what the song sounds like.

2. The SOUND file (death_bringer.mp3 or whatever). This contains ONLY information describing the sound to be played - not information on where the notes are, nor does it contain any executable code.

3. The NOTES file (death_bringer_easy.song or whatever). This contains ONLY information describing where notes are. It does NOT contain more Turing code, and it does NOT contain song information.

When your program starts running, Turing reads your CODE file (#1) and figures out what to start doing. At some point, it comes across some code that tries to open the NOTES file (#3), and reads from that into your array variable. Then, it gets a Music.PlayFileReturn call that tells it to play the SONG file (#2), and the music starts playing.

As a footnote, you can use [ syntax = "turing" ] [ / syntax ] tags to highlight your code properly. This makes it a lot easier to read, and makes it easier for us to help you.

Author:  death bringer [ Thu Jun 26, 2008 1:48 pm ]
Post subject:  Re: Guitar hero Help

ok i made a notepad txt document but every time i load the document and run my pro gram i get this warning

Get attempted on incompatible stream number 1

whats this mean ?
(i will post my files)

also is it because i didn't set the document right or because i posted in a wrong area of my .t program or what?
btw thank you for still helping

Author:  DemonWasp [ Thu Jun 26, 2008 2:00 pm ]
Post subject:  RE:Guitar hero Help

First, I'm not seeing any usage of "open" in that code. Are you sure you sent the right version? (Remember, I told you to make a backup...you appear to have sent the backup instead of the file you're working on).

"Get attempted on incompatible stream number" just means that Turing couldn't find the file. The simple way to fix this (stupid) problem is to open Turing by double-clicking on your .t code file instead of double-clicking on Turing.

(Explanation)
When you start by running Turing.exe, Turing's default search path for your files is the path to the Turing.exe executable file...so it looks there, and doesn't see notes.txt, so it fails.

When you start by opening guitar_hero.t, Windows figures out that you want to start Turing, and sets its default lookup path to the path to your guitar_hero.t (and notes.txt) files, so it should find the file.

Author:  death bringer [ Thu Jun 26, 2008 2:59 pm ]
Post subject:  RE:Guitar hero Help

could you give me an example be cause to be honest i don't under stand maybe i'm just not ready to i dunno but i've been trying to get this I really have but I just dunno how you are loading and stuff. here's my cleaned up file

also may be if you have and exaple of one of your programs that loadis a file I could see it and maybe that would help me understand what you did to load.
if you infact do have a program that using a load can you point out what allows turing to use it?

Author:  DemonWasp [ Thu Jun 26, 2008 3:16 pm ]
Post subject:  RE:Guitar hero Help

Well, if you want to make a simple example, do the following:

1. Open Turing.
2. Make a new file, and give it this as its contents:
Turing:
% Open a file for input. The "fileId" variable is used by Turing to track which
% file we want to access; "filename" should be replaced by the name of the file
% you want to load, and "read" means that we're reading from the file (using
% "get" only, never "put").
var fileId : int
open : fileId, "notes.txt", read

% Variable initialisation for storage of the notes.
var numNotes : int      % Contains the number of notes in the song
get : fileId, numNotes  % Get the number of notes from the song (first line)
var notes : array 1..numNotes of string % Make an array that's just big enough

% Load the notes from the file. Each element in the array will represent the
% n-th set of notes in the song. Once this has completed, you can access the
% n-th line in the song with < notes ( n ) >
for i:1..numNotes
    get : fileId, notes ( i )
end for

% Output slowly, as an example
for i:1..numNotes
    put "Line ", i , " -> '", notes ( i ) , "'"
    delay (500)
end for


3. Save that file (as example1.t) to your desktop and exit Turing.

4. Right-click on your Desktop -> New -> New text file. This should make a new file with the Notepad icon named something like "New Text Document.txt". Rename it to "notes.txt" (without the quotes).

5. Open notes.txt and put the following in it:
code:
7
--x--
-x---
x----
-x---
--x--
---x-
----x


6. Save notes.txt and close Notepad.

7. At this point, you should have example1.t right next to notes.txt on your Desktop.

8. Double-click on example1.t to open it.

9. When you run example1.t, it will open notes.txt for reading, read the 7 (so it knows how many lines there are), then it will read the next 7 lines into the array notes(). It will then output them slowly, with line numbers and quotes around them.


*Edit: It's worth noting that I'm writing that code without the Turing program available, all from memory of years past. It may not work. Just let me know and I'll try it when I have access to Turing.

Author:  death bringer [ Thu Jun 26, 2008 6:25 pm ]
Post subject:  RE:Guitar hero Help

I got the same warning


Get attempted on incompatible stream number 1... was i supposed to open example1 in my guitar hero cause i keep getting the warning just running example 1
also is it that you can't download turing?

Author:  DemonWasp [ Fri Jun 27, 2008 9:48 am ]
Post subject:  RE:Guitar hero Help

* I'm not running Windows right now. I *can't* run Turing, even if I had the executable with me.

For the tutorial given above, COMPLETELY IGNORE your existing guitar hero code. It DOESN'T have anything to do with the tutorial.

Follow the instructions again, paying careful attention to do EXACTLY as the instruction says. Doing something "similar, but not exactly the same" won't help you in many cases.

Author:  death bringer [ Fri Jun 27, 2008 10:57 am ]
Post subject:  RE:Guitar hero Help

I did exactly what u had said but every time i run it i get a message on line 10 (get : fileId, numNotes) (message is Get attempted on incompatible stream number 1)

Author:  DemonWasp [ Fri Jun 27, 2008 12:32 pm ]
Post subject:  RE:Guitar hero Help

Turing is having trouble opening the file, for any one of several reasons.

Make sure the name of the file EXACTLY matches what you have on the "open" line. Case DOES matter.

Make sure that both files are in the same folder (preferably your desktop).

Make sure that you open the file by double-clicking on the example1.t file, and NOT by double-clicking on Turing.

Author:  death bringer [ Fri Jun 27, 2008 3:04 pm ]
Post subject:  Re: Guitar hero Help

... look at the pics i have below then (in the dling file)
anyone know whats wrong?
the pics show that the example doesn't work

Author:  death bringer [ Sat Jun 28, 2008 10:35 am ]
Post subject:  RE:Guitar hero Help

Czn anyone help me if there is no answer i will be done with this topic if none can help (2 days Time)(june 30 10:36 am

Author:  DemonWasp [ Mon Jun 30, 2008 12:56 pm ]
Post subject:  RE:Guitar hero Help

Whoops. Apparently I fail at writing code without testing it. The code is like 99% correct, but there's a subtle problem:

1. I open the file for "read".
2. I use "get" to read from the file.
3. "get" is not the same as "read" in Turing.

So just change
code:
open : fileId, "notes.txt", read

to
code:
open : fileId, "notes.txt", get


That should fix your problem. Sorry, my mistake.

Author:  death bringer [ Mon Jun 30, 2008 1:05 pm ]
Post subject:  RE:Guitar hero Help

Ohh ty thats awsome\
now i just have to find a way to put it into my game lol


: