I have a area on the screen where I want images to appear one after the other, and created a table that holds every coordinate (x,y) that would hold the index of each spawn point. I set up a loop to go through the spawn points and spawn the selected actor, but when I test, it only spawns 4 images in the first 4 spawn locations from the table.
I have a self attribute on a Spawn Image actor called IndexSpawnImage as index type. Also tried with a timer instead of a loop, with a rule that changes my index attribute to +1, but that only spawns 2. I cannot figure out why it will not loop through all the positions, I have 98 rows in the table. I watched a video to help me get to this point, but the video removed rows from the table to avoid reusing them, but I don't want to remove rows and I don't think that is causing this particular issue.
Loop over table rows
Start index: First Cell
End Index Last Cell
Store index in attribute self.IndexSpawnImage
Spawn Actor rule
Spawn Actor (img) place: in front of layer
Direction 0 relative to scene
from position: tablecellvalue(game.tbl_Positions,self.IndexSpawnImage,1)
to position: tablecellvalue(game.tbl_positions,self.IndexSpawnImage,2)
Also tried with a timer instead of a loop: (using a different index attribute)
Timer
every 0 seconds, run to completion
Change Attribute
set self.ActorLocation to random(1,tablerowCout(tbl_positions))
Spawn Actor rule
Spawn Actor (img) place: in front of layer
Direction 0 relative to scene
from position: tablecellvalue(game.tbl_Positions,self.ActorLocation,1)
to position: tablecellvalue(game.tbl_positions,self.ActorLocation,2)
The other part that I am struggling with is that the images I want to spawn there are 7 of them, and although in the above section I specifically selected one image for actor, I would like to pull a random one from a table of image names. Cannot seem to do that either, the images come out white blocks.
Any help would be appreciated, I am new to GameSalad!