by Major Cooke » Fri Oct 27, 2017 11:33 am
Graf Zahl wrote:This cannot be done and is not needed. The main problem with actors is that they are not constructed by your own code but by an internal actor factory (i.e Actor.Spawn.) BeginPlay is merely a callback in there that allows you to perform some customization which under normal circumstances would happen in the constructor.
Unless you do not build your own thinker creation factory the place to change the statnum is your thinker's constructor.
Oh, so you mean this?
Code: Select all
MyThinker t = new("MyThinker");
t.ChangeStatNum(STAT_USER);
That seems to work. Very well, I suppose I can just have a global class statically do that for me.
Graf Zahl wrote:If you want to change the statnum of a system created thinker, think again. Not a good idea!
You mean like ACS/Map thinkers? I have no intention of doing such a thing. I just meant for hand-made thinkers created via ZScript with the "new" function. And setting things like SFX actors onto a different statnum so actors that do a lot of stat searching can have their workloads minimized. Helps hugely with the changes I made with (i.e.) AEons of Death so gibs can stop lagging upon creation, because it gets a count of how many gibs are currently around and doesn't spawn anymore if there are too many. As you know, AEoD can get clusterfucky with with so many special effects going on and actors that shouldn't be bothered searching for anything other than gibs, by gibs alone.
That's about as far as I go, just for the sake of optimizing gameplay and making it far more efficient.
[quote="Graf Zahl"]This cannot be done and is not needed. The main problem with actors is that they are not constructed by your own code but by an internal actor factory (i.e Actor.Spawn.) BeginPlay is merely a callback in there that allows you to perform some customization which under normal circumstances would happen in the constructor.
Unless you do not build your own thinker creation factory the place to change the statnum is your thinker's constructor.[/quote]
Oh, so you mean this?
[code]MyThinker t = new("MyThinker");
t.ChangeStatNum(STAT_USER);[/code]
That seems to work. Very well, I suppose I can just have a global class statically do that for me.
[quote="Graf Zahl"]If you want to change the statnum of a system created thinker, think again. Not a good idea![/quote]
You mean like ACS/Map thinkers? I have no intention of doing such a thing. I just meant for hand-made thinkers created via ZScript with the "new" function. And setting things like SFX actors onto a different statnum so actors that do a lot of stat searching can have their workloads minimized. Helps hugely with the changes I made with (i.e.) AEons of Death so gibs can stop lagging upon creation, because it gets a count of how many gibs are currently around and doesn't spawn anymore if there are too many. As you know, AEoD can get clusterfucky with with so many special effects going on and actors that shouldn't be bothered searching for anything other than gibs, by gibs alone.
That's about as far as I go, just for the sake of optimizing gameplay and making it far more efficient.