Page 1 of 1

X-Ray 1.6 lua oddities

Posted: 19 May 2014, 23:13
by Alundaio
I'm just writing here to document some things I have noticed over the years or just recently.

The Mystery behind squad update method inside bind_stalker update method

Recently I discovered something strange. In xr_motivator.script bind_stalker update method, there is a call to the object's squad update method. At first, I thought, man wtf were they thinking. So, I removed it. sim_squad_scripted is the scripted exported c++ server object class, online_offline_group. It's update method should be handled by the engine already; which it is. So having multiple running updates is stupid except I think I found out why they did it:

When loading a saved game I noticed that all squads with-in switch distance do not update?! This is ONLY after a loaded save game, does not happen on level change or new game. This must be a bug that GSC couldn't figure out so they threw the squad:update() method call inside bind_stalker to fix it. Or maybe it's entirely intentional.