Client Difference Log
API Changes
Added Class ConfigureServerService : Instance [NotCreatable] [Service]
Added Class VoiceChannel : Instance
Added Property bool ImporterGroupSettings.InsertInWorkspace
Added Property bool ImporterRootSettings.InsertInWorkspace
Added Property bool MetaBreakpoint.ContinueExecution {RobloxScriptSecurity} [Hidden] [ReadOnly]
Added Property Vector2 ScrollingFrame.ScrollVelocity {RobloxScriptSecurity} [Hidden] [NotReplicated]
Added Property string TextBox.ContentText [ReadOnly]
Added Property string TextButton.ContentText [ReadOnly]
Added Property string TextLabel.ContentText [ReadOnly]
Added Property bool VRService.VRDeviceAvailable {RobloxScriptSecurity} [Hidden] [ReadOnly]
Added Function bool AvatarEditorService:NoPromptUpdateOutfit(int64 outfitId, HumanoidDescription humanoidDescription, Enum.HumanoidRigType rigType) {RobloxScriptSecurity}
Added Function void AvatarEditorService:PerformUpdateOutfit(HumanoidDescription humanoidDescription) {RobloxScriptSecurity}
Added Function void AvatarEditorService:PromptUpdateOutfit(int64 outfitId, HumanoidDescription updatedOutfit, Enum.HumanoidRigType rigType)
Added Function void AvatarEditorService:SignalUpdateOutfitFailed() {RobloxScriptSecurity}
Added Function void AvatarEditorService:SignalUpdateOutfitPermissionDenied() {RobloxScriptSecurity}
Added Function void MetaBreakpoint:SetContinueExecution(bool enabled) {RobloxScriptSecurity}
Added Event AvatarEditorService.OpenPromptUpdateOutfit(int64 outfitId, HumanoidDescription humanoidDescription, Enum.HumanoidRigType rigType) {RobloxScriptSecurity}
Added Event AvatarEditorService.PromptUpdateOutfitCompleted(Enum.AvatarPromptResult result)
Changed the parameters and return-type of Function MetaBreakpoint:SetEnabled
from: (bool enabled, Function status) -> int
to: (bool enabled) -> void
Changed the value of EnumItem RigType.R15 from 1 to 0
Changed the value of EnumItem RigType.Rthro from 2 to 1
Changed the value of EnumItem RigType.RthroNarrow from 3 to 2
Changed the value of EnumItem RigType.Custom from 5 to 3
Changed the value of EnumItem RigType.None from 6 to 4
Removed Property ImporterRootSettings.ZeroOrigin
Removed EnumItem RigType.R6
Removed EnumItem RigType.S15
(Click here for a syntax highlighted version!)
As a mac user, thank you so much. This was making me very sad.
I think there’s a typo on this. “ConentText”.
Absolutely love this! Great timing too, as I just finished writing a UI Library called Pract (A declarative library similar to Roact) that greatly benefits from ternary operators like this.
Many thanks to the terrain engineers for fixing the strength setting with the erode tool not missing. It was difficult attempting to precisely modify terrain at small scales.
I’ve utilized the leafy grass texture to represent piles of trash. I use this trick often in my showcases. It works very well! However, seemingly minor alterations in terrain on a large scale reflected substantially on a part-based scale. As I had tight hallways, a little terrain could be the difference between a walk-able or enclosed hallway!
I’m happy that I can finely tune my terrain with 0.1 strength again. Thank you! <3
Spelling mistake, supposed to be ContentText
I love how this can be used inside of if statements:
if if if true then true elseif true then true else false then false elseif false then true else false then print(1) elseif print(2) then print(3) else print(4) end
Since it supports elseif, it isn’t really a ternary operator:
local v = if a then b elseif c then d else e
-- ↑ ↑ ↑ ↑ ↑
-- 1 2 3 4 5
-- quinary operator?
Any number of elseif
may be used in the if
expression, so it is a variadic operator.
I think selection expression would be a good name for this operator, at least it states more than the amount of expressions it needs.
Might I be the first to say—if you do use chained elseif operators, please use newlines/indentation to make it properly readable:
Example (My existing code, using and/or):
local breakpointScale = ((viewportSize.X > 1920) or (viewportSize.Y > 1080))
and 2
or ((viewportSize.X > 1280) or (viewportSize.Y > 720))
and 1.5
or ((viewportSize.X > 800) or (viewportSize.Y > 599))
and 1.25
or 1 -- This gets scaled back up on mobile resolutions (<800x599)
Would become:
local breakpointScale = if ((viewportSize.X > 1920) or (viewportSize.Y > 1080))
then 2
elseif ((viewportSize.X > 1280) or (viewportSize.Y > 720))
then 1.5
elseif ((viewportSize.X > 800) or (viewportSize.Y > 599))
then 1.25
else 1 -- This gets scaled back up on mobile resolutions (<800x599)
I do like how in the latter case, it’s a lot clearer what the statement following each and/or actually means, rather than being ambiguous (particularly, the last “or” acts differently from the rest of the “ors” in the chain)
Please don’t ever do this, just be a reasonable person and make it into a function (with the added bonus that it’s reusable now):
local function getBreakpointScale(viewportSize)
if viewportSize.X > 1920 or viewportSize.Y > 1080 then
return 2
elseif viewportSize.X > 1280 or viewportSize.Y > 720 then
return 1.5
elseif viewportSize.X > 800 or viewportSize.Y > 599 then
return 1.25
else
return 1
end
end
NATIVE
TERNARY
OPERATOR
SUPPORT
AAAAAAAAAA
I would’ve preferred something akin to a ? b | c
but i’ll take it
What would be the use case of the “if expression” if you think this looks unreasonable then? It seems like most cases of having an if expression that gets to an “elseif” clause could easily be replaced by a function.
This is a judgment call and without looking at the rest of the code, knowing the stylistic preferences and performance characteristics I would not recommend prescribing one over the other. Naming has a cognitive cost; reuse can be a burden; and advice must be context sensitive.
Excellent writing on the subject from John Carmack (just as above, not to be treated as universal guide of any kind - merely as a point of view): Jonathan Blow's home page
FWIW “if expression” is the official name; let’s leave selection expression for possible future switch/match
When are you using semicolons as opposed to commas in english lists?
You should file a bug report on this for visibility, seems pretty bad.
Humanoid.RigType
uses the Enum.HumanoidRigType
enum, which still has the R6
value. It doesn’t use the Enum.RigType
enum that is shown here. AFAIK, that’s a brand new enum which is not currently used anywhere.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.