[MH] How to make Destroyable monster spawner

Tutorials and discussions about Mapping - Introduce your own ones!
lafoxxx
Novice
Posts: 25
Joined: Sun Jun 01, 2025 7:31 pm
Personal rank: UNUSED

[MH] How to make Destroyable monster spawner

Post by lafoxxx »

I have some generic CreatureFactory system which spawns monsters, activated by trigger.

Possible to make it spawn monsterd infinitely, and stop it by destroying some specific object? Using stock MH/Unreal assets if possible.
User avatar
Barbie
Godlike
Posts: 3224
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: [MH] How to make Destroyable monster spawner

Post by Barbie »

"If Origin not in center it be not in center." --Buggie
lafoxxx
Novice
Posts: 25
Joined: Sun Jun 01, 2025 7:31 pm
Personal rank: UNUSED

Re: [MH] How to make Destroyable monster spawner

Post by lafoxxx »

Thanks.

So, the logic of whole construction I see as follows:

1. Initial trigger starts CreatureFactory
2. Some other trigger (toggled when Creature Factory is depleted) retriggers it
3. Some Decoration actor when destroyed, turns it off and triggers next event (both via Dispatcher)

Which approach do you recommend to implement a Retrigger cycle automatically, and
Stop CreatureFactory permanently (possible using SBPropertyChanger) on event

P.s. maybe SBTriggerableSpawnPoint works better for this? Does it also need CreatureFactories?
User avatar
Barbie
Godlike
Posts: 3224
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: [MH] How to make Destroyable monster spawner

Post by Barbie »

The SBRetriggerableCreatureFactory works like a normal CreatureFactory, but when it has run out, it goes back to waiting state for next coming event to start again. I often use this for Titan's StompEvent or Queen's ScreamEvent to spawn Pupeas around. As long as boss is alive, Pupeas will spawn.

lafoxxx wrote: Mon Jun 23, 2025 11:25 am Which approach do you recommend to [...] Stop CreatureFactory permanently (possible using SBPropertyChanger) on event
To get rid of the Actor that triggers the Factory again and again, simply use an ActorDestroyer that destroys all Actors that have the given MyEvent (except static and bNoDelete things) when triggered:

Code: Select all

class ActorDestroyer extends Keypoint;

var() name MyEvent;

function Trigger (Actor Other, Pawn EventInstigator) {
local Actor A;

	foreach AllActors(Class'Actor',A,MyEvent)
		A.Destroy();
}
Or use a PropertyChanger or something…
lafoxxx wrote: Sat Jun 14, 2025 8:32 am Possible to make it spawn monsterd infinitely, and stop it by destroying some specific object?
By reading this again: why not use just a high Capacity for the factory? See this masterpiece for example:
CF9999999@MH-Incursion+.unr.jpg
You do not have the required permissions to view the files attached to this post.
"If Origin not in center it be not in center." --Buggie
Red_Fist
Godlike
Posts: 2329
Joined: Sun Oct 05, 2008 3:31 am

Re: [MH] How to make Destroyable monster spawner

Post by Red_Fist »

So why doesn't that propertyflipper (the older keypoint, ( not affect that damn pesky creaturefactory ). I think the counter and the creature factory setup has been the most confusing obnoxious thorn in my side from the editor.
Binary Space Partitioning
lafoxxx
Novice
Posts: 25
Joined: Sun Jun 01, 2025 7:31 pm
Personal rank: UNUSED

Re: [MH] How to make Destroyable monster spawner

Post by lafoxxx »

Thanks. Decided to use default Factory with large Capacity, non-Covert. All seems to work as intended so far. Upon destroy, Dispatcher is triggered, to change Capacity to 0 (via SBPropertyChanger)and trigger next Event (like if all Monsters are killed).

New question: Mesh which can be destroyed.
I use "Table" decoration, with increased Health and swapped Mesh itself (used "ngel" with other texture).

Q1: AnimSequence and AnimRate set, but no animation is played?
Q2: Would like to use 'SkaarjMasterChunk' gibs, but even when I create 'MyTable" (extends Table) and modify it, Frag Chunks are still 'WoodFragments', from parent Script.
User avatar
Barbie
Godlike
Posts: 3224
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: [MH] How to make Destroyable monster spawner

Post by Barbie »

lafoxxx wrote: Wed Jun 25, 2025 9:12 pm New question: Mesh which can be destroyed.
Mesh is a property of an Actor. What you mean is "destroying an Actor with a specific Mesh". :wink:
I use "Table" decoration, with increased Health and swapped Mesh itself (used "ngel" with other texture).

Q1: AnimSequence and AnimRate set, but no animation is played?
The animation must be played by code that is missing in class'Table', because it has no animated Mesh. It is possible to add that code there but that is not the best way to do it because also when implementing a solution for your Q2 that Actor has nothing to do with a Table anymore.
Q2: Would like to use 'SkaarjMasterChunk' gibs, but even when I create 'MyTable" (extends Table) and modify it, Frag Chunks are still 'WoodFragments', from parent Script.
Seems that original coder were lazy and so they hardcoded a lot, in this case spawning WoodFragments.

Maybe you are satisfied with the attached suggestion.
class MyGel

Code: Select all

//=============================================================================
// MyGel.
//=============================================================================
class MyGel expands Decoration;

var() int Health;
var() int FragChunks;
var() Float Fragsize;




event DebugLog(string s) {
	s = Level.hour $ ":" $ Level.Minute $ ":" $ Level.Second @ s;
	BroadcastMessage(s);
	log(s);
}


Auto State Animating {


	function TakeDamage( int NDamage, Pawn instigatedBy, Vector hitlocation, Vector momentum, name damageType) {
		Instigator = InstigatedBy;
		if (Health<0) Return;
		if ( Instigator != None )
			MakeNoise(1.0);
		bBobbing = false;
		Health -= NDamage;
		if (Health <0) 	
			Frag(Class'SkaarjMasterChunkFragment',Momentum,FragSize,FragChunks);		
		else 
		{
			SetPhysics(PHYS_Falling);
			Momentum.Z = 1000;
			Velocity=Momentum*0.016;
		}
	}


Begin:
	LoopAnim('Flying', 0.2);
}

defaultproperties
{
      Health=18
      FragChunks=12
      Fragsize=0.500000
      bStatic=False
      DrawType=DT_Mesh
      Mesh=LodMesh'UnrealShare.ngel'
      CollisionRadius=8.000000
      CollisionHeight=8.000000
      bCollideActors=True
      bCollideWorld=True
      bBlockActors=True
      bBlockPlayers=True
}
class SkaarjMasterChunkFragment

Code: Select all

class SkaarjMasterChunkFragment expands Fragment;

defaultproperties
{
      Fragments(0)=LodMesh'UnrealShare.SkaarjTail'
}
You do not have the required permissions to view the files attached to this post.
"If Origin not in center it be not in center." --Buggie