Avoid teleporting of Queens

Discussions about Coding and Scripting
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Avoid teleporting of Queens

Post by Aldebaran »

Thank you for that useful mutator, Barbie.
Now I have to check all maps if they have custom Queens with custom code to be able to exclude it from replace.
Perhaps your LOG_Debug function will help.
I know there are maps where Queens have other skins or different projectiles than standard, these Queens don't need to be excluded as far as I see through.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Avoid teleporting of Queens

Post by Barbie »

Aldebaran wrote:Now I have to check all maps if they have custom Queens with custom code to be able to exclude it from replace.
Perhaps your LOG_Debug function will help.
I'm afraid that the log file will not help to detect if a Queen has custom code. If such a Queen is replaced, you might notice another behaviour than before and therefore you get to know that the replaced Queen has custom code.
Aldebaran wrote:Queens have other skins or different projectiles than standard, these Queens don't need to be excluded as far as I see through
Correct, all properties of the old Queen are copied to the new Queen.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Avoid teleporting of Queens

Post by Aldebaran »

For compiling the source code I had to comment out line 71 in SBQueenSaver:
logger(LOG_Debug, "CheckReplacement", NewQueen $ ".Drawsize=" $ NewQueen.Drawsize @ "is not the default DrawSize, changing Collision Cylinder");
because of compiling error:
Unrecognized member 'Drawsize" in class 'SBQueen'
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Avoid teleporting of Queens

Post by Barbie »

Aldebaran wrote:because of compiling error:
Unrecognized member 'Drawsize" in class 'SBQueen'
What, I didn't compile it after that change? :oops:
'Drawsize' should be 'DrawScale'.
<EDIT>
Now I remember why that happened: I was writing the documentation after the mutator was finished and wanted to have the code in sync with the doc, but forgot to recompile... :lol:
</EDIT>
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Avoid teleporting of Queens

Post by Aldebaran »

Now I had no (EDIT: typo) issues with starting the mutator.
But I have still one question: Does it also replace Queens that are not from a creature/thing factory?
For example after playing maps MH-Slime and MH-Tomoko I can't find info in the server.log about replacing the Queens in these maps although I had set LOG_All/LOG_Debug activated. I only got listed creature/thing factory Queens and none were found here.
Last edited by Aldebaran on Fri Oct 05, 2018 9:50 am, edited 1 time in total.
User avatar
Hitman
Adept
Posts: 281
Joined: Mon Aug 16, 2010 11:01 am
Location: Sweden
Contact:

Re: Avoid teleporting of Queens

Post by Hitman »

I tested this and it doesn't work on all custom-queens like celd-queen and alien-queen, or is it just a setting in the ini ?
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Avoid teleporting of Queens

Post by JackGriffin »

Hitty, it will never work with everything. The queen is a unique monster in that people have tweaked about everything she does. That makes it nearly impossible to totally handle with replacements. Barbie does fine work but in this case I'm with Loathe in that the best way to handle it is to just monitor the queen's state and then deal with her if she tries to move into the state where she is going to teleport. I've done dirty, unrefined versions of this and it's fine.

Because people have changed her projectiles (for instance) your replacement will need to be coded to also use those, etc. The queen just has way too many varieties in the wild to do this comprehensively.
So long, and thanks for all the fish
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Avoid teleporting of Queens

Post by Barbie »

Aldebaran wrote:Now I had now issues with starting the mutator.
Ups, what has happend?
Aldebaran wrote:But I have still one question: Does it also replace Queens that are not from a creature/thing factory?
Users never read documentation... :loool:
tl,dr: yes.
Aldebaran wrote:For example after playing maps MH-Slime and MH-Tomoko I can't find info in the server.log about replacing the Queens in these maps although I had set LOG_All/LOG_Debug activated. I only got listed creature/thing factory Queens and none were found here.
At least at log level LOG_Debug there should be lines telling what has happened. Have you inspected all the log?
Hitman wrote:I tested this and it doesn't work on all custom-queens like celd-queen and alien-queen, or is it just a setting in the ini ?
The mutator works for Queens and their sub classes, but not for other Pawns. If a mapper has introduced a new Pawn and sub classed it from anything else, it is anything else but not a queen, and therefore will not be treated by the mutator. Although "Queen" may be part of the class name, it has nothing to do with the Queen of package "UnrealI".
For example the package "AlienQueenV3.u" contains a pawn named "AlienQueen" that is derived from class "ScriptedPawn". The author stupidly just copied the complete code from the UnrealI Queen and therefore is internal identically to it, but "from outside" it a complete other Pawn than Queen and cannot be handled by the mutator.
If there is demand, the Mutator can be extended to treat such Pawns, too.
(Maps with AlienQueens.)

Your "celd-queen" means probably "CeldQ" from package celd.u (for example like in map "MH-MA1-TheLongWay-HD-v4" or "MH-LastVoyage-Alpha4"): it should work, because CeldQ is a sub class of Queen.
(Other maps with celd Queen.)
JackGriffin wrote:Because people have changed her projectiles (for instance) your replacement will need to be coded to also use those, etc.
Of course this is done in the mutator.
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Avoid teleporting of Queens

Post by Aldebaran »

I have tried about 10 maps with one Queen or more now. One map logged a Queen replacement in a creature factory. All other logged none replacements. Then the log looks like this:

Code: Select all

ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Info: Mutator QueenSaver Version 1 loaded and active
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.DontTreatTheseActorsInit LOG_Debug: MapName='MH-TowerOfDeath2' in row 0 does not match current map name 'MH-Slime', removing row
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.DontTreatTheseActorsInit LOG_Debug: MapName='MH-Invasion_4+SBMod1' in row 1 does not match current map name 'MH-Slime', removing row
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.DontTreatTheseActorsInit LOG_Debug: array 'DontTreatTheseActors' has no entries left
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: checking for Queens in factories
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Info: 0 Queen(s) in factories replaced
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: checking for replacements in 'Spawners':
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[0]: ClassName=PW_ThingSpawner, PropertyName=ThingToSpawn, PropertyValue=Class'UnrealI.Queen'
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Info: 0 Queen(s) in PW_ThingSpawner replaced
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[1]: ClassName=B_MonsterSpawner, PropertyName=CreatureType, PropertyValue=Class'UnrealI.Queen'
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Info: 0 Queen(s) in B_MonsterSpawner replaced
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[2]: ClassName=B_MonsterLoopSpawner, PropertyName=CreatureType, PropertyValue=Class'UnrealI.Queen'
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Info: 0 Queen(s) in B_MonsterLoopSpawner replaced
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[3]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[3]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[4]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[4]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[5]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[5]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[6]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[6]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[7]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[7]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[8]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[8]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[9]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[9]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[10]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[10]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[11]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[11]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[12]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[12]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[13]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[13]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[14]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[14]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: processing Spawners[15]: ClassName=, PropertyName=, PropertyValue=
ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay LOG_Debug: Spawners[15]: ClassName=, PropertyName=, PropertyValue= has at least one empty entry, skipping
I am using the source code, not your compiled mutator. I have nothing changed in code besides the class names SBQueensaver and SBQueen.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Avoid teleporting of Queens

Post by Barbie »

Aldebaran wrote:

Code: Select all

ScriptLog: 2018-10-04 18:43:33 MH-Slime.QueenSaver0.PostBeginPlay...
All that is from logging of function "PostBeginPlay". Is there nothing from function "CheckReplacement" like

Code: Select all

2018-10-04 17:19:07 MH-Slime.SBQueenSaver0.CheckReplacement LOG_Info: replaced MH-Slime.Queen0 with MH-Slime.SBQueen0
Aldebaran wrote:I am using the source code, not your compiled mutator. I have nothing changed in code besides the class names SBQueensaver and SBQueen.
Oh, then it is clear: you should adapt the following in SBQueenSaver.uc:

Code: Select all

/************************** internal variables **************************/
const CMutatorVersion = 2;
const CMutatorName = "SBQueenSaver";
const CNewQueenClassName = "Class'SBQueenSaver-V2.SBQueen'";
const CNewQueenFullName = "SBQueenSaver-V2.SBQueen";
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Avoid teleporting of Queens

Post by Aldebaran »

I have adapt all that already. Checked it several times.

I installed your compiled mutator version now and tested it. I get the same log infos.
Barbie wrote:Is there nothing from function "CheckReplacement" like [...]
No.
So if there is no log entry I assume that no Queen replacement took place.

Perhaps someone else can give it a try and have a look into his log file? Perhaps my Monster Hunt Mod with customized CheckReplacement function in MH2Base.uc is the reason?
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Avoid teleporting of Queens

Post by Barbie »

Aldebaran wrote:So if there is no log entry I assume that no Queen replacement took place.
You are right, the Queens are not replaced when running the mutator on local machine.

I checked some things on (linux) server only where things run as expected, but if I run the Mutator on my local machine, the Mutator's function CheckReplacement() is called for a lot of things but NOT called for "MH-Slime.Queen0" and so no replacement is done. Now I have to find out what happens there...
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Aldebaran
Masterful
Posts: 672
Joined: Thu Jan 28, 2016 7:30 pm

Re: Avoid teleporting of Queens

Post by Aldebaran »

I tried both - your mutator and the source code - on dedicated server, not local.
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Avoid teleporting of Queens

Post by Barbie »

By now I have found out that no ScriptedPawn is passed to my CheckReplacement function. I guess MonsterHunt's code is responsible for that: If the map does not use package "Monsterhunt.u", Queens are replaced as expected.
I'm on it...
"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: Avoid teleporting of Queens

Post by sektor2111 »

I'm sorry for your attempts to reach at CheckReplacement while default MH code takes in account AlwaysKeep as priority in front of CheckReplacement and both of them are behind bGameRelevant when we talk about automated tweaks ruled by GameInfo and Mutator classes. If you want to setup a party perhaps you should rethink strategy and FORGET CheckReplacement ANY type.
In whatever auto-state of certain actor walk through pawns and scan name. Whatever is containing word "queen" in class-name is definitely a queen-like. Brute-force replacement in another way than CheckReplacement does, and forget replacing Queens after starting game. A CreatureFactory spawning queens probably will crash game as long as item is missing and is trying forever to bring them on Level and over-spawning Queens.
Details ?
Record "queen"'s data in something added around (a custom keypoint will spawn anywhere). Destroy original queen, wait 20-80 ms, spawn new queen and copy data recorded, destroy keypoint recorder if queen has been added successfully if not, try to reduce collisions and put them back if a new queen has been added. I had a problem at placing some customized "on-fly" tentacles (far from roof at placement) but I went to tweak a bit placement so the tweaked post-spawn smaller tentacle has spawned where I wanted hanging correctly. It's the same with queen - a smaller one located in a small spot where a default queen will never spawn. Re-Collide new queen if spawned. If still won't spawn report this in log and ask apology for the bugged mod :mrgreen: .
Post Reply