Announcement

Collapse
No announcement yet.

vehicle factory mut question

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

    vehicle factory mut question

    I have some edited vehicle factories and I'm trying to create a mutator to replace a stock vehicle factory with the one I created, like replacing the Onslaught.ONSRVFactory with MyPackage.MyONSRVFactory. This way, I don't have to edit an existing map to include my vehicles. Is there a mutator template out there that can do this? I really don't know a lot about creating a script from scratch, so any help would be appreciated. Here's a link to the map I edited that includes the modified vehicles so you can get an idea of what I mean...

    http://www.ataricommunity.com/forums...hreadid=379267

    #2
    Take a look at the Vehcile Arena Mutator, it's a good start

    Comment


      #3
      i did take a look at it, not sure where to start. As far as I understand, the vehicle arena mutator will replace ALL vehicles with the chosen vehicle...I'm looking for a way to replace a given factory with my own factory...kind of like what you were asking in the thread "replacing an actor:"

      http://www.ataricommunity.com/forums...hreadid=378165

      mind if I just fool around with that script you posted?

      thanks man

      Comment


        #4
        I think this can help, here is a Mutator class which will replace all ONSRVFactory with your own factory

        Code:
        class MutMyONSRVFactory extends Mutator;
        
        function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
        {
          if ((ONSRVFactory(Other) != None) && (MyONSRVFactory(Other) == None))
          {
            ReplaceWith(Other, "MyPackage.MyONSRVFactory");
            return false;
          }
        
          return true;
        }
        
        defaultproperties
        {
          GroupName="Arena"
          bNetTemporary=True
          bAlwaysRelevant=True
          RemoteRole=ROLE_SimulatedProxy
        }
        Note that the GroupName is Arena, so you won't be able to use other Arena mutator (like instagib, and so on). Just simply change the group name to any other thing to allow Arena mutators

        Hope this will help.

        Comment


          #5
          foreach AllActors( class 'ONSVehicleFactory', Factory )
          {
          if (Factory.VehicleClass == class'ONSRV')//vehicle that you want to change.
          Factory.VehicleClass = class'mycar'; //vehicle that you want to change it to.


          (taken from TGA onslaught mutator)

          Comment


            #6
            Well bringit...
            Your code is good to replace a factory vehicle with another vehicle. But I think brystle18's goal is to replace a factory with another factory

            Comment


              #7
              ah sorry, my mistake

              Comment


                #8
                ok, I created the script for the mutator, replaced groupname to "Vehicle", created the .ucl file for it, saw it in the mutator list...but it does not change any "ONSRVFactory" 's to MyONSRVFactory...I tried to go back and change the groupname to "Arena" just to see if I could get it to work, and now I keep getting a compiling error:

                Error: C:\UT2004\VehicleMutators\Classes\MutMyONSRVFactor y.uc(5) : Error, Bad or missing expression in parenthesis

                and it is refering to:

                Code:
                if ((ONSRVFactory(Other) != None) && (MyONSRVFactory(Other) == None))
                nothing has changed since compiling of the code the first time except that I created the .ucl file for it after I compiled it...does this have anything to do with it? Any thoughts on why the mutator wasn't working in the first place?

                I really appreciate all the help guys. Thanks!!

                Comment


                  #9
                  ok I figured out why it wasn't compiling, for some reason, the error message came from having the already compiled package *.u file in my system directory. Anyways, that problem is solved. Now my problem is that the actual mutator doesn't work. This is what I have in my VehicleMutators.ucl file:

                  Code:
                  Mutator=(ClassName=VehicleMutators.MutMyONSRVFactory,GroupName=VehicleArena,FallbackName="Chaingun Jumping Scorpion",FallbackDesc="Replaces the Plasma Cannon with a Superchaingun, as well as increased speed and jumping capabilities.")
                  Mutator=(ClassName=VehicleMutators.MutMyONSPRVFactory,GroupName=VehicleArena,FallbackName="Double Chaingun Jumping Hellbender",FallbackDesc="Replaces the Side Gun with a Superchaingun, gives the driver control of a normal Chaingun,  and gives the Hellbender increased speed and jumping capabilities.")
                  Vehicle=(ClassName=MyPackage.MyONSPRVFactory,FallbackName="Super Hellbender",FallbackDesc="Super Chaingun Hellbender")
                  Vehicle=(ClassName=MyPackage.MyONSRVFactory,FallbackName="Super Scorpion",FallbackDesc="Super Chaingun Scorpion")
                  I know that I can't use both at once this way, but I'm just trying to get the mutator to work. The mutator doesn't work. It sees it in the mutator list but it just doesn't seem to replace the factory with the one specified...I got the 'Group' names correct but I just am too new at this to know whyay I am doing wrong. Any help would be reeeeallly appreciated.

                  Comment


                    #10
                    Hope this helps:
                    http://forums.gibbering.net/index.php?showtopic=346

                    Comment


                      #11
                      for some reason I think that site is down GuruKnight....

                      Warbler: Any thought as to why I can't get the mutator to replace the factory? I used your exact script from above...Is it something I'm doing wrong in the VehicleMutators.ucl file? Never done a mutator before so help would be awesome dude. Thanks!

                      Also...Any idea on how to export a package file other than using unreal editor? if so, I have a mutator that replaces factories with different factories but I can't get unreal editor to export the script correctly from the package...thanks!

                      Comment


                        #12
                        Well, I think that the (ONSRVFactory(Other) != None) part of the code is wrong because I gave you this class name without looking at Epic sources.... Maybe the ONSRVFactory class has another name. Look in the sources, this will help you

                        Comment


                          #13
                          hey warbler, I solved the compiling problem, you had the class calls correct. The problem is still that I cannot get the mutator to work. It compiles fine but it just doesn't actually work. Can you look at the .ucl file script above and tell me if that looks right? Thanks dude!

                          Comment


                            #14
                            Well, I suggest you to put the mutators in the same package as your new vehicles/Factory.... Because UT2004 doesn't like crossing muts !

                            And by the way, if your package is named "MyPackage", I suggest you to name the ucl file "MyPackage.ucl"...

                            Because UT2004 use the file name to know which ucl file to load for which package !

                            Hope this will help

                            Comment


                              #15
                              OK, I took your advice and renamed everything to MyPackage (including the .ucl file). Here is what the MyPackage.ucl file looks like right now:

                              Code:
                              Mutator=(ClassName=MyPackage.MutMyONSRVFactory,GroupName=Vehicle2,IconMaterialName=MutatorArt.nosym,FriendlyName=MyPackage.MutMyONSRVFactory.FriendlyName,Description=MyPackage.MutMyONSRVFactory.Description,FriendlyName=MyPackage.MutMyONSRVFactory.FriendlyName,FallbackName="Super Chaingun Scorpion",FallbackDesc="Replaces the UT2004 Scorpion with one that has a Super Chaingun and can jump.")
                              Mutator=(ClassName=MyPackage.MutMyONSPRVFactory,GroupName=Vehicle1,IconMaterialName=MutatorArt.nosym,FriendlyName=MyPackage.MutMyONSPRVFactory.FriendlyName,Description=MyPackage.MutMyONSPRVFactory.Description,FriendlyName=MyPackage.MutMyONSPRVFactory.FriendlyName,FallbackName="Super Chaingun Hellbender",FallbackDesc="Replaces the side turret on the Hellbender with a Super Chaingun and gives the driver control of a normal Chaingun. The Hellbender can also jump now.")
                              Vehicle=(ClassName=MyPackage.MyONSRVFactory,FallbackName="Super Scorpion",FallbackDesc="Super Chaingun Scorpion")
                              Vehicle=(ClassName=MyPackage.MyONSPRVFactory,FallbackName="Super Hellbender",FallbackDesc="Super Chaingun Hellbender")
                              Unfortunately, I cannot get the mutator to work. If your script works (which I'm sure it does), then this mutator should be working...I just can't figure out where I am going wrong here. Thanks for all your help warbler :up:

                              Comment

                              Working...
                              X