Hendricks266, on 15 March 2014 - 01:56 PM, said:
Why not
onevent EVENT_PREGAME
ifactor NEWBEAST
{
getactor[THISACTOR].htflags temp
orvar temp SFLAG_NODAMAGEPUSH
setactor[THISACTOR].htflags temp
}
endevent
For reasons of minimality. Having it set "statically" once is preferrable to running the check every game tic * every sprite. Personally, I'm not a big fan of EVENT_{PRE}GAME. First, they tend to spread code belonging together across one more location. For example, your snippet would really belong into the NEWBEAST actor [*]; alas, there's no way to chain actor code in CON. Second, their names suggest that they're run every game tic (which seems more logical as well), whereas it's that times every sprite! This misunderstanding has lead to performance issues in the past, such as with Darkus' flashlight mod, and has also bitten me once.
[*] OK, this argument really applies to code that you wrote yourself in the first place. For NEWBEAST, if you prefer to stay away from modifying the original GAME.CON, there's no difference.
Fox, on 15 March 2014 - 02:02 PM, said:
For htflags or mdflags, I prefer to set it once during LOADACTOR and EGS.
EVENT_SPAWN should run for both sprites present in the initial map state as well as those spawned during the game. Again, if a particular actor-tile is supposed to have some htflags bit set at any time, it's cleaner to specify that via the
spriteflags directive.