Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

How to set different pawns for different characters in game?

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

  • #16
    I only understood about half of that, you mind if i send you a private message for some additional details?

    Comment


    • #17
      There is a way to set different bots as different pawns in kismet. Are kismets capabilities based on the capabilities of unreal script? If so you should be able to set different pawns for each instance of a player. Along those lines is there a way in kismet to set the pawn of a players (not a bot, I already know that can be done).

      Comment


      • #18
        Keep the posts on here please then anyone can view them later and the PM boxes are tiny.

        Code:
        class mGame extends UTDeathmatch;
        	dependson(mFamilyInfo);
        
        var class<UTFamilyInfo> DefaultFamily;
        
        function SetPlayerDefaults(Pawn PlayerPawn)
        {
        	local class<UTFamilyInfo> FamilyC;
        
        	FamilyC = UTPawn(PlayerPawn).GetFamilyInfo();
        	if(class<mFamilyInfo>(FamilyC) != None)
        		class<mFamilyInfo>(FamilyC).static.SetPlayerDefaults(PlayerPawn);
        
        	PlayerPawn.AirControl = PlayerPawn.Default.AirControl;
        	PlayerPawn.GroundSpeed = PlayerPawn.Default.GroundSpeed;
        	PlayerPawn.WaterSpeed = PlayerPawn.Default.WaterSpeed;
        	PlayerPawn.AirSpeed = PlayerPawn.Default.AirSpeed;
        	PlayerPawn.Acceleration = PlayerPawn.Default.Acceleration;
        	PlayerPawn.AccelRate = PlayerPawn.Default.AccelRate;
        	PlayerPawn.JumpZ = PlayerPawn.Default.JumpZ;
        /*	if ( BaseMutator != None )
        		BaseMutator.ModifyPlayer(PlayerPawn);*/
        	PlayerPawn.PhysicsVolume.ModifyPlayer(PlayerPawn);
        }
        
        function AddDefaultInventory(Pawn PlayerPawn)
        {
        	local class<inventory> inv;
        	local class<UTFamilyInfo> FamilyC;
        	local UTFamilyInfo Family;
        
        	FamilyC = UTPawn(PlayerPawn).GetFamilyInfo();
        	if(FamilyC != None)
        	{
        /*		foreach mFamilyInfo(FamilyC).FamilyInventory(inv)
        			if(PlayerPawn.InventoryMgr.FindInventoryType(inv) == None)
        				PlayerPawn.InventoryMgr.CreateInventory(inv);*/
        		Family = new(PlayerPawn) FamilyC;
        		if(mFamilyInfo(Family) != None)
        		{
        			foreach mFamilyInfo(Family).FamilyInventory(inv)
        				if(PlayerPawn.InvManager.FindInventoryType(inv) == None)
        					PlayerPawn.InvManager.CreateInventory(inv);
        		}
        	}
        	else
        	{
        		foreach DefaultInventory(inv)
        			if(PlayerPawn.InvManager.FindInventoryType(inv) == None)
        				PlayerPawn.InvManager.CreateInventory(inv);
        	}
        	PlayerPawn.Controller.ClientSwitchToBestWeapon();
        //	PlayerPawn.AddDefaultInventory();
        }
        Code:
        class mFamilyInfo extends UTFamilyInfo;
        	
        var float	AirControl,
        			GroundSpeed,
        			WaterSpeed,
        			AirSpeed,
        			Acceleration,
        			AccelRate,
        			JumpZ,
        			DodgeSpeed,
        			DodgeSpeedZ;	
        
        var array< class<Inventory> > FamilyInventory;
        
        static function SetPlayerDefaults(Pawn P)
        {
        //	if(SkeletalMesh(P.Mesh) != none)
        //		SkeletalMesh(P.Mesh) = default.CharacterMesh;
        
        	if(UTPawn(P) != none)
        		UTPawn(P).SetCharacterMeshInfo(default.CharacterMesh, default.BaseMICParent, default.BaseMICParent);
        
        	P.AirControl = default.AirControl;
        	P.GroundSpeed = default.GroundSpeed;
        	P.WaterSpeed = default.WaterSpeed;
        	P.AirSpeed = default.AirSpeed;
        	//P.Acceleration = default.Acceleration;
        	P.AccelRate = default.AccelRate;
        	P.JumpZ = default.JumpZ;
        	UTPawn(P).DodgeSpeed = default.DodgeSpeed;
        	UTPawn(P).DodgeSpeedZ = default.DodgeSpeedZ;
        }
        
        defaultproperties
        {
        	GroundSpeed=350.0	//440.0
        	AirSpeed=380.0		//440.0
        	WaterSpeed=220.0
        	DodgeSpeed=450.0		//600.0
        	DodgeSpeedZ=245.0	//295.0
        	AccelRate=1024.0
        	JumpZ=322.0
        }

        Comment


        • #19
          And so using this method you could have says 10 different characters with different speeds, health, mana etc, just by checking maybe what character it is and then setting the stats for that character?

          Comment


          • #20
            So if I understand this correctly, this would allow you to set the properties of the any give pawn to the values provided in the FamilyInfo. But unlike my method, it would not change the properties of the pawn for all instances of that pawn in the game?

            Are you sure my method wont work? If each person selects at a menu which character they want, and it spawned each of the corresponding pawns into the game and for each of them they possessed their pawn, you think it would be the case that the last pawn spawned would be the one that every player was playing?

            Comment


            • #21
              We're doing a very similar thing. I made a base pawn with our special abilities that all characters should have (sprinting and regenerating armour) and I was going to extend these to the other custom pawns for our classes. The FamilyInfo route seems like it might be easier though.

              I'm still a little unclear as how to implement this though. Presumably the character would be selected from some sort of menu and then that value would be assigned to a variable so that when you spawn you'll have the correct family with the correct attributes. Where do these scripts actually receive the player selection of which pawn to use? For testing I don't even mind just assigning it to a key press, but I need to know where the value should be passed.

              I'm still pretty green at scripting, but I've got our custom gameinfo, playercontroller, and base pawn created with unique abilities.
              Can anyone shed some more light on this for me?

              Thanks very much

              Comment

              Working...
              X