Kyuukon pretty much got everything perfectly. You can't mix different types of data in an array. To do that you'd need to use a hash instead, but I have little experience in that department.
A few things. I'll start with what Kyuukon already has in place:
$game_variables[x] += 1;
if ($game_variables[x] == $game_variables[y]) #Means you reach your goal (saved in variable[y])
$game_variables[1][0] = "Complete"
end
$game_variables[1][1] = $game_variables[x].to_s + "/" + $game_variables[y].to_s
We can shortform the IF to something like this:
$game_variables[x] == $game_variables[y] ? $game_variables[1][0] = "Complete" : 0
That's a ternary operator where the stuff before the ? is checked. If it's true, then the next thing happens ($game_variables[1][0] = "Complete") otherwise the thing to the right of the colon ( : ) happens. ( 0, basically nothing as far as I can tell)
if you've already converted the integer into a string ( $game_variables[x].to_s ) You'll have to revert it back if you want to modify it. Say you wanted to just up the value instead of using variable x. If it were still an integer then you can simply do this:
$game_variables[1][1] += 1
but it's a string, so you have to revert it first.
$game_variables[1][1] = ($game_variables[1][1].to_i + 1).to_s
note: on the other hand, I tested and it seems you can mix strings and integers in the array, but it's probably better to be safe than sorry.
Of course there's a better way I think. Instead of doing all this mumbo jumbo, you should use a single integer for each quest as opposed to two different data types.
0 means quest hasn't been started.
Any positive integer means its on the way
then set it to -1 when the quest is complete.
So to check if it's in progress it's just a matter of checking to see if the value is 1 or more. Same thing vice versa to check if it's complete.
Some more advanced uses include using a
2D array, which is basically arrays within an array. Say you wanted a quest to have multiple values and not just a quest tracker from start to finish.
Quest 3:
1 tracker
2 number of caves excavated
3 number of relics found
So you need to set an array for Quest 3, inside of the Quest array (variable 1, which is already an array)
$game_variables[1][3] = [] (sets it as an array)
Now you've got a whole array inside quest 3's entry! (Remember that [1] is the Variable, [3] is the entry in that first array, the third [ ] is the entry in the second array)
$game_variables[1][3][0] = tracker
$game_variables[1][3][1] = caves excavated
$game_variables[1][3][2] = relics found
Yes you can put an array within an array within an array, and so on, but it gets messy and confusing there so it's best to stick with 2D to start.
If you wanna see other possibilities, see if this gets the juices flowing:
$game_variables[20][this.id][0] = health
$game_variables[20][this.id][1] = defense
$game_variables[20][this.id][2] = attack
$game_variables[20][this.id][3] = [3, 7, rand(10)] (drops)
where this.id is the events ID.
for drops, you can loop through that array and add the item via:
$game_party.gain_item($data_items[$game_variables[20][this.id][3][0]], 1) (item ID 3)
$game_party.gain_item($data_weapons[$game_variables[20][this.id][3][1]], 1) (weapon ID 7)
$game_party.gain_item($data_armors[$game_variables[20][this.id][3][2]], 1) (random armor ID 0 through 9)
Well, I rambled on long enough.