Scene Attributes - I think they're what I need to use but I'm hitting a problem.

Hello,

I've hit some confusion - I'm making this grid based tower defence game, a bit like Plants Vs Zombies, so far I have a gaming grid on which I can place one instance of a weapon at any one time, and I have enemies spawning from the right of the screen along one of six randomly selected horizontal paths and moving towards the left.

So, to help me keep track of various stats during the current scene, like number of weapons deployed, number of enemies spawned, number of enemies destroyed and number of weapons destroyed, I created an actor to act as a kind of visual reporting system/scoreboard type thing. I've positioned it along the top border of my game to display these stats live in play.

However, I'm struggling as to what sorts of attributes to use. I keep reading that game attributes are good for things that are persistent throught out the game, such as an overall score or the number of lives a player might have, etc, so as the stats I want to display are unique to the level I decided that game attributes were not the right ones for this instance.

Actor attributes seem to be only accessible when working with rules and commands for a specific actor, so the scoreboard wouldn't be able to display them, which left me with what I thought was the right and most logical attributes - scene attributes.

So I created some scene attributes then hit upon this business of the only actors being able to access them are individual instances rather than prototypes (yes, I did some research and found this out through this wonderfully useful forum!) And this leaves me with a problem. Obviously I can unlock my scoreboard to display the scene attributes I've created, but my weapons and enemies are all spawned from their prototypes, and the prototype does not let me access the scene attributes to update them for all of the conditions I've described above, I seem to have no way of updating those attributes in my current system. I'm spawning lots of weapons and literally hundreds of enemies - no individual instances of either actually exist at the start of a level. I know you're all smart people here, but in case my description hasn't made sense thus far, to give an example, when one of my enemies spawned from a prototype actor dies, how can I update the scene attribute keeping track of the number enemies who've died so far and then display it thus on the scoreboard?

I've two potential theories on this;

1) assuming that this is not actually something that scene attributes are designed for, presumably I can record these stats in a table and then use the scoreboard to call the figures direct from that instead

or

2) I'm being a dunce and am missing something fundamentally obvious with scene attributes that would solve my problem!

So which is it? All explanations are welcome, and I'm fully prepared to have to don my dunce's hat at this point!

thanks

Jim

Comments

Sign In or Register to comment.