by Urre » Wed Jul 01, 2009 4:55 pm
I think he's talking about a .weaponframe weapon, no? Also, the .nextthink trick behaves better if you use a new field in which you store time upon creating the entity, and increasing that by 0.05 every animation frame, and just setting .nextthink to that.
self.animtime = self.animtime + 0.05;
self.nextthink = self.animtime;
Resetting animation timings to world time will throw it off a tiny bit all the time, eventually resulting in minor twitches or slower/faster animation than expected. In general, this applies to pretty much all timing-related issues which are done frequently, such as movement, AI thinking, rapid fire weapons, animation... One off timers such as a flag capture timer or a trigger of some sort does fine with basing on time. In some cases it's even necessary, can't think of a good example for this, but if things in the world are meant to sync somehow, I can imagine this being a good case.
I was once a Quake modder