Announcement

Collapse
No announcement yet.

removing unwanted default properties from extended classes

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

    removing unwanted default properties from extended classes

    Code:
    StreamerEffectOffset(0)=(X=-50.000000,Y=-12.000000,Z=-6.000000)
    ok i have two, two many of these. How do I go about removing the extra two that I do not want. I have tried setting it to NONE and it wont work.

    #2
    Id like to know this too, ive tried setting things to none and alot of times it will work but log lots of errors, and i want to try to keep the log clean.

    To try to help you though, what i did in a few cases was just clone the entire class i was subclassing and make my class with that and just leave out what i didnt need.

    Comment


      #3
      In other words dont extend the exact thing that i want to copy. Instead extend the superclass with the defaults that I WANT? Like making my own real class instead of copying it?

      Comment


        #4
        Well yeah i guess, theres prolly a better way though.

        Like i opened up the grenade.uc (the one that comes out of the assault rifle) and renamed it gasdamage.uc and changed all the things in the code and properties that i needed, basically removing all the effects, making the explode time really fast, turning phy to none and removing the model etc.

        So instead of it being gasdamage extends grenade, i just cloned greande which was grenade extends projectile and made it gasdamage extends projectile :O

        Prolly a noob way of doing it but heh whatever works >_<

        Comment


          #5
          Yeah that was what i meant. I might try that.

          Comment


            #6
            Okay, you two guys always seem to be tackling exactly the same sort of stuff I want to try... Except I suck at code! So I wonder if you can help me with something to do with making a new vehicle.

            I want to make a type of animated Mecha. I've nearly finished the model, complete with skeleton and IK. Now here's my idea.

            Pawn is the clas of player characters in the game, right? So most of the activities of a mecha can be covered by just calling functions from Pawn. And Vehicle is an extension of Pawn... SVehicle an extension of Vehicle... ONSVehicle - blah, blah, blah...

            Is there a way to make a new class of vehicle (my Mecha) that acts very much like an oversised player model - BUT copies a whole wad of the code from the vehicle subclasses, to make it possessable, tilt over uneven ground, carry mounted weapons etc.?

            I am a MORON! I'll tell you that right now. The best I could do is copy, paste and maybe fiddle blindly with some of the numbers. Can you guys tell me if this is gonna work, or should I just stick to designing hot air ballon models to replace the raptor? The competition is almost a month from deadline so I'd love to get this idea up and running.

            What do ya say? Help me out?

            I'll probably post this in its own thread in a bit, just seemed that you two handle this sort of stuff all the time.

            Comment


              #7
              I would think that just extending it as a vehicle would work. Not too sure about the walking part tho. There is a mech mod allready but it hasnt been ported to ut2k4 yet....maybe if you search for it on the map/mods release forums and find the author and ask him how he did his.....

              Comment


                #8
                I'm facing the same dilemma you guys are facing.

                I want to make a game mode using vehicles but I don't want all the default baggage that comes with simply extending Onslaught. So I tried to compile Onslaught in to Mymod by starting to change class names in files copied from Onslaught so I can start slashing stuff I don't need.

                Well, turns out you can't make a verbatim copy of Onslaught and compile it under a different name with ucc because there are native functions which need resources that don't ship with the game. And I'm talking really low level stuff like ONSWeapon which is a child of ACTOR.

                Yes. You read it right. ACTOR. And, the native function that won't compile deals with limiting the weapon's pitch so it's not a call that can be chucked either.

                Someone forwarded me the original C++ for the problem function but that's not a good answer either since I don't want to work in C++. I mean, what's the point of using unreal if I have to resort to C++...

                Anyway, I've come to the personal conclusion that I'll just have to grin and bear it for now and put up with the extra defaults which will never get used in my mod. I'm sure there is a way to get around it just doesn't look like it's worth the time to go that far. Maybe things will be better structured next time around.

                Comment


                  #9
                  if you want to inheret the parent clsses defaultproperties just delete or comment out the line.

                  Comment


                    #10
                    With other packages its possible to do that. I would figure ONSLAUGHT would be possible of that. Tho I dont plan on messing with that any time soon. Right now all I can do is code vehicles....my next project will be adding normal weapons to vehicles. Then I will probably learn how to code my own weapons then....eventually I will get there...but slowly.

                    Comment


                      #11
                      Originally posted by FireCrack
                      if you want to inheret the parent clsses defaultproperties just delete or comment out the line.
                      I believe he doesn't want to inherit the extra properties... he wants to make them null in his subclass.

                      good question orion... I'm interested in hearing an answer from somebody too

                      Comment


                        #12
                        Well kisk its like Major there said. Instead of extending the actual item that you want, create your own subclass of it. For example, in my case I wanted to make a jetpack that would fly like the raptor, but i dont want a weapon on it, and i had too many of the streamer effects. So instead of subclassing the actual raptor code I subclassed its superclass. Here is an example of each to show the difference.

                        In normal cases you would just subclass the actual item that you want:

                        Code:
                        class myjetpack extends ONSAttackCraft placeable;
                        ONSAttackCraft is the ACTUAL raptor code, doing it like this my jetpack will automatically inheret all the properties of it. This is bad if there are properties that you dont want in your class.

                        In other cases you can subclass the same SUPERCLASS that the item you want to copy has. In other words ONSAttackCraft subclasses ONSChopperCraft.

                        Code:
                        class myjetpack extends ONSChopperCraft placeable;
                        In this case we are creating our own subclass of a vehicle with its own defaults. So you will need to copy most of the code from the raptor....paste it in this NEW subclass, and delete what you dont want.

                        Does that make any sense?

                        Oh and your right....i didnt want to inheret certain properties from my ships subclass. I allready know it inherets everything.

                        Its like you said Mr. Evil.....i've become an expert at this. After all the trouble i had before....except i still havent figure out how to set the location/rotation to a static mesh attached to a bone on my vehicle....lol

                        Comment


                          #13
                          yeah that makes sense.. thats probably the best (maybe only) way to do it.

                          however, I would still like to know if its possible to completely get rid of items in an default property array.. like skin[] and some of the emitter stuff. hell, if anybody knows, Mr. Evil would

                          Comment


                            #14
                            If you do it the way I described then yeah you wont have to use that stuff. Its the only way....I have tried setting it to 0 and to NONE and it wont work.... The only way to remove stuff you dont want is to do it that way.

                            Comment


                              #15
                              OMG! A 'problem' w/ inheritance!

                              Nice thread ... definately something to remember

                              Comment

                              Working...
                              X