i finally got my XGrid's hud working in my game (after almost 3 months dam it!), so far i just got strings but i plan to change them to use a function which would return the string, the function itself will return the % completion of each grid for each character in a 2 dimensional table (each character's % completion of each of the grids)
each grid is an instance of a class which really just hold the data which is created in the Actor Class so that way the same grid will have different data for each of the characters, i id these using a string (eg. "Aria-01", "Cain-01", "Kaze-05", "Sain-CCC")
now, in order to get my % completion i need to go into every grid for the actor and get the sum of the nodes activated, the sum of the total nodes for the grid, divide the sum activated by the sum total and then multiple by 100, %'s 101.
the problem i have is that i have no idea how i'm going to do the search, the only idea i have is to call a substring function that return's true or false if the substring is found and search for the first part of each of the grid's string id and i put this in a for each loop, but i don't know if Ruby or RGSS has a function like that, what's it's name or if it has a better why, this is an example of the code i wrote down (for reference, it probably doesn't work anyway)
totalActivated = 0
totalInGrid = 0
comRate = 0.00
foreach(XGrid.Actors.Grids as currentGrid)
{
if(subString(currentGrid.name,"Aria"))
{
totalActivated += currentGrid.activated
totalInGrid += currentGrid.total
}
}
comRate = totalActivated / totalInGrid
return toString(comRate * 100) . "%"