Minimum Monster-health

Search, find and discuss about Mutators!
User avatar
Hitman
Skilled
Posts: 196
Joined: Mon Aug 16, 2010 11:01 am
Location: Sweden

Minimum Monster-health

Post by Hitman » Thu Nov 25, 2021 2:21 am

Is there, or can someone make a Min Monster-health mutator ? would be handy since I run 4 MH-Servers and the difference is the weapon-packs.

User avatar
sektor2111
Godlike
Posts: 5591
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Minimum Monster-health

Post by sektor2111 » Thu Nov 25, 2021 5:54 am

A monster adjusted must be "marked" for not be adjusted multiple times and ending in making monster un-killable. This thing I solved in my MH mods directly when monster is scaled up or down depending on variable "monsterskill" - of course not having much to do with real "skill" internal variable from Pawn but... I've managed to wrap these - once per creature. In function "SetPawnDifficulty" you can add two "new" checks (they are old for me): #1 MaxMonsterHealth authorized (which can be controlled even later in a regen timer aiming to work with all Pawns not only players) and #2 "MinMonsterHealth" - in these games there won't be any creature with a lower health than it's defined in game-type. Let me show you how does it look the code in my XC_MonsterHunt, more exactly in Main BaseMutator fired in stage by game-controller.

Code: Select all

	S.Health = (S.Health * DiffScale) / 100;
	if (S.Health < MinMonsterHealth)
		S.Health = MinMonsterHealth;
	if ( MonsterMultiplier > 1 )
	{
		S.Health = S.Health*MonsterMultiplier;
	}
	if ( S.Health > MaxMonsterHealth )
		S.Health = MaxMonsterHealth;
Where S is ScriptedPawn - known as Monster.
You can upgrade your mod with these checks and you'll have desired values for all creatures - except those ugly screwed up during some "mapping" process.
My settings used are minhealth = 200, maxhealth = 20000 and some MonsterMultiplier 1.100000, working for those with 300 health and upper for boosting them a bit.

In another external mutator things are doable only if you check monsters constantly for making those spawned later to have this check not only what is mapped directly. Now you need to figure which monster was adjusted and which monster was not adjusted using something from Actor or attaching to the monster an actor tracker, and looping constantly through trackers each second for testing if a new monster is too weak.

Edit: If you want you can try this - No need to be a ServerPackage.
MinMonsterHealth.7z
You do not have the required permissions to view the files attached to this post.

User avatar
Hitman
Skilled
Posts: 196
Joined: Mon Aug 16, 2010 11:01 am
Location: Sweden

Re: Minimum Monster-health

Post by Hitman » Thu Nov 25, 2021 9:46 am

Tested it and this was perfect..even on spawning monsters, so many thx for this..excellent

User avatar
sektor2111
Godlike
Posts: 5591
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Minimum Monster-health

Post by sektor2111 » Thu Nov 25, 2021 11:51 am

If anything else need to be more flexible, let me know. Mod uses a state code working like a sort of background process, if it need to be faster or slower, variables can be configurable not only hard-coded with a defined speed.