JSPM

unreal-remote-execution

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 60
  • Score
    100M100P100Q75933F
  • License MIT-0

Package to connect to a Unreal Engine instance and execute python commands

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (unreal-remote-execution) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Unreal Engine Remote Execution

    NodeJS module for connecting to Unreal Engine and running Python commands/code.

    Notes

    In this API Unreal Engine instances are referred to as "nodes".

    Examples

    Running a command on the first remote node found

    import { RemoteExecution } from 'unreal-remote-execution';
    
    const remoteExecution = new RemoteExecution();
    
    // Start the remote execution server, this will start looking for remote nodes
    remoteExecution.start();
    
    // Get the first remote node found, with a timeout of 5 seconds
    remoteExecution.getFirstRemoteNode(5000).then(
        async (node) => {
            // Once a node is found, open a command connection
            // this will allow us to run commands on that node
            await remoteExecution.openCommandConnection(node);
            
            // Execute a command
            const result = await remoteExecution.runCommand('print("Hello World")');
            console.log(result);
    
            // Close down the servers & connections once we are done
            remoteExecution.stop();
        },
        () => {
            console.log("No remote nodes found!");
        }
    );

    Connecting to a spesific Unreal Engine instance

    import { RemoteExecution } from 'unreal-remote-execution';
    
    const remoteExecution = new RemoteExecution();
    
    // Add a listener that is called when a node is found
    remoteExecution.events.addEventListener('nodeFound', async (node) => {
        // Check if e.g. the project name matches
        if (node.data.project_name === "My Project") {
            await remoteExecution.openCommandConnection(node);
            
            // code continues here...
        }
    });
    
    // Start looking for remote nodes
    remoteExecution.start();

    *This is a third-party module and is not associated with Epic Games or Unreal Engine in any way.