Announcement

Collapse
No announcement yet.

removing unwanted default properties from extended classes

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

    #16
    To make a gametype have vehicles you just need ballowvehicles = true or something, you dont need to extend ons.

    In my turret spawning gun i just stuck level.game.ballowvehicles=true; in the postbeginplay and they work in all gametypes now.

    Not sure if thats the exact bool but its close.

    Comment


      #17
      hi
      i also want to know how to set a defaultproperty to none without getting a log error

      Comment


        #18
        You all seem to be getting way to snazzy. Why not just // out the default property you don't want - if you don't define a value, it won't have one .

        Comment


          #19
          butcherboy....if you extend the raptors original code that will not work. I made a jetpack and I didnt want a weapon with it! When you subclass something you automatically INHERIT all properties of the SUPERCLASS. You dont even have to set any properties in that case because they are allready set. In order to remove properties that you dont want you have to take a step back in the classes and create your own class of a vehicle. I didnt want a weapon with my jetpack and when i // out the weapon it still had one. Even using NONE or 0 would not work. SO its like this.....
          Code:
          flying vehicles          ->Raptor                 ->my vehicle
          ONSCHOPPERCRAFT->ONSATTACKCRAFT->Jetpack
          in that case my jetpack WILL HAVE all the protperties of the raptor no matter what I do. UNLESS I set them to something different. When you do it like this there is no way to REMOVE INHERITED properties alltogether. This way is easier but you have less flexibility.

          Code:
          flying vehicles         ->my vehicle
          ONSCHOPPERCRAFT->JETPACK
          Doing it like this you have to completely code the vehicle, but you can set your own properties for your vehicle. Its harder but more flexibility. You can set YOUR OWN properties and dont have to worry about INHERITING properties that you dont want.

          Doing it in the previous one I just copied ALL the code from the raptor to mine and removed what bit I didnt want and changed what I did want. So its not that hard really. And its just all down hill from there just for tweaking it!

          Comment


            #20
            i wanna delete some weapon defaultprops
            using this method gonna be a *lil* harder...
            so if there is any other way to kill out properties please share

            Comment


              #21
              Its not all that hard really....just take the code from the vehicle that you wish to subclass and remove what you dont want and just edit what you do want to keep.

              Plus there isnt a way to kill out properties that are inherited!

              Comment


                #22
                There should be a kill function

                What you can do though, like for instance if you extend teh redeemer and dont want it to be blown up if its shot, and dont want it to be shot at by bots (cheap ********!!) you can just take the takdamage function from the redeemer and copy it to your class then delete anything in it and just leave it blank.

                Like to get rid of your jetpacks weapons you could have just tried copying the giveweapon or whatever its called function (in vehicle or something) into your class and left it blank, then that default propertie would be meaningless afaik.

                Comment


                  #23
                  That wont work either...tried that.....properties wont work like that either...functions yeah....but not properties...

                  Comment


                    #24
                    Yeah but if the function is where the propertie is used then it will cancel it out, at least im pretty sure.

                    Comment


                      #25
                      very possible....but i would just assume to add it all in and just remove what i dont want.

                      Comment


                        #26
                        Copying & pasting the entire class's code to change a few default values is a bit overkill. You can override the default value of any property in your derived class with whatever you want.
                        Code:
                        class Base extends Object;
                        
                        var bool bFoo;
                        
                        defaultproperties
                        {
                            bFoo=True
                        }
                        
                        // ====
                        
                        class Derived extends Base;
                        
                        defaultproperties
                        {
                            bFoo=False
                        }
                        So for all objects of class Derived, bFoo will be false, and for any objects of class Base, bFoo will be true. You can do the same thing for a function, by overriding the function in your subclass and just putting empty brackets. There's always a few different ways to solve code problems, some are easier than others - even so, I've never had to copy the entire class to just change a few properties.

                        Which properties are you trying to clear the value for?

                        Comment


                          #27
                          I believe his problem is not removing a default property, but removing array items of a default property... from what I gather, he's working in the ONSAttackCraft class, which has the array StreamerEffectOffset(). Here is what is listed in the default properties:

                          Code:
                          StreamerEffectOffset(0)=(X=-219.000000,Y=-35.000000,Z=57.000000)
                          StreamerEffectOffset(1)=(X=-219.000000,Y=35.000000,Z=57.000000)
                          StreamerEffectOffset(2)=(X=-52.000000,Y=-24.000000,Z=142.000000)
                          StreamerEffectOffset(3)=(X=-52.000000,Y=24.000000,Z=142.000000)
                          if I'm not mistaken, he wants to make the array's upper bound '1', therefor getting rid of StreamerEffectOffset(2) & (3). He's tried setting the two unneeded items = None but had no luck.

                          Comment


                            #28
                            Originally posted by kisk
                            if I'm not mistaken, he wants to make the array's upper bound '1', therefor getting rid of StreamerEffectOffset(2) & (3). He's tried setting the two unneeded items = None but had no luck.
                            That's because the instrinsic null value of a vector is not 'None', it's '(X=0,Y=0,Z=0)'. However, this would still leave you with a 4 member dynamic array, with the last two items having no values.

                            The best thing to do in this case is to remove the unwanted elements from the array in your subclass of ONSAttackCraft.
                            Code:
                            event PreBeginPlay()
                            {
                                Super.PreBeginPlay();
                            
                                if ( StreamerEffectOffset.Length > 2 )
                                    StreamerEffectOffset.Remove(2, StreamerEffectOffset.Length - 2);
                            }

                            Comment


                              #29
                              Originally posted by Orion Pax
                              butcherboy....if you extend the raptors original code that will not work. I made a jetpack and I didnt want a weapon with it! When you subclass something you automatically INHERIT all properties of the SUPERCLASS. You dont even have to set any properties in that case because they are allready set. In order to remove properties that you dont want you have to take a step back in the classes and create your own class of a vehicle. I didnt want a weapon with my jetpack and when i // out the weapon it still had one. Even using NONE or 0 would not work. SO its like this.....
                              Code:
                              flying vehicles          ->Raptor                 ->my vehicle
                              ONSCHOPPERCRAFT->ONSATTACKCRAFT->Jetpack
                              in that case my jetpack WILL HAVE all the protperties of the raptor no matter what I do. UNLESS I set them to something different. When you do it like this there is no way to REMOVE INHERITED properties alltogether. This way is easier but you have less flexibility.

                              Code:
                              flying vehicles         ->my vehicle
                              ONSCHOPPERCRAFT->JETPACK
                              Doing it like this you have to completely code the vehicle, but you can set your own properties for your vehicle. Its harder but more flexibility. You can set YOUR OWN properties and dont have to worry about INHERITING properties that you dont want.

                              Doing it in the previous one I just copied ALL the code from the raptor to mine and removed what bit I didnt want and changed what I did want. So its not that hard really. And its just all down hill from there just for tweaking it!
                              I missed the part where you said you inherited from a derrived "end node" class. The above is why I just open the vehicle I want to base on, save it under a new vehicle setup, and slice and dice as needed - commenting out lines and doing it this way works quite nice.

                              One thing that helped me thus far is printing out all the parent classed up until and including the parent class that inherits "actor". There are oodles of things that you can add that are not part of the default properties of any given vehicle subclass.

                              Comment


                                #30
                                Hey thanks Ron....this will be very helpful. How about removing the drivers weapon. I have tried NONE....and O....and it still spawns a weapon in the original location of the ships spawn location. The weapon does not move with the ship either. It just stays there at the original location.

                                Comment

                                Working...
                                X