Skip to content

[QUESTION]: How to import a class from a seperate script in a different script #214

@CharGoldenYT

Description

@CharGoldenYT

For my question, I'm looking for an answer relating to Funkin's API implementation, but I would also like tips on implementing this into my own API Handler as I'm making my own game.

The general idea is I have script A in one folder lets say [GameName]/mods/[ModA]/scripts/ScriptA.hxc and Script B in another folder in assets [GameName]/assets/scripts/ScriptB.hxc

and the code for Script B is

import gamename.backend.scripting.Script; // The import path for whatever the script extends, but will be represented as Script.
Class ScriptB extends Script
{
   public var someVariable:Bool = false;

   public function new() {
       super('ScriptB');
   }
}

But for Script A I want to import the ScriptB class, how would I do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions