Killing Floor 2

Killing Floor 2

Controlled Difficulty
GM Jun 17, 2017 @ 2:47am
How can I modify a spawnlist modified by the CD?
I am running my custom zed mutator on my server.

Since 2 days ago, custom zed does not work for SCs and FPs.

As I already asked in the commet section, I noticed CD mod replaces
SCs and FPs with its own class.

I would like to know how I can modify the Spawnlist created by

SpawnList = MyKFGI.SpawnManager.GetNextSpawnList();

The part for FP conversion is as follows

if (SpawnList[ i ] ==class'KFPawn_ZedFleshpound') {
if(Rand(100)<51){
SpawnList[ i ] = class'PowerZeds_KFP_FleshpoundBig';
break;
}else{
SpawnList[ i ] = class'PowerZeds_KFP_FleshpoundSmall';
break;
}
}

Replacing KFPawn_ZedFleshpound with ControlledDifficulty.CD_Pawn_ZedFleshpound_NRS
or CD_Pawn_ZedFleshpound_NRS didn't work. Could you tell me what I should replace it with?
Last edited by GM; Jun 17, 2017 @ 2:48am
< >
Showing 1-6 of 6 comments
blackout  [developer] Jun 17, 2017 @ 2:28pm 
Before I get to your question, here is some background information. You might already be familiar with most of it. Please bear with me.

TWI's v1053 "sideshow" event update made at least one major intentional change and one major bug.

The bug: scrakes % HP rage calculation was broken by TWI in this update. You can see this in action in the vanilla game. Shooting a scrake with a 9mm in HOE multiplayer in the body will rage it instantly. Other conditions can cause premature rage too, like headshotting a scrake once with 9mm in HOE singleplayer. CD temporarily replaces the standard KFPawn_ZedScrake class with CD_Pawn_ZedScrake_v1053Hotfix specifically to fix these premature scrake rage bugs. TWI has preliminarily acknowledged this as a bug, so it is likely that they will fix it, and my _v1053Hotfix scrake class could be removed afterward.

The intentional change: TWI made a random chance (75% on HOE) for Fleshpounds to rage on spawn. There are some issues with it that make it work suboptimally. However, even if it were working optimally, it is not a well-considered feature IMHO. CD added a FleshpoundRageSpawns=true|false option to manage this change. Setting FleshpoundRageSpawns=false prevents FPs from spawning raged at all. For those masochists who like the idea of a raged-spawn fleshpound but want to exercise control over it, I also added a SpawnCycle syntax: FP! and MFP!. CD replaces Fleshpound and MiniFleshpound classes with _NRS and _RS subclasses as part of this implementation. The suffix mnemonics are "no rage spawn" and "rage spawn", respectively. If TWI changes their mind about raged-spawn fleshpounds and removes them, then this too could be removed from CD. It's not clear whether TWI will change it though.

For PowerZeds, what do you want to do? Do you want to only spawn the fleshpound classes PowerZeds_KFP_FleshpoundSmall and PowerZeds_KFP_FleshpoundBig, and never spawn standard fleshpound or CD fleshpound classes? What about mini fleshpounds?

Let's ignore minis and kings for now. Let's also assume that you only want to spawn PowerZed-class fleshpounds. In that case, replace KFPawn_ZedFleshpound (these can still spawn in CD if the user has set FleshpoundRageSpawns=true), CD_Pawn_ZedFleshpound_NRS, and CD_Pawn_ZedFleshpound_RS with your PowerZed classes. CD's final replacements happen in the GetSpawnListFromSquad function, which is called from the GetNextSpawnList function. Class replacements after those invocations should have the effect you want. Please see:

https://github.com/notblackout/kf2-controlled-difficulty/blob/master/Classes/CD_SpawnManager.uc#L798-L875
GM Jun 17, 2017 @ 2:47pm 
Thx for the detailed response.

I too am not satisfied with what TWI did with FPs, as I think controlling FPs is one of the core strategies of the gameplay.

My custom zed mod (originally created by my friend, Iramok) replaces the % of regular zeds that is set in ini file with PowerZeds class.

For FPs, of those replaced FPs there is 50/50 chance (I noticed it's supposed to be (Rand(100)<50), but whatever) of becoming either FPbig or FPsmall.

I will modify my code as you suggested and will see how it goes.

Again, thx for your help.



Last edited by GM; Jun 17, 2017 @ 2:48pm
GM Jun 17, 2017 @ 11:02pm 
After some modification of the code and testing, I confirmed that my custom zed mod works fine without CD, but could not get the custom zed to work alongside with CD.

I still want to use functions from CD, so, as a temporaly solution, I would like your permission to modify your CD mod and make my version of the CD mod which

1. SCs and FPs are not converted to CD versions
2. Incorporate your modification to SCs and FPs as part of my custom zeds classes.

My version of CD mod will run only on my server and the mod will not be publicly available on WS, but only those who join my server will download the mod via WS. I will add you as a contributer so that you can check the accessible status of the mod.
Last edited by GM; Jun 17, 2017 @ 11:10pm
blackout  [developer] Jun 18, 2017 @ 12:26am 
You have my permission, assuming this is a noncommercial project. Thank you for asking me. Good luck integrating CD and your custom zed classes.

In your modding work, if you identify simple changes to CD that would make CD more customization-friendly, then please let me know. I would consider such suggestions carefully.
GM Jun 18, 2017 @ 1:34am 
Thank you for granting me your permission. I will let you know here how it went.

I will try to give you a feed back about the improvement, but I am not much of a programmer, so don't count on me about that.
GM Jun 18, 2017 @ 1:13pm 
For now, I simply removed the conversion part for SCs and FPs, and the modified code is working fine with my custom zeds. I will try to incorporate your fix to SCs and FPs into my custom zed code.

As promised, I have added you as a contributor for the modified version of the CD mod.
Last edited by GM; Jun 18, 2017 @ 1:14pm
< >
Showing 1-6 of 6 comments
Per page: 1530 50