Skip to content
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

Closed
wants to merge 17 commits into from
Closed

String improvements #475

wants to merge 17 commits into from

Conversation

010DevX101
Copy link

@010DevX101 010DevX101 commented Mar 22, 2024

Changes

  • Documented string interpolation in strings.md.
  • Switched from string concatenation to string interpolation in all scripts when convenient as it is a more modern way of combining strings (introduced in Luau).
  • Improved script syntax in multiple scripts across the documentation.

Checks

By submitting your pull request for review, you agree to the following:

  • This contribution was created in whole or in part by me, and I have the right to submit it under the terms of this repository's open source licenses.
  • I understand and agree that this contribution and a record of it are public, maintained indefinitely, and may be redistributed under the terms of this repository's open source licenses.
  • To the best of my knowledge, all proposed changes are accurate.

@010DevX101 010DevX101 requested review from a team as code owners March 22, 2024 15:13
@github-actions github-actions bot added education Changes the Education content engine guides Changes the Engine guides engine reference Changes the Engine API Reference documentation resources Changes the Resources content tutorials Changes the tutorials labels Mar 22, 2024
Copy link

@github-actions github-actions bot left a 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.

@github-actions github-actions bot added the changes requested This pull request has changes requested prior to merging label Mar 22, 2024
@010DevX101 010DevX101 closed this Mar 22, 2024
@010DevX101 010DevX101 reopened this Mar 22, 2024
@github-actions github-actions bot added the tools Makes non-content changes label Mar 22, 2024
@010DevX101
Copy link
Author

Resolved the linting issues.

Copy link
Contributor

@Nightriff Nightriff left a 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.

@@ -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))
Copy link
Contributor

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/cloud-services/datastores.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 `{}`.
Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be modified.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

****

Comment on lines +196 to +212

<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>

Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Contributor

@Nightriff Nightriff Mar 29, 2024

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

Copy link
Author

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.

Copy link
Contributor

@Nightriff Nightriff Mar 29, 2024

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

Copy link
Author

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.
Copy link
Contributor

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

Copy link
Contributor

@Nightriff Nightriff Mar 28, 2024

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.

and I had to do backtick inception to get it to show up as desired in this github comment too 😂

Copy link
Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

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)

Copy link
Contributor

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.
Copy link
Contributor

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

Copy link
Author

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?

Copy link
Contributor

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

Comment on lines 14 to 15
Name = "Bobbie",
Type = "Dog",
Copy link
Contributor

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",
Copy link
Contributor

@Nightriff Nightriff Mar 28, 2024

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

@010DevX101
Copy link
Author

Thanks for the reviews, I’ll make said changes soon.

@github-actions github-actions bot added the assets Changes content/en-us/assets/ label Apr 3, 2024
@010DevX101 010DevX101 closed this Apr 3, 2024
@010DevX101 010DevX101 reopened this Apr 3, 2024
@010DevX101
Copy link
Author

Content check failed when merging from branch main?

@010DevX101 010DevX101 closed this Apr 4, 2024
@010DevX101 010DevX101 reopened this Apr 4, 2024
@010DevX101
Copy link
Author

Error: Process completed with exit code 1. occurs while running quality checks.

@010DevX101 010DevX101 marked this pull request as draft April 8, 2024 13:38
Copy link

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. 🙏

@github-actions github-actions bot added the stale label Apr 22, 2024
@io1ismz
Copy link

io1ismz commented Apr 26, 2024

****

@010DevX101
Copy link
Author

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.

@github-actions github-actions bot removed the stale label Apr 26, 2024
Copy link

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. 🙏

@github-actions github-actions bot added the stale label May 11, 2024
Copy link

This pull request has been inactive for 21 days. It's closing now. Please feel free to reopen it if you still need it. 🙏

@github-actions github-actions bot closed this May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assets Changes content/en-us/assets/ changes requested This pull request has changes requested prior to merging education Changes the Education content engine guides Changes the Engine guides engine reference Changes the Engine API Reference documentation resources Changes the Resources content stale studio Changes the Studio content tools Makes non-content changes tutorials Changes the tutorials
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants