ThingFactory.bStoppable

Discussions about Coding and Scripting
Post Reply
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

ThingFactory.bStoppable

Post by Barbie »

ThingFactory.bStoppable is intended to stop the factory, if the ThingFactory is untouched. Has this ever worked for anyone?

The source code says that if ThingFactory is untouched, it goes to state 'Waiting'. If a previously spawned prototype raises its event then, the ThingFactory does not update its 'numitems', but sends itself to state 'Spawning'. There the ThingFactory does nothing if numitems >= maxitems.
I added the decrement to ThingFactory.Waiting.Trigger():

Code: Select all

Auto State Waiting {

	function Trigger( actor Other, pawn EventInstigator ) {
		//only if Other is from this factory
		if ( Other.class == prototype )
			numitems--;
		Super.Trigger(Other, EventInstigator);
	}
}
But the ThingFactory still does not work properly: often it stays in state 'Spawning' although it is untouched.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: ThingFactory.bStoppable

Post by sektor2111 »

Consideration
1) ThingFactory is for items not creatures;
2) I think is about TOUCH not about Triggering chapter. CreatureFactory is usable like a trigger itself - it really doesn't need a Trigger - lol mappers;
3) I have never been interested to stop a Factory in game But I can stop it after ending match - make no sense monsters spawned after ending game.
Post Reply