Forum Discussion
Komag
11 years agoRoku Guru
"EnTerr" wrote:
It's also possible you might be asking for this as "unquoting":
'init phase
item = {
name: "wall",
blocker: TRUE,
sprite: "sprite_brickwall2"
}
...
'peruse phase
compositor.NewAnimatedSprite(j*64, i*64, bitmapset.animations[theCurrentRoom[i][j].sprite])
THIS!
You nailed it, that works perfectly!
Basically this is a shortcut way to build a grid room layout with various sprites in various locations, based on a grid layout of 64 pixels per square, and since I'm going to have a lot of different possible items, I needed a procedural way to make it work without having to set up manually too many IF THEN specific matches.
I had no idea that
[theCurrentRoom
which is defined as a string (such as "sprite_brickwall2"), could be added after
bitmapset.animations
to properly access the xml file info. I probably need to study the xml syntax and controls more, I feel like I'm probably not making use of it as I should. I'm really not a programmer, but I did a Legend of Grimrock mod project with Lua last year and BrightScript feels very similar to that language.