Mystic Software Forums
Mystic Software => General Discussion => Topic started by: sdupont on June 27, 2007, 09:06:17 AM
-
i`m creating a CMS (Custom Menu System) for my game,
but i`ve run into a uuhhh... strange error.
code:
i! = pc1_nextSlot!
.
.
.
until(i! == 20)
{
text(16, 1.5, i!)
y! = 4
text(6, y!, items[pc1[i!][0]!][0]$)
text(16, y!, "x" + castLit(pc1[i!][1]!))
y! += 1.5
text(6, y!, i!)
i!++
}
Output i should get:
0
potion x1
Cancel
0
output i`m getting:
0
Cancel x0
??
What The :censored: ?!?!?!?! Confused Confused
-
Output i should get:
0
potion x1
Cancel
0
I don't see where that "Cancel" should come from.
With your code, the dots on the second, third and fourth lines are obviously going to cause problems, but I guess you added them just for posting.
It looks like your code is supposed to write the numbers 0 through to 19 on top of each other in two different places and write the names of 20 different items on top of each other, with the number of each item next to them, also all on top of each other.
The code looks like it should be outputting something different to what you say it should output. If you edited the code before posting, to try to get rid of irrelevant parts, maybe you accidentally got rid of something important. If this is the case, post the whole of your original until loop.
-
well to start off with, I can't realy help too much because I don't know the value for a few of your varialbes. but I will say that the "." on lines 2-4 probably shouldn't be there. and I think your biggest problem is the:
text(16, y!, "x" + castLit(pc1[i!][1]!))
I think what you were trying to do should look like this:
text(16, y!, "x<pc1[i!]1!>")
and I am not sure were the text "Potion" or "Cancel" are coming from.
-
The suggestion you offer actually introduces an error; pc1[i!][1]! is the correct syntax, not pc1[i!]1! .
One problem might from using an numerical value for the string in text(), e.g.,
text(6, y!, i!)
Try
text(6, y!, castLit(i!))