Mystic Software Forums

Mystic Software => General Discussion => Topic started by: sdupont on June 27, 2007, 09:06:17 AM

Title: Bizzare Problem with RPGCode?!?!
Post 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:
Code: [Select]
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:
Quote
0
potion    x1
Cancel
0

output i`m getting:
Quote
0
Cancel         x0
??
     
What The :censored: ?!?!?!?! Confused  Confused
Title: Re: Bizzare Problem with RPGCode?!?!
Post by: Asimir on June 27, 2007, 01:34:24 PM
Quote from: "sdupont"
Output i should get:
Quote
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.
Title: Re: Bizzare Problem with RPGCode?!?!
Post by: dooms102 on June 27, 2007, 04:34:44 PM
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:

Code: [Select]
  text(16, y!, "x" + castLit(pc1[i!][1]!))
I think what you were trying to do should look like this:

Code: [Select]
  text(16, y!, "x<pc1[i!]1!>")
and I am not sure were the text "Potion" or "Cancel" are coming from.
Title: Re: Bizzare Problem with RPGCode?!?!
Post by: Colin on June 27, 2007, 04:44:04 PM
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.,

Code: [Select]
text(6, y!, i!)
Try

Code: [Select]
text(6, y!, castLit(i!))