An indexedvar occupies the global scope, just like a global var. Once defined you can use it anywhere, any time and it remains until destroyed or the engine is shut down.
+ Much faster than global vars. If you have a bunch of globals and replace them with indexed vars, you are almost certain to see significant framerate gains on slower platforms.
+ NOT persistent across saves, so no worries about leftover information from a save file polluting your values.
- Better keep those IDs straight or you'll have a huge mess on your hands. Use of defined constants is all but required.
- Just like globals you have to be careful to get rid of these when you don't need them or they stick around forever.
The documentation uTunnels wrote on localvars is rather fuzzy. I cannot tell if they only work in the current function or script file (the former is more likely). I've never had a use for these at all as they seem do the exact same thing as script variables with no advantages (script variables are already indexed).
Entityvars are invaluable. They are tied to the entity (not model - each spawned entity has its own set of entity vars). From special effects, stats, tracking bind for grappling, pretty much any value you want to store about an entity should go here.
+ Tied to entity allowing you to individually track stats and values with ease.
+ Since the entity's pointer is what's used internally for tracking the owner of an entity var, you can do some interesting tricks (like copying all entity vars from one entity to another in a couple of lines) if you are careful.
- Easy to get carried away with if you aren't careful. If you store 20 values to an entity, it takes only 5 spawns in play to have 100 entity variables floating around in memory.
HTH
DC