Announcement

Collapse
No announcement yet.

Understanding "Native" Classes

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

    Understanding "Native" Classes

    I was trying to modify a native class like say "X.uc". I get the following error when I run the program:

    "ERROR: X, native class size (1444) does not match scripted class size (1456)"

    From what I understand, a native class is a class that is bound to a DLL file.

    I thought that the option in "UCC make -nobind" allows us to alter these classes as it does not require a bind to a DLL file.

    But from this experience, it would appear I cannot alter a native class at all?

    I am trying to alter a function within this native class X, but I there is a function declared as:

    class X native;

    simulated private function Y()
    {
    }


    Oh oh! So I can't alter the class file, and now I cannot override the function. Is there any way I can override this function?

    #2
    You cannot modify existing classes at all (not only native). Because the function is private, it cannot be overriden and it is marked as private with some reason. Wrong way - you have to think stmh else.

    Comment


      #3
      The idea is that you extend existing classes, not modify them.

      Code:
      class X extends Actor;
      This creates a class that is a subtype of Actor. It inherits all Actor code, so there's no need to copy/paste any code into it. You can override the Actor functions to create new functionality.

      Comment


        #4
        You can override the Actor functions to create new functionality.
        I believe, from Skrillax's answer, in this particular extended class I cannot override the function because it is private.

        Thanks for the responses. Clears my head up now

        Comment

        Working...
        X