Skip to content

rockyjvec/SpaceJS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Javascript Programmable Block Mod

Steam Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=1537730714

A Javascript Programmable Block mod for Space Engineers.

This mod is experimental and should NOT be used on live servers or games. There are likely memory leaks and other game crashing bugs. You have been warned.

YouTube Demo

SpaceJS

Features

  • Still works with in-game scripts disabled.
  • Scripts can go into an infinite loop and/or run forever and never cause any complexity errors or slow down the server.
  • Smart throttle that prevents more then a set amount of statements from getting executed across ALL programmable blocks. Tested by running an infinite while loop on 64 programmable blocks at the same time with no performance loss. Each block just ran slower: https://youtu.be/qgLJvDc4Zq0
  • Events can "interrupt" the execution of a script. No more needing to write state machines to avoid complexity errors.

Example Code

function playSound()
{
  var soundBlock = Blocks.get("Sound Block");
  if(soundBlock === null)
    console.log("Sound block not found");
  else
    soundBlock.applyAction("PlaySound");
}

Event.onAction("TriggerAlarm", playSound);

Wish List

  • I'm hoping to make it so other mods can add functionality to the API.

Credits

This mod uses a heavily modified version of esprima-dotnet and jint by Sebastien Ros:

https://github.com/sebastienros/esprima-dotnet

https://github.com/sebastienros/jint

The thumbnail is from logo.js by voodootikigod:

https://github.com/voodootikigod/logo.js

About

Javascript Programmable Block replacement for Space Engineers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published