Hello, I am just posting back here having finally solved the list of things I needed to figure out. And now it works exactly as I wanted I will write a tutorial when I get the spare time but for now this is a list of what I did to get this to work.
To start here are the items you need to bring into the view port. A go button and blank avatar. A tileset with all your characters on it and one clone plus how many slots you plan to make. I made 3 so that is 4 clones of a tile set. A menu box, a tile for your avatars to sit on and highlight the stats of each. A CSV, found in the extensions from RexRainbow. And some text items to show your stats.
For the tile you will need to make it a container holding all the text items that go with each stat.
CODE===
//First we need to destroy the first tileset and the sprite backround for our tiles as the math we will be doing can be thrown if they are present after the layout is loaded.
On start of layout
Destroy Tileset
& Destroy Tile
& Load CSV Table form String}
CSV String
",Name,Unlock,Strength,Speed,Mana
0,Bob,T,0,0,0
1,Tim,T,0,0,0
2,Sue,T,0,0,0
//etc for each tile in your tile set. be sure that you list each character in sequence and tile 0 tile 1 and tile 2 will not only correspond to each image but will allow you to link that image to the CSV table for easy access to your stats.
//now we have the tile as a container for all out text items (also I have tied my tiles to the avatars so you can scroll through the list so know you can also do it the other way)
Every Tick
Tile - Set position to X: Tilemap.TileToPositionX(0) Y: Tilemap.TileToPositionY(0)
TextName - Set Position to Tile Image Point (1)
TextStrength- Set Position to Tile Image Point (2)
}
//you get it
Global Var's
Total - value of 0
TileSelect - value -1
ActiveSlot - value -1
Mouse LeftClick Slot0{
Set Var ActiveSlot to 0
Call Function "Menu1"}
//repeat for as many slots you will want
Function on "Menu1"{
Set background to position 500,100
>>>
CSV For Each Row
&
Compair CSV.At("Unlock",CSV.CurRow)="T"{
Add 1 to Total
Create Obj Tilemap on Layer(1) At X: Background.ImagePointX(0) Y: Background.ImagePointY(0)+(150*Total)-150
//This will add one to every run of the loop spacing out the placement of each avatar and tile
Set Tilemap - to int(CSV.CurRow)
Creat Obj - Tile on Layer(1) X: Tilemap.TileToPosition(0) Y: TileToPosition(0)+(150*Total)-150
TextName - Set Text CSV.At("Name", CSV.CurRow)
ValuStrength - Set Text to CSV.At("Strength", CSV.CurRow)
//and so on
Tile - Move to bottom of layer
Background Move to Bottom of layer}
}
Mouse - LeftClick on Tilemap
&
ActiveSlot = 1{
Set TileSelect to{ X: Tilemap.TileAt(Tilemap.PositionToTileX(Mouse.X)) Y: Tilemap.TileAt(Tilemap.PositionToTileY(Mouse.Y)}
//let me go over this one real quick. Tile select is a Var that is used to note which image I click on. So looking back at the CSV, and note that each row is numbered. So by clicking on Sue the var TileSelect will be set to 2 and later you will see that by having row 2 and Sue's image on the tile map the same this allows me to quickly know where my data is coming from.
Set Tileset to (TileSelect)
//then set the text items next to slot one to each stat
Set ActiveSlot to -1
Destroy Obj Tile
Set Total to 0
CallFunction "Destroy Tiles"
On Fun "DestroyTiles"
Destroy Obj Tilemap
Move Backround to -100,0
//this function is there because when I have it in the other block it will only destroy the tile that I selected. This allows me to get rid of all of them.
Repeat the last block for each slot that you have. This is all there is to it and I am happy that I managed to do this all with 13 blocks and 3 variables
.CAPX needs CSV by RexRainbow to open