Saving spawned actor positions
RedCat
Member Posts: 26
Hi Guys,
I'm working on a world builder and have used this great templates to get me going:
http://gshelper.com/?p=1445
Problem is this only works if the actors are pre-placed in the scene, then moved. if the actors are spawned in via a shop interface it doesn't work.
I'm scratching my head thinking of the best way to work around this, so maybe other members have already found a good solution?
My current plan is to add a couple of additional columns to the table for Item ID and building type, and save to them when spawning the actor. When the game is restarted I would then spawn as many actors as the player previously had placed, and get them to in-turn fetch their IDs, types and X / Y positions from the table. this is quite messy though - haven't tried it yet so not even sure if it would work!
another option might be to always have a bank of actors off screen but in the scene, with pre-defined IDs and populate them with the building type and X/Y positions if there is >0 in their ID row in the table.
I'm working on a world builder and have used this great templates to get me going:
http://gshelper.com/?p=1445
Problem is this only works if the actors are pre-placed in the scene, then moved. if the actors are spawned in via a shop interface it doesn't work.
I'm scratching my head thinking of the best way to work around this, so maybe other members have already found a good solution?
My current plan is to add a couple of additional columns to the table for Item ID and building type, and save to them when spawning the actor. When the game is restarted I would then spawn as many actors as the player previously had placed, and get them to in-turn fetch their IDs, types and X / Y positions from the table. this is quite messy though - haven't tried it yet so not even sure if it would work!
another option might be to always have a bank of actors off screen but in the scene, with pre-defined IDs and populate them with the building type and X/Y positions if there is >0 in their ID row in the table.
Comments
Will give it a go, see how I get on...