Skip to content

516 compatability #421

@LemonInTheDark

Description

@LemonInTheDark

516 is going stable pretty soon, so I thought it'd be a good idea to scope out what needs implementing to support it fully.

Atoms

  • Icon offsets
/atom
	var/icon_w
	var/icon_z

Animations

  • New flag ANIMATION_END_LOOP
  • New animate() argument, tag
  • New animate() argument, command (IE, a client command, string)

Filters

  • New radial/angular blur filter argument, offset (do we even care? no right)
  • filter() now supports a name argument, which also means the /atom/var/list/filters list may sometimes have assoc keys (do we care?)

Misc Global Procs

  • New list procs
  • lerp()
  • sign()
  • astype()
  • load_ext()
// All assoc only
/proc/values_sum(list/Alist) -> Number
/proc/values_product(list/Alist) -> Number
/proc/values_dot(list/A, list/B) -> /list?
/proc/values_cut_under(list/Alist, Min, inclusive = 0) -> /list
/proc/values_cut_over(list/Alist, Max, inclusive = 0) -> /list

// Takes nums, vectors, pixlocs and matrices
/proc/lerp(type/A, type/B, factor) -> type/output

/proc/sign(A) -> Number //lmao

/proc/astype(Val) -> null if Val does not match its implied type, the Val otherwise
/proc/astype(Val, Type) -> null if Val's type does not match asserted type, the Val otherwise

/proc/load_ext(library_name, function_name) -> "A reference to a function in an external library, for use with call_ext()" whatever that means

List Hell

New assoc only list, called "alist"s because byond is v imaginative. No ordered access, no duped keys, numbers can be keys. IDK how much we need to do for this. Missing details because my head is a sink, see #420 for impl of vars and such

  • alist() and associated list type
  • for(key,value in list) list iteration syntax

New Operators

  • <=> Returns -1 if the first value is less then the second, 0 if they're equal, 1 if the first is greater. Overloadable

Pixlocs

New primitive for describing pixel positions
Atom loc can in theory be set to this?

  • Math proc support
  • pixloc()
  • Typedef/typed procs
  • bound_pixloc()

Taken as input by:

/proc/min()
/proc/max()
/proc/clamp()
/proc/round()
/proc/floor()
/proc/ceil()
/proc/trunc()
/proc/fract() 
/proc/pixloc(x, y, z) -> /pixloc
/proc/pixloc(Atom)  -> /pixloc
/proc/pixloc(Atom, x, y)  -> /pixloc
/proc/pixloc(Atom, Vector)  -> /pixloc
/proc/pixloc(Pixloc)  -> /pixloc
/proc/pixloc(Pixloc, x, y) -> /pixloc
/proc/pixloc(Pixloc, Vector) -> /pixloc

/proc/bound_pixloc(atom/Atom, Dir) -> /pixloc

/atom/var/pixloc/pixloc // nother banger varname

/pixloc
	var/atom/loc
	var/step_x
	var/step_y
	var/x
	var/y
	var/z

/pixloc/operator-(pixloc/A) -> /vector
/pixloc/operator-(vector/A) -> /pixloc
/pixloc/operator+(pixloc/A) -> /vector
/pixloc/operator+(vector/A) -> /pixloc
/pixloc/operator%(num) -> /vector
/pixloc/operator%%(num) -> /vector

Pragma stuff

  • #pragma syntax C, allows you to specify C-like syntax for switch() or for for() loops (This sounds like a bitch)

Proc Changes

New proc vars, caller and callee (the latter referring to the proc itself), return information about running procs and can be used to access their information. These vars return a new /callee primitive object. This can be used to trace a call stack in a custom error handler, for instance.
Sooooo

  • /callee type information
  • caller/callee vars implicit to procs
/callee (read only) (but lists are NOT IMMUTABLE, AHHHHHHHHHHHHHHHHHHHHH)
	var/list/args 
	var/callee/caller 
	var/category 
	var/desc 
	var/file*
	var/name 
	var/line* 
	var/proc 
	var/datum/src 
	var/type 
	var/mob/usr 

* Debug only

Sounds

  • New sound vars
/sound
	var/atom/atom // I love it here
	var/matrix/transform

Vectors

Not the C array thing, vector as in math. 2/3 dimensions only rn
New primitive type, supports [] indexing and being iterated by a list

  • Vector list mimicing
  • Math proc support
  • Init procs
  • Typedef/typed procs
    Taken as input by:
/proc/min()
/proc/max()
/proc/clamp()
/proc/round()
/proc/floor()
/proc/ceil()
/proc/trunc()
/proc/fract() 
/proc/vector(x, y)
/proc/vector(x, y, z)
/proc/vector(String)
/proc/vector(List)
/proc/vector(Vector)
/proc/vector(Pixloc)

/vector
	var/len
	var/size
	var/x
	var/y
	var/z

/vector/proc/Cross(vector/B) -> /vector
/vector/proc/Dot(vector/B) -> Number
/vector/proc/Interpolate(vector/B, t) -> /vector
/vector/proc/Normalize() -> /vector
/vector/proc/Turn(angle) -> /vector
/vector/proc/Turn(vector/B) -> /vector

// "Vectors support most math operations" someone needs to work out which in detail. It's at least these
/vector/operator+(vector/A) -> /vector
/vector/operator-(vector/A) -> /vector
/vector/operator*(vector/A) -> /vector
/vector/operator*(num) -> /vector
/vector/operator/(vector/A) -> /vector
/vector/operator/(num) -> /vector

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions