NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Project Help and Ideas » .....help meeeeeeee.....
June 11, 2010 by Master_Programmer |
okay, i'm making an RPG for a game system i made out of the nerd kits.......the problem is, i don't know how to display a string of text from an array, to the LCD screen..... :( |
---|---|
June 11, 2010 by Master_Programmer |
i tried this code: char ENEMY[4][10]={{"CROW"},{"GUY"},{"GUY"},{"GUY"}}; lcd_write_string(ENEMY[1]); but that just makes a TON of garbled text appear..... :( |
June 11, 2010 by wayward |
Hi Master_Programmer, check this thread out: http://www.nerdkits.com/forum/thread/100/ By the way, everyone, has this explanation been superseded by another thread? I'm not really visiting all that regularly. |
June 15, 2010 by Master_Programmer |
okay, i got the strings to work by "cheating" a bit, but for some reason, when i use a 2d array, when i go to display the values to the LCD, depending on the int type i used, it either displays "255" or "-1" all the time....and i've been searching around on google, but can't seem to find the answer.... here's the code i'm using:
|
June 15, 2010 by Master_Programmer |
nevermind....i think i found the answer......i think the random number i'm rolling, is using decimal places, which is screwing up my readings..... |
June 15, 2010 by Master_Programmer |
okay, this is giving me troubles.....whenever i change the "level" value even just a TINY bit, they game displays 255's for ALL THE VALUES. |
June 15, 2010 by hevans (NerdKits Staff) |
Hi Master_Programmer, It's really hard to tell what the problem might be from that snippet of code. How big is the ENEMYST array, could you be running out of RAM perhaps? Could the r index be out of bounds in the array? I can't see anything that might be causing that problem in that piece of code, perhaps if post more of what is going on someone can spot the issue. Humberto |
June 15, 2010 by Master_Programmer |
here's the entire program:
|
June 16, 2010 by hevans (NerdKits Staff) |
Hi Master_Programmer, I tried your program on my NerdKit here, it seems to work correctly with level set to 2,4 and 5. I get the proper values coming from the array. Can you describe more precisely what set of variables are causing the problem? Humberto p.s. I look forward to playing Giygas Return! |
June 17, 2010 by Master_Programmer |
when ever i use levels 0 and 1, it displays either a "-1" or a "255", depending on the type of integer i set it to......maybe i should try to make a workaround again....... XD i'm a veteran basic programmer, so i'm pretty good at finding ways around things. XD |
June 17, 2010 by Master_Programmer |
i just realized something, it only screws up when i change the level, but only if i change it after i have already initialized it. |
June 17, 2010 by Master_Programmer |
also, it only screws up if i change anything related to the value used to determine the enemy, or i should say, value 'r' |
June 17, 2010 by Master_Programmer |
oh wait......nevermind. i just realized, the answer to this problem. i don't actually need to display the values.......that was just to see if the arrays were working right...... XD so anyways, the new earthbound game i'm making is back on track, and should be finished within a week. :D and hevans, because you were the first person looking forward to it, imma send you the first finished copy i make. XD |
June 17, 2010 by Master_Programmer |
okaaaaaaaay......every time i use the 'r' to tell which enemy you're fighting, if i even put a STATEMENT that will change the value of 'level', 'r' screws up completely. |
June 18, 2010 by hevans (NerdKits Staff) |
Hi Master_Programmer, The only thing I see different with r, and the rest of your variables is that you don't initialize r when you declare it. It should not make a difference, but depending on when you use r, it might. Could you post the set of circumstances that cause the error to happen. When do you set r, and to what? Humberto |
June 21, 2010 by Master_Programmer |
i figured it out....my compiler doesn't make arrays right period. no matter how i changed the variables and stuff, the array kept screwing up. so i made a workaround. after 1 small bug fix, the game will be ready for release. |
Please log in to post a reply.
Did you know that microcontrollers have two different kinds of memory, program space (flash) and SRAM? Learn more...
|