Announcement

Collapse
No announcement yet.

Player attributes (PlayerReplicationInfo?)

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

    Player attributes (PlayerReplicationInfo?)

    I'm wondering, where is all the information regarding the player (the human player I mean, although the same probably applies to any bots) stored? I'm talking about stuff like running speed, jumping height, weapons the player starts off with, etc.

    I'm assuming this sutff comes from the PlayerReplicationInfo, but I don't see anything related to the above-mentioned attributes in the class (maybe I'm just not looking hard enough?)

    I'd also like to know how to modify these attributes, for example, for a mutator/gametype/etc.

    Would it be something like...

    Code:
    foreach DynamicActors(class'PlayerReplicationInfo', P)
    {
      P.setAttribute...
    }
    If I just made an *** of myself, it's because I'm a total newb.

    Thanks for any and all help!

    #2
    Pawn and xPawn have stuff like movement speeds etc.

    Check some of the mutators/combos to see how they are used in them, like the speed combo.

    Comment


      #3
      Ok well, I checked out the speed combo mutator, but the problem with that is the function StartEffect gets passed the parameter of the player (an xPawn) directly.

      Now, it is my understanding that most "characters" (i.e. humans and bots) in the game are xPawns. Or, is it that all the characters excluding the human player are Pawns, and ONLY the human player is an xPawn? If so, that would make things a lot easier.

      Comment


        #4
        Alright, well I tried the following:

        Code:
        local xPawn P;
        
        log("Ground speed = " $ P.GroundSpeed);
        Just to see if I'm accessing it properly. I'm not. I get the following error message:

        Warning: mymod CTF-FaceClassic.mymod (Function mymod.mymod.StartMatch:0069) Accessed None 'P'
        ScriptLog: Ground speed = 0.00
        Also, I tried putting this code in PostBeginPlay but it never seems to get executed. So I had to stick it into StartMatch, but its no good because that only gets executed at the very beginning of the match; I want this code executed every time the player (re)spawns.

        Comment


          #5
          The local pawn your trying to reference is accessing none because your not referencing anything. If you have your own custom pawn class you are using log the ground speed there or do it in your custom controller. Or you can do a for each somewhere and log all the pawns ground speed.

          In Pawn:
          log( "GroundSpeed: " $ Groundspeed );

          In Controller:
          log( "GroundSpeed: " $ P. Groundspeed );

          In Somewhere else:
          local xPawn p;

          foreach DynamicActors(class'xPawn', P)
          {
          log( "GroundSpeed: " $ P.Groundspeed );
          }

          Comment


            #6
            Ok, I think I got it...

            Code:
            	local xPawn P;
            
            	super.StartMatch();
            	foreach DynamicActors(class'xPawn', P)
            	{
            		if (!P.PlayerReplicationInfo.bBot) {
            			P.GroundSpeed = 100;
               		}
            	}
            It's kinda cheesy (i.e. checking if the player is a bot or not) but it works! Wondering if there's another way to do it, i.e. using the ControllerClass property?

            Also, I still have that problem about PostBeginPlay(), can anyone help?

            Comment


              #7
              Ok, I figured out the controller part...

              Code:
              	foreach DynamicActors(class'xPawn', P)
              	{
              		if (P.Controller.IsA('xPlayer'))
              		{
              			...etc...
              		}
              	}
              Now for the other part... I figure I would be better off putting this code under that specific player's PostBeginPlay function.

              Here's the deal: I'm makign a class-based mod, and I want the user to be able to choose what class they want to be. So when they spawn, they must spawn as THAT class.

              Of course all my character classes will each have their own .uc file which extends xPawn (or xPlayer?) But how do I tell the game that at any given PlayerStart, I want to spawn my own specific class, not the default class? I'm thinking its under the Controller class somewhere...

              Comment


                #8
                I haven't played with player spawning yet, just monster spawning. Prior to spawning the monster, I had to change the monster's default properties prior to spawning. Perhaps you should change the properties of the player or your custom player prior to spawning the character as opposed to after?

                Comment

                Working...
                X