Announcement

Collapse
No announcement yet.

Player warps

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

    Player warps

    Hey, I'm a little confused on how to add new rules to my Gameinfo subclass. What I want to do is if a player enters a warp, add X points to their score. Any idea on how to tell the game when a player warps?

    #2
    Subclass the warp object, whatever that is, and when it warps the player, just have it call a function in your game info that adds score to the given player.

    Comment


      #3
      Ah, thank you. I spent so long thinking there was a warp method in one of the subclasses of pawn or controller that I couldn't find that I didn't even bother looking for a warp class.

      Comment


        #4
        Sorry, still having some trouble. I'm subclassing WarpInfo so when a player enters a warp, it calls the gameinfo class. This is nice and all, but I need to find out when the game is calling Warpinfo.Actorentered so I can replace it with the subclassed version. Otherwise the game won't have a clue and just work normally. Anyone know how to pull this off?

        and just in case, here's the short code



        Code:
        class MyWarp extends WarpZoneInfo;
        
        simulated function ActorEntered( actor Other )
        {
           local WSGame myGame;
           myGame = WSGame(other.Level.Game);
           myGame.PawnShop(other);
        }

        Thanks a lot :noob:

        Comment


          #5
          Er, if you just use your warp subclass INSTEAD OF the regular one, it will call your function automatically. Thats basic function overriding. Also you dont need to go through other to get Level, all actors' Level variable is set via native code when the object is spawned.

          Comment

          Working...
          X