Announcement

Collapse
No announcement yet.

class inheritence structuring

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

    class inheritence structuring

    I'm fairly new to UnrealScripting. I was wondering if it is wise or even possible to insert a class into the current hierarchy rather then extending what is currently there.

    I want to be able to have ALL Actors contain some extra information so to do this it would make sense to take Object->Actor->... and insert MyClass like Object->MyClass->Actor->...

    Will this cause huge problems or is this as trivial as it should be in an object oriented world?

    #2
    ya

    Um prety new my self so i cant garinty you anything but i think you can
    but thats all i know i dont realy know how thogh

    Comment


      #3
      no, not possible

      Comment


        #4
        You can only extend classes, not insert!
        But you could take all the code out of Actor and place in your own class, then you would have:

        Object->MyClass->WhatEver

        But there are vars and natives in the Actor class which prolly won't work in yours. So I would say, no, and why would you?

        Comment


          #5
          Originally posted by Morphias
          So I would say, no, and why would you?
          The reason is simple

          Suppose you want all children of Actor to have a new variable MyVariable and a new function MyFunction. It would be backwards as heck to go about implementing this by extending each and every child of Actor with a class containing MyVariable and MyFunction. It would be both an implementation and maintenance nightmare.

          But if that's what's gotta be done then that's what will be done!

          Comment


            #6
            I suppose I could always put the contents of the class that I was intending on inserting ( Object->MyClass->Actor->... ) directly into the existing Actor class. That way achieving the desirable inheritance of the variables and functions while avoiding actually "inserting" a class into the hierarchy.

            I am new to Unreal modding so I'm not sure what is a faux pas and what not. I'm just going on traditional OO coding mentality. Is it alright to modify existing classes rather then sticking to the rule of extend extend extend?

            Comment


              #7
              You won't be able to go online anymore if you modify any of the core files...

              Comment


                #8
                I think I see what you're getting at. If I were to insert some variables/functions in the actor class and recompile then I have a new Actor.uc.

                This is for a full blown mod though. If this Actor.uc only exists in the scope of the mod will connecting between clients running the same mod still have issues?

                Comment


                  #9
                  Actor.UC is part of Engine.u


                  MOD's are buotl on top of already existing installs of 2004, I'm pretty sure there is no way to tell the game to use adifferetn engine.u jsut for your mod...

                  Comment


                    #10
                    Ahh ******

                    So then it really is extend, extend, extend. This is going to be a nitemare to implement.

                    The privledge of modifying any bits of the hierarchy must be left to engine licensees only then...?

                    Comment


                      #11
                      Yes, extend extend extend.
                      Im wondering exactly what it is that is so important it needs to be added to actor...

                      Comment


                        #12
                        Originally posted by EvilDrWong
                        Im wondering exactly what it is that is so important it needs to be added to actor...
                        I'm trying to create relationships between any two or more actors in the world. To do this it would be nice to give all subclasses of actor some extra bits of information. I will have to go about this differently b/c going through each child of Actor and deciding if it's worth extending is borderline out of the question

                        Comment


                          #13
                          What is preventing you from storing this information 'off site' so to speak, in another class created specifically for these relationships? As you said, some classes wont need this functionality, and to me it would seem rather backwards to add functionality to everything that only a few subsets of everything will ever have a use for...
                          But thats just me... I only work with mutators, not mods

                          Comment


                            #14
                            If you just need some varibles stored, or a specific funciotn that outputs a certian result, make an actor that just does that and spawn it at the begiing of play, any actors you need to to call this function or variable just refer to the actor you spawed (in fact I did this in my explodohealth mut)

                            Comment


                              #15
                              Hmmm you guys bring up some interesting points with respect to doing this work external to the Actor class. It's going to require going back to the drawing board though. It won't be pretty, but what can we expect for free eh?

                              Comment

                              Working...
                              X