There seems to be something fishy in the
JBMonsterSpawner code (at least in combination with Satore's Slith Monsters,dunno with the standard ones). In the Tick() function there is this piece of code, which should prevent monsters from teleporting to a different location.
Code:
If (MyMonster != None)
{
// reset monster if it teleported away
If (VSize(MonsterLocationPrev - MyMonster.Location) > 256.0)
{
//log("Warning: "$Self$" got teleported and was set back to previous location.");
MyMonster.SetLocation(MonsterLocationPrev);
}
MonsterLocationPrev = MyMonster.Location;
}
In Deck-17 (using the Satore's Sliths) the monsters are only triggered at the start (SpawnOnTriggered).
Lots of times during the games it happens that the current
MyMonster.Location is way off from the
MonsterLocationPrev set in the last Tick(). I can't figure out why this happens. No harm done so far, while this piece of code then makes sure the monster is set back to it's previous location.
However sometimes (even though the code tells me it's not possible) it happens that even the
MonsterLocationPrev also is way out of the SlithRoom, and the Slith is set back to the wrong previous location. At that time the Slith in on the lose in the map.
After trying to find the cause of this and failing to do so, I decided to do a fix to make sure the Sliths will stay in their room. For this I subclassed the
JBMonsterSpawner in to
JBMonsterSpawnerZoned, where the Sliths were only allowed to stay in a by property defined
MonsterZone.
For this I added the following code in the Tick() function, after the above one:
Code:
If (MyMonster != None)
{
// Reset monster if it escaped out of the MonsterZone.
// If this is the case, the Monster is simply reset to it's Startposition.
If (bUseMonsterZone && (MonsterZoneTag != '') && (MyMonster.Region.Zone.Tag != MonsterZoneTag) )
{
//log("Warning: "$Self$" got out of the restricted zone "$MonsterZoneTag$" ("$MyMonster.Region.Zone.Name$") and was reset to startposition.");
MyMonster.SetLocation(StartSpot);
}
MonsterLocationPrev = MyMonster.Location;
}
All this seems to be working OK. When the
MonsterLocationPrev is wrong, this piece of code simply resets the the Monster to it's starting position, which is in the MonsterZone.
After implementing this and sending it back to Rob, he told me Sliths are still out of the Slithroom???
I don't know anymore ...
(O, and I'm off for the weekend Rob, sry).