Skip navigation

Monthly Archives: September 2013

I ran into this error before, it is described here. Basically preface whatever the offending line is with this->.

Did you know if you work in “High Quality Rendering” mode (click the red box) the split polygon tool is _much more helpful_?

What’s wrong with this code?

class Object{
  int x ;
  Object() {
    defaults() ;
  }
  Object( int ix ) : x(ix) {
    defaults() ;
  }
  
  defaults() { 
    x=0;
  }
} ;

Well, obviously x has the value 0, instead of the initializer-list desired default value sent `ix`.

So, what happens when you have 10-15 members that all have default value initialization in defaults(), and possible assignment in the initializer list, is defaults() clobbers whatever was sent to the initializer list, since the initializer list runs first.

I puzzled over this for a few minutes.

Warcraft 1,2 & 3 used swords for attack, shields for stop. It works because the entire theme was medieval. So, swords mean attack, shields mean “stop”. Regardless of unit type (even air units — there’s no cognitive dissonance there).

Starcraft 1 & 2 cleverly abstracted this away though. Swords clearly wouldn’t fit in Starcraft. Different units had different means of attacking. Zerg never use guns. They use spit or claws. Protoss had some “sword-like” units that did hand-to-hand combat (zealots), but other units fired projectiles (dragoons). They used a _crosshair_ instead for the attack symbol.

So, in my own game I had to think, what symbolizes _attack_ in my game? It’s a space combat game, and attack is done primarily via missiles. So I subbed in a picture of a missile for attack. And voila. The right symbol for attack is _a picture of whatever attacking is done with_ in your game.

If it were a streetfighting game, you’d use an icon of a fist.

I couldn’t find a way to do this through the GUI, but I’m positive there was one.

Anyway, the MEL command to show normals for the selected mesh:

polyOptions -dn 1;

And to hide them again

polyOptions -dn 0;

Taken from here