Announcement

Collapse
No announcement yet.

Stop monsters from using playerstart

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Stop monsters from using playerstart

    I have an odd issue, where my monsters will warp and appear at my playerstart if they can't reach me. Is there a way to keep them from using teleporters/playerstarts? I've tried setting their team numbers to differ from that allowed in the playerstart, and I've set them to bCanteleport=false, but nothing has worked so far. Any ideas?

    #2
    Filthy cheaters :up:

    Sorry, Im not a programmer, but I had to say that for some reason. :noob: :up:

    Comment


      #3
      Look in the monstercontroller class. There's a function called FightEnemy that has this annoying bit of code that teleports monsters around if there's no one to fight nearby. Comment it out and it should stop that from happening.

      Comment


        #4
        In which class do you make the modifications? Do you subclass the monstercontroler?

        Comment


          #5
          yes and then you have to subclass the monsters and make them use the new controller.

          Comment


            #6
            THANK YOU Psyk! I found the little piece of code that did it. It seems as though they don't teleport around anymore and actually walk to your last known location. Sweet! Commented out are the problem areas, just in case anyone else has the same issue.


            function FightEnemy(bool bCanCharge)
            {
            local vector X,Y,Z;
            local float enemyDist;
            local float AdjustedCombatStyle, Aggression;
            local bool bFarAway, bOldForcedCharge;
            // local NavigationPoint N;

            if ( (Enemy == None) || (Pawn == None) )
            log("HERE 3 Enemy "$Enemy$" pawn "$Pawn);

            if ( (Enemy == FailedHuntEnemy) && (Level.TimeSeconds == FailedHuntTime) )
            {
            if ( !Enemy.Controller.bIsPlayer )
            FindNewEnemy();

            if ( Enemy == FailedHuntEnemy )
            {
            GoalString = "FAILED HUNT - HANG OUT";
            if ( EnemyVisible() )
            bCanCharge = false;
            else if ( (LastRespawnTime != Level.TimeSeconds) && ((LastSeenTime == 0) || (Level.TimeSeconds - LastSeenTime) > 0) && !Pawn.PlayerCanSeeMe() )
            {
            LastRespawnTime = Level.TimeSeconds;
            // EnemyVisibilityTime = 0;
            // N = Level.Game.FindPlayerStart(self,1);
            // Pawn.SetLocation(N.Location+(Pawn.CollisionHeight - N.CollisionHeight) * vect(0,0,1));
            }
            if ( !EnemyVisible() )
            {
            WanderOrCamp(true);
            return;
            }
            }
            }

            Comment


              #7
              Nice one.Thanks. .

              Comment

              Working...
              X