BYOND 5.0 Version 516 Release Notes
Build 516.1648
Fixes (More Info)
Dream Seeker
- Breaking change: Previously, render_source replaced an icon with the render_target by anchoring to the center of the icon. This was stupid, because it created the need for hacky workarounds and it produced a ton of annoying bugs, but it was also unintuitive. Now, when render_source replaces an icon it anchors to the lower left, just as if you were simply using a different icon. (Lummox JR)
Features (More Info)
DM Language
- New screen_loc keywords have been added for specifying the edge of the HUD (including any extra tiles added by the HUD) rather than the edge of the map. These are SCREEEN_SOUTHWEST, SCREEN_NORTHEAST, etc. They work like the regular dir keywords but include HUD extensions. Note that HUD objects using these keywords will not extend the HUD any further.
- Sounds can now be linked to atoms and move with you thanks to the sound.atom and sound.transform vars. The relative x,y of the atom to the listener (virtual eye) will be run through a 3x3 matrix in sound.transform and the resulting 3D position added to the sound's existing x,y,z vars.
- A new animation flag, ANIMATION_END_LOOP, can be used to gracefully end the loop of a previous sequence when superseding it, or when stopping animation entirely.
- New icon_w and icon_z vars have been added to atoms, which specify the home position of the icon relative to the lower left corner. They act like negative pixel_w/z, except they are NOT inherited by any overlays, etc. They apply only to a single icon.
- New convenience procs have been added for doing fast operations on associative lists that hold numbers as their associated values, such as list("apple"=3, "orange"=10). This is mainly to drive performance in certain games.
The new procs are:
- values_sum: Returns a total of all associated numbers in the list
- values_product: Returns a product of all associated numbers in the list (1 if no numbers)
- values_dot: Returns a dot product of the numbers in two associative lists, by multiplying the numbers associated with matching values
- values_cut_under: Cuts all values from a list whose associated numbers are below a certain threshold
- values_cut_over: Cuts all values from a list whose associated numbers are above a certain threshold
- lerp() has been added, which does interpolation at a lower level between two values of the same type: numbers, vectors, pixlocs, and matrix.
- sign() was tragically overlooked in the addition of new math procs to 515. This has been rectified.
- 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.
- A new <=> operator has been added. This returns negative if the first value is less than the second, 0 if they're equal, or positive if the first value is greater.
- A new type of associative-only list, called alist(), can be used for improved performance in some cases where you want key-value pairs without other list baggage. Some differences from regular lists include:
- No random access (can't get the Nth item)
- No duplicated "keys"
- Numbers can be used as keys
- for(item,value in list) can now loop through the items in a list and grab the associated value at the same time.
- A new pragma directive, #pragma syntax C, allows you to specify C-like syntax for switch() or for for() loops. In switch(), this means you now have a case statement and fall-through behavior, with the break keyword ending a switch case. In for loops this means you can use the semicolon as a separator in place of a comma, so multiple statements can be chained together. These changes can be done individually or both together, and also respond to the pragma push/pop directives.
- load_ext() has been added to pre-load a function in an external library. The result of load_ext() can be passed to call_ext() as a single argument in place of call_ext(library_name, function_name).
- astype() is a new proc that effectively acts as a built-in (istype(a,b) ? a : null), but faster. It's mainly useful for situations where you want to conditionally call a proc, like astype(player,/mob)?.Bounce().
- animate() now supports a tag argument for named animation sequences.
- A new /vector primitive has been added. This is (for now) a 2D or 3D numerical vector, and it has support in various movement procs. As a primitive, it doesn't descend from /datum and can't be overridden.
The new vector() proc is used to create a vector.
- A new /pixloc primitive has been added, representing an x,y,z position including step_x/y offsets. It has support in various movement procs. As a primitive, it doesn't descend from /datum and can't be overridden.
Additionally, an atom.pixloc var has been added. This can be used to directly read or (for movables) write an atom's pixloc.
The new pixloc() proc creates a pixloc, and bound_pixloc() grabs the pixloc of the center/edge/corner of an atom's bounding box.
- filter() now accepts a name argument. Named filters can be looked up in the filter list for an atom by name instead of by index.
Dream Daemon
- Breaking change: The ~= and ~! operators now take associated values into account when checking associative lists.
- Byondapi: Byond_CRASH() has been added. Note that this will NOT trip any stack unwinding or error traps in your library.
Dream Seeker
- A new winset option has been added for WebView2. Using a blank control name, you can send a browser-options parameter that's a comma-separated list of the following:
- find: Make the Ctrl+F find option available
- devtools: Make devtools available, for debugging your HTML/CSS/JS
- zoom: Make zoom available
- refresh: Make the refresh option available
- byondstorage: Add a new API for saving data locally, since localStorage won't really work
The byondStorage API is actually three different items: hubStorage (shared with all instances of the same hub entry), serverStorage (specific to a hub and server URL), and domainStorage (serverStorage without including the port number). These have different uses depending on the game. They behave like localStorage in principle.
Pages served through the browser control will also have access to a new BYOND JavaScript API which has two functions: BYOND.winset(id,params) and BYOND.winget(id,params); the latter returns a Promise and can be used with the await keyword.
- A new .sound command can be run on the client, for use in skins that might want to play a sound when interacting with the skin.
- Breaking change: SIDE_MAP and ISOMETRIC_MAP have had changes to their positioning behavior. In SIDE_MAP, the lower left corner of the icon is now always anchored relative to the lower left corner of an object's bounding box. In isometric, this is the left corner. This is contrary to old behavior that anchored southwest corner to southwest corner, because "southwest" isn't always the lower left if client.dir changes.
bound_x/y still exist but they act as negative offsets in pixel_w/z space, which is basically in keeping with old behavior. It's actually preferable now that you don't use bound_x/y, but just use pixel offsets which are inherited or else use the new icon_w/z vars.
Everything
- Browser controls now use WebView2 instead of the old embedded IE. The old embedded IE code is still present but will be phased out during the beta.
This is a massive step up for the engine since it means users are no longer tied to the ancient, horrendous Trident engine and its stupid, stupid issues.
515 Release Notes | View All