Minimum Monster-health

Search, find and discuss about Mutators!
Post Reply
User avatar
Hitman
Adept
Posts: 284
Joined: Mon Aug 16, 2010 11:01 am
Location: Sweden
Contact:

Minimum Monster-health

Post by Hitman »

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: 6413
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Minimum Monster-health

Post by sektor2111 »

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
Ini file has explanations. Configuration Access is open in Preferences Menu Command in case that INI file is lost.
(2 KiB) Downloaded 25 times
User avatar
Hitman
Adept
Posts: 284
Joined: Mon Aug 16, 2010 11:01 am
Location: Sweden
Contact:

Re: Minimum Monster-health

Post by Hitman »

Tested it and this was perfect..even on spawning monsters, so many thx for this..excellent
User avatar
sektor2111
Godlike
Posts: 6413
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Minimum Monster-health

Post by sektor2111 »

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.
Post Reply