-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String improvements #475
String improvements #475
Conversation
…dded backticks concatenation documentation to the Strings documentation.
…to string interpolation when convenient, documented string interpolation.
…rings when suitable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @010DevX101, thanks so much for helping improve the Roblox creator documentation! Our technical writing team will review your pull request soon. In the meantime, please ensure you've read through the README.md, contribution guidelines, and style recommendations.
content/en-us/education/build-it-play-it-story-games/finish-and-add.md
Outdated
Show resolved
Hide resolved
Resolved the linting issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great changes for readability. I pointed out the syntax or context issues I found that require further follow up.
content/en-us/education/build-it-play-it-story-games/code-the-story.md
Outdated
Show resolved
Hide resolved
@@ -197,7 +197,7 @@ function explodeCommand(commandData) | |||
local success = makeExplosion(character) | |||
|
|||
if success then | |||
Utilities:sendSystemSuccessMessage(commandData, string.format(commandData.Speaker.Name .. " made" .. parameter .. " explode.")) | |||
Utilities:SendSystemSuccessMessage(commandData, `{commandData.Speaker.Name} made {parameter} explode.`) | |||
else | |||
Utilities:SendSystemErrorMessage(commandData, string.format("'s' is not a valid player.", parameter)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converted the above string.format
but not this one, we should be consistent. There are other usages that also were missed. Make sure to refine your search query to catch all the applicable cases.
content/en-us/education/build-it-play-it-story-games/code-the-story.md
Outdated
Show resolved
Hide resolved
``` | ||
|
||
4. In the story variable, concatenate the next story string using `..` Be sure to include a space after the end of the sentence. | ||
4. In the story variable, define a string using backticks. This allows to concatenate variables using `{}`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows to
reads awkwardly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be modified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
****
|
||
<TabItem label="Generation Angle"> | ||
The [generation angle](#generation-angle) sets the most important view of your mesh which will be prioritized during generation. Changing this angle can often help eliminate inconsistencies in textures. | ||
|
||
- Setting the generation angle to highlight the meaningful faces of your mesh will result in better generations. | ||
- For flat objects like plates, swords, and fences, make sure the generation angle displays a view with a high surface area. | ||
- For humanoid and animal meshes, experiment with different generation angles, such as a head-on view of the face and a side view profile, to find the most consistent and coherent texture. | ||
</TabItem> | ||
|
||
<TabItem label="Iterative Refinement"> | ||
Generating the most suitable textures is an iterative process. It helps to preview often and tweak prompts incrementally to reach your vision. | ||
|
||
- If a texture doesn't meet your expectations, identify what to change instead of starting over. For example, tweak the color or pattern description. | ||
- Change the prompt word order. Words at the beginning of the prompt can have more weight when generating. | ||
- Generate several previews to compare different prompts, or try the same prompts with different [seeds](#seed-control) to get a preview that fits your vision. | ||
</TabItem> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intentional? Does it change anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this was a merge of the branch main of this repository and the branch main of my fork.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this branch is up to date, it shouldn't show any diff to main that you didn't commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, I don't remember editing that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it's from here 034e32d
Possibly an auto-formatter running in your editor; it may or may not be a good change, hard to tell without being able to preview it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it may have been automatic, when I made the pull request, there were some linting issues and I ran a command in the console which fixed them (can't remember which command right now), I'll take a look though.
@@ -159,14 +159,14 @@ Print functions display text on the screen, as you saw earlier. It's one of the | |||
|
|||
### Combining Strings | |||
|
|||
You can display any string in the Output using `print()`; you can even print multiple strings stored within variables or typed directly within the function. **Concatenation** is combining strings. To concatenate the string assigned to your variable and a second string, use two dots `..` The following example concatenates two variables and two typed strings. | |||
You can display any string in the Output using `print()`; you can even print multiple strings stored within variables or typed directly within the function. **Interpolation** is combining strings. To interpolate the string assigned to your variable and a second string, use backticks and brackets (`{}`). The following example interpolates two variables and two typed strings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing ()
so that it doesn't confuse the syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also these backticks will probably be interpreted by the markdown renderer and not show up in the actual syntax example. Probably need to do something like
`` `{}` ``
to get it to show up correctly. Applies elsewhere too, please address this everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if it’s even possible for to have backticks as code lol, will try it out though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing
()
so that it doesn't confuse the syntax
Where should I remove the parenthesis? In the print()
or (`{}`
)?
(Also, made the backticks show up together with the brackets)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was referring to the (`{}`
)
@@ -175,6 +175,6 @@ Play around with printing different combinations of strings. | |||
|
|||
New scripts can be created by clicking the + button next to the name of an object. ServerScriptService is a common place to create new scripts. New scripts include the default code `print("Hello world!")`. This code will display `Hello world!` in the Output window, where you can see the results of your code and if any errors have occurred. | |||
|
|||
"Hello world!"' is an example of a string data type. Strings can include any combination of characters that you might type on your keyboard. Concatenation is when multiple strings are combined. | |||
"Hello world!"' is an example of a string data type. Strings can include any combination of characters that you might type on your keyboard. Interpolation is when multiple strings are combined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an entirely complete definition of interpolation, but may suffice for the purposes of this tutorial. cc @Roblox/documentation for wording review
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I expand the definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll let a tech writer comment an opinion on this
Name = "Bobbie", | ||
Type = "Dog", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we use tabs (or 4 spaces?), but not 3 spaces, cc @Roblox/documentation for style review
applies here and to below changes in this file
} | ||
```lua | ||
local enemy = { | ||
Name = "Spike", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing doesn't seem right here, review all these spacing changes on this page please
Thanks for the reviews, I’ll make said changes soon. |
Content check failed when merging from branch main? |
|
This pull request has been inactive for 14 days. If it remains inactive for another 7 days, it will close. Please update or comment on this pull request to keep it open. 🙏 |
**** |
I haven’t had time to make said changes. I believe I will either close the pull request until I'm free or make the changes soon. |
This pull request has been inactive for 14 days. If it remains inactive for another 7 days, it will close. Please update or comment on this pull request to keep it open. 🙏 |
This pull request has been inactive for 21 days. It's closing now. Please feel free to reopen it if you still need it. 🙏 |
Changes
strings.md
.Checks
By submitting your pull request for review, you agree to the following: