Scrap Mechanic

Scrap Mechanic

Not enough ratings
ScrapComputers Extended
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
352.194 KB
Mar 18 @ 10:10am
Nov 26 @ 3:05am
23 Change Notes ( view )

Subscribe to download
ScrapComputers Extended

Description
Computer API & Component Enhancements

Global / sc
  • debugf(format, ...)
    Logs messages in the dev console with different severity levels ('error', 'info', 'warning')

os
  • os.date( format: string?, timestamp: number? ) --> string | table
    Returns formatted date/time based on the given format and timestamp.

math
  • math.sign( x: number ) --> number
    Returns 1 if positive, -1 if negative, or 0.

  • math.round( x: number, digits: number? ) --> number
    Rounds a number.

  • math.isnan( x: number ) --> boolean
    Checks if the value x is nan (Not a Number).

================ Component Changes =================

GravityController
  • GravityController.applyImpulse( impulse: Vec3, worldSpace: boolean?, offset: Vec3? )
    Applies an impulse to the object.

  • GravityController.applyTorque( torque: Vec3, worldSpace: boolean? )
    Applies torque to the object.

  • GravityController.getWorldGravity() --> number
    Returns the current world gravity.

  • GravityController.getCenterOfMass( wholeCreation: boolean ) --> Vec3
    Returns the center of mass of the object. If wholeCreation is true, returns the average center of mass for all connected bodies.

Motor
  • Motor.getCurrentLength() --> number
    Returns the current piston length (only one piston can be connected).

  • Motor.getBearingsData() --> table
    Returns bearings data:
    angle: number
    angularVelocity: number
    appliedImpulse: number
    isReversed: boolean

  • Motor.getPistonsData() --> table
    Returns pistons data:
    length: number

SeatController
  • SeatController.getCameraData() --> table | nil
    Returns camera data:
    position: Vec3
    rotation: Vec3
    direction: Vec3
    fov: number

Misc / QOL fixes
  • Transparent Lua Computer GUI.
  • Fixed colored error messages in chat (# --> ##).
  • Russian language support.

Feel free to share your ideas and suggestions in the comments!
1 Comments
_/Mahorin/_ May 31 @ 3:37am 
very noice, i was thinking of making an addon for ScrapComputer to have the access to applyImpulse and applyTorque so happy to see that you had the same idea and did it !