Skip to content

Document extending scripted classes in scripts - #65

Open
kiryvajiravuth wants to merge 1 commit into
FunkinCrew:masterfrom
kiryvajiravuth:my-first-cookbook-pr
Open

Document extending scripted classes in scripts#65
kiryvajiravuth wants to merge 1 commit into
FunkinCrew:masterfrom
kiryvajiravuth:my-first-cookbook-pr

Conversation

@kiryvajiravuth

Copy link
Copy Markdown

Closes #51

Adds a new "Extending Scripted Classes" section to the Scripted Classes
article (Advanced/02.ScriptedClasses.md).

Since update 0.8.2, scripted classes can extend other scripted classes
rather than only native scriptable classes. The section documents:

  • A worked example with a reusable scripted base class (MyBaseChar.hxc)
    and a subclass that extends it (MyChar.hxc), including override and
    super usage.
  • Key rules:
    • A defined new() must call super(); a missing constructor
      auto-calls the superclass constructor.
    • Instance fields that collide with a superclass field throw an error.
    • Scripted functions/fields inherit through the whole chain of scripted
      superclasses.
    • Extending native scriptable classes still works as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Document the ability to extend scripted classes in scripts

1 participant