Announcement

Collapse
No announcement yet.

Minor Mutator

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

    Minor Mutator

    Im bussy on a little mutator which lets u modify the players in a ini file. This is based on some tutorials from INIQUITOUS. But im really bad in fixing errors, so I was wondering if someone could help me:

    Code:
    //====================================
    //			PawnModifier
    //		The Minor-Modification
    //		  Scripted by Troy
    //====================================
    class ModifyPawn extends Mutator config(PawnModifier);
    
    var config float StartHealth;
    var config float Jump;
    var config float SpeedGround;
    var config float SpeedAir;
    var config float SpeedWater;
    var config float SpeedFalling;
    var config float MaxSuperHealth;
    
    simulated function PostBeginPlay()
    {
    	Super.PostBeginPlay();
    	{
    		Health = StartHealth;
    		JumpZ = Jump;
    		GroundSpeed = SpeedGround;
    		AirSpeed = SpeedAir;
    		WaterSpeed = SpeedWater;
    		MaxFallSpeed = SpeedFalling;
    		SuperHealthMax = MaxSuperHealth;
    	}
    }
    
    function ModifyPlayer(Pawn Other)
    {
    	if ( NextMutator != None )
    		NextMutator.ModifyPlayer(Other);
    }
    
    defaultproperties
    {
    	GroundSpeed=+00440.000000  		//This is how fast the players moves on the ground.
    	AirSpeed=+00440.000000  		//This is how fast the player moves in the air.
    	WaterSpeed=+00300.000000  		//Thi is show fast the player moves through water.
    	JumpZ=+00420.000000  			//This is the ammount of acceleration applied when a player jumps.
    	MaxFallSpeed=+1200.0 			//This is maximum speed the player can land at without taking damage, a really high value basically means no falling damage (This also affects the paths that Bots can take).
    	Health=100  					//This is the starting health ammount.
    	HealthMax=100  					//The is the maxium health value that health packs can heal.
    	SuperHealthMax=199  			//Health vials and other things such as the regeneration mutator heal to this limit.
    }
    Code:
    ----- PawnModifier (Release)
    Analyzing...
    Parsing ModifyPawn
    Compiling ModifyPawn
    Error in ModifyPawn.uc (19): '{': Bad command or expression
    Compile aborted due to errors.
    Failure - 1 error(s), 0 warning(s)
    Help me please.

    Thanks

    #2
    dont use PostBeginPlay, its not needed here, have a look at modify player function on this page

    http://wiki.beyondunreal.com/Legacy:MutTutorial

    see if you can work it out

    modify player is called on each player every time they spawn, so if you want to change the players settings such as health, we use modify player to change it when they spawn.

    Comment


      #3
      However, note that ModifyPlayer is called ONLY once you respawn, that is, on initial spawn you won't be modified. To counter that, add a call to ModifyPlayer() in your PostBeginPlay (with a for loop to fill in the function parameters).

      Comment


        #4
        works perfect for first spawn for me.. iv used it in many mutators.. and before the count down for players to start if you spawn fire key it will show log's from modify player too..

        Comment


          #5
          Doesn't work for me with my custom playerpawn mutator.

          Comment


            #6
            You need a reference to the player somewhere. Just having "GroundSpeed =" isn't enough. The mutator/game doesn't know whos groundspeed you are talking about. That is why ModifyPlayer is a good place to put the code because it has a reference to the player through "Pawn Other". So we can use Other.GroundSpeed. Which means "The Pawns GroundSpeed".

            Re-read my tutorial gl

            Comment


              #7
              Originally posted by GreatEmerald View Post
              However, note that ModifyPlayer is called ONLY once you respawn, that is, on initial spawn you won't be modified. To counter that, add a call to ModifyPlayer() in your PostBeginPlay (with a for loop to fill in the function parameters).
              Sorry, but that's entirely wrong. ModifyPlayer() is called whenever a player spawns. Additionally, it is also called whenever the Speed combo wears off. Make sure you check for that special case.

              Comment


                #8
                thanks all. the wiki site was very usefull, now lets try adding a GUI menu to configure it for normal people who dont understand INI files.

                Comment


                  #9
                  Originally posted by Wormbo View Post
                  Sorry, but that's entirely wrong. ModifyPlayer() is called whenever a player spawns. Additionally, it is also called whenever the Speed combo wears off. Make sure you check for that special case.
                  Like I've said, tell that to my mutator...

                  Comment


                    #10
                    Unbelieveable, I didn't had a clue how UScript works. I'm glad someone pointed me to take a good look again at other source's or tutorials.

                    Now I have a new question. Does anyone knows a simple mutator with an ingame popup menu, cause I want to add that to my mutator to if that's possible, and trying to make an exec function which calls the menu.

                    Comment


                      #11
                      I have a screenshot of a menu I created in my thread, post #14. To create something similar I suggest you take a look at UT2K4PlayerLoginMenu. Scroll down to the Panels array in the defaultproperties and look up the corresponding classes. In my thread, meowcat also provided me with this link that explains the GUI classes and this link, which is invaluable for adjusting the positions of your menu and its components ingame. I’d go into detail myself, rather than just referring you to the classes and links, but GUI programming is a little involved.

                      Comment

                      Working...
                      X