Load/Save Attribute and concatenation
ramis2k
Member, PRO Posts: 17
Hey.
So I have right now one scene which is the base level scene for my puzzle game, and what I want to do is to configure several parameters to define each level but using one single scene.
I was planning to have an attribute called CurrentLevel, and an actor that loads all the attributes for that level and sets everything up.
My idea was to have a file stored with data like this:
level1numactors=10
level1startposx=20
level1startposy=50
level2numactors=15
level2startposx=35
level2startposy=75
...
BUT Load/Save Attribute doesn't let me concatenate strings, so I can't go like:
loadattribute "level"+CurrentLevel+"numactors" to attribute CurrentLevelNumActors
For me this is KEY, because if not I would have to go and create a different scene for each level, when every level is the same, except for several parameters.
Any thoughts?
Thanks
So I have right now one scene which is the base level scene for my puzzle game, and what I want to do is to configure several parameters to define each level but using one single scene.
I was planning to have an attribute called CurrentLevel, and an actor that loads all the attributes for that level and sets everything up.
My idea was to have a file stored with data like this:
level1numactors=10
level1startposx=20
level1startposy=50
level2numactors=15
level2startposx=35
level2startposy=75
...
BUT Load/Save Attribute doesn't let me concatenate strings, so I can't go like:
loadattribute "level"+CurrentLevel+"numactors" to attribute CurrentLevelNumActors
For me this is KEY, because if not I would have to go and create a different scene for each level, when every level is the same, except for several parameters.
Any thoughts?
Thanks
Comments
Very tedious, but it is the only way.
Also, RAM on these devices is very limited. You can only use about 40MB per Scene before the device will crash.
Changing Scenes is the only way to flush out memory right now.