Announcement

Collapse
No announcement yet.

Question about creating a mutator

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

    Question about creating a mutator

    I would like to create a very simple mutator that permanently changes the value of one variable inside a parent class... is this possible and if so, how can I go about doing it? I tried having one Mutator file and one code file that is underneath the parent file with said variable and I included the .int file accordingly... it compiled and ran but did not work.

    #2
    To change the variable of an already existing parent you need to find it (using a foreach allActors(class, OutActor, optionalmtach)

    And making actor others variable equal yours (class(Other).variabel = blah

    You can do this in the PreBeginPlay of your mutator

    or you can jsut replace all actors as the are spawned with yours using checkreplacement

    Comment


      #3
      Well I'm looking to change the VolleySpeedSelf property of the parent to the value 1800 for example... I know where it's located, it's located in DB_HammerPrimaryFire

      Can you maybe direct me from there because I'm terribly new and what you said kinda confused me...

      This is what I have so far...

      class DB_MutDBVO extends Mutator;

      var float NormalVolleySpeed;

      function PreBeginPlay()
      {
      DB_HammerPrimaryFire.default.VolleySpeedSelf = NormalVolleySpeed
      }

      defaultproperties
      {
      NormalVolleySpeed = 2800.000000
      Description="Reverts self-volley speed to the DeathBall 2.0 settings that DavidM had changed cause he's a ****tard!"
      MutatorClass="Deathball.DB_DeathBall"
      }

      Comment


        #4
        Alright in that case your gonna have to make your own DB_Hammar

        (since I can't get DB to work on UT 2004 for whatever reaosn the following will only be sort of accurate... sorry)

        Code:
        class MyDBHammer extends DB_Hammer;
        
        defaultproperties
        {
            FireModeClass(0)=MyHammerFire
            ItemName="My DB Hammer"
            Description="Yay I fixed what I think is wrong with someone elses work, though it is their decision ;)"
        }
        then:

        Code:
        class MyHammerFire extends DB_HammerPrimaryFire;
        
        defaultproperties
        {
             volleyspeedself=2800
        }
        and use a mutator to replace the already present DBHammer:
        Code:
        class myDBMut extends Mutator;
        
        
        function prebeginplay()
        {
            defaultweapon=class'myu.MyDBHammer';
        }
        
        defaultproperties
        {
            FriendlyName="My New DBHammer Yay!!!"
            Description="Woopee I think Cliffy B should listen to this mut idea it's leet."
        
            bAlwaysRelevant=true
            RemoteRole=ROLE_SimulatedProxy
            bNetTemporary=true
        }
        I'm not 100% on the mut code either since I have never tried to just replace the default item... It should work]

        As for my comments, I'm drunk Weeeeeee

        Comment


          #5
          Still didn't work... will that variable declared in "MyHammerFire" always take precedence over the parent default property.

          Second: Would how I create my INT file affect its functionality as well? If so, can you possibly post how it should be laid out, I get it to show in the Mutator list but I'm not sure that's enough.

          Comment


            #6
            Ok I need to ask are you using this with 2004 or 2003?

            Comment


              #7
              2004

              Comment


                #8
                1st yes any variable value set in a subclass overrules the parent value.
                So if myParent has myvalue=1, and mySubclas has myvalue=2, if you summon the subclas myvalue will be 2

                2nd. If the mutator is showing up in game then the .ucl was autogenerated (to make one yourself use 'ucc exportcache'). .ini's in Ut2004 are like an appendix. Unrequired (they are only used for multilanguage support now).

                My guess is a that:
                Code:
                function prebeginplay()
                {
                    defaultweapon=class'myu.MyDBHammer';
                }
                Did not work...

                Try using the Arena mutator to choose your weapon and see if it works...

                Another thing to do to see if it was actually brought in game is add the following code to MyDBHammer:
                Code:
                function prebeginplay()
                {
                    log("Yay I was spawned");
                    Super.PreBeginPLay();
                }
                And check to see if that was ever added to the log file

                Comment


                  #9
                  Doesn't appear it ever was added to the log file... can you maybe contact me via AIM or IRC if I provide said info?

                  Comment


                    #10
                    You could except I'll be gone till tommowor

                    Did you try the mut again, or did you try arena this time as well?

                    Comment


                      #11
                      I tried the arena mutator and the custom hammer did appear in there... I activated it, but still nothing... I'm not sure, anyway my AIM name is the same as my user name "AMPonzi". I did try the mutator again but the game acted like nothing was changed.

                      Comment

                      Working...
                      X