Skip to content

Commit

Permalink
update Open Source Docs from Roblox internal teams
Browse files Browse the repository at this point in the history
  • Loading branch information
rbx-open-source-docs[bot] committed Oct 31, 2024
1 parent 7d12a08 commit 4df1975
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 30 deletions.
2 changes: 1 addition & 1 deletion content/common/navigation/engine/guides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ navigation:
path: /production/promotion/experience-events
- title: Player Invite Prompts
path: /production/promotion/invite-prompts
- title: Player Referral System
- title: Friend Invite Reward System
path: /production/promotion/referral-system
- title: Experience Notifications
path: /production/promotion/experience-notifications
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions content/en-us/production/promotion/invite-prompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The invite prompt system features the following:
- **Launch Data** — Include optional [launch data](#including-launch-data) that can be read through `Class.Player:GetJoinData()` when the invited friend joins. Example use cases include routing invited friends to a coordinate location or personalizing the joining experience for the invitee.
- **Customizable Text** — Customize the [invite prompt](#prompting-an-invite) message and the [notification](#setting-notification-options) message. For example, an invite prompt for the player may read "Ask your friends to join the adventure!" and the notification message for the invited friend(s) may read "\{displayName\} wants you to join their adventure in \{experienceName\}!".

You can also track and reward inviters and invitees using the [Friend Invite Reward System](./referral-system.md).

<Tabs>
<TabItem label="In-Experience Prompt">
<figure>
Expand Down
10 changes: 6 additions & 4 deletions content/en-us/production/promotion/referral-system.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
---
title: Player Referral System
title: Friend Invite Reward System
description: Use referral links to track and reward players that have successfully invited other players into your experience, and players that have joined your experience using a referral link invitation from another player.
---

<Alert severity="info">
This feature is still in beta. If you'd like to provide Roblox with feedback about this feature, join the [User Acquisition Referrals](https://www.guilded.gg/i/kbQ4Po42) Guilded group.
</Alert>

The referral system encourages existing players to bring new players into your experience, increasing player retention and overall engagement. Players can access and share referral links from [player invite prompts](./invite-prompts.md) or directly from the default in-experience invite menu.
The friend referral system encourages existing players to bring new players into your experience, increasing player retention and overall engagement. Players can access and share referral links from [player invite prompts](./invite-prompts.md) or directly from the default in-experience invite menu.

As a developer, you can use these shareable referral links to:

- Track which players have successfully invited other players into your experience.
- Track which players have joined your experience using a referral link invitation from another player.
- Create and distribute rewards to both inviters and invitees.

To implement a referral system, [set up a referral event](#set-up-a-referral-event) and [create referral rewards](#grant-referral-rewards). The `ReferredByPlayerId` property of `Class.Player:GetJoinData()|GetJoinData()` automatically populates for all types of invitations and gives you access to the user ID of the referring player. You can then access this data in the `Players.PlayerAdded` event to identify the inviter and grant rewards to the inviter and the invitee.
<img src="../../assets/promotion/referral-system/Invite-Friends.png" width="90%" />

To implement a friend referral system, [set up a referral event](#set-up-a-referral-event) and [create referral rewards](#grant-referral-rewards). The `ReferredByPlayerId` property of `Class.Player:GetJoinData()|GetJoinData()` automatically populates for all types of invitations and gives you access to the user ID of the referring player. You can then access this data in the `Players.PlayerAdded` event to identify the inviter and grant rewards to the inviter and the invitee.

```lua
function onPlayerAdded(player)
Expand Down Expand Up @@ -107,7 +109,7 @@ Players.PlayerAdded:Connect(onPlayerAdded)

## Manage Abuse Prevention

You can implement safeguards to prevent players from exploiting the referral system.
You can implement safeguards to prevent players from exploiting the friend referral system.

- Offer one-time rewards to track invitees and make sure they're only rewarded once.
- Introduce a cooldown period before an inviter can submit another referral.
Expand Down
2 changes: 1 addition & 1 deletion content/en-us/studio/game-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ You should only enable the following settings if you trust all assets from other
</tr>
<tr>
<td>**Secrets**</td>
<td>Allows for the creation and configuration of [Secrets](../reference/engine/datatypes/Secret.yaml) for Studio sessions using `Class.HttpService`. Visible only if HTTP requests are allowed.</td>
<td>Allows for the creation and configuration of `Datatype.Secret` for local Studio sessions using `Class.HttpService`. Visible only if HTTP requests are allowed. Secrets defined here are local to the device, and not available in Team Create sessions. Use Creator Hub to define production secrets. </td>
</tr>
<tr>
<td>**Enable&nbsp;Studio&nbsp;Access to API Services**</td>
Expand Down
36 changes: 22 additions & 14 deletions content/en-us/studio/script-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Roblox's built-in, fully-featured script editor includes modern con
The **Script Editor** in Studio is the primary tool for scripting on Roblox. It's a self-improving environment that can help you write high-impact code, shorten your development time, and iterate on your experiences. It can improve your scripting experience by:

- Formatting and highlighting syntax in your code.
- Offering ways to [autocomplete](#autocomplete) phrases in your code as you type.
- Offering ways to [autocomplete](#autocomplete-features) phrases in your code as you type.
- Helping you [navigate code](#code-navigation) by jumping to variable and function declarations.
- Helping you [find and replace](#find-and-replace) code in open scripts or all scripts.
- Providing [real-time feedback](#real-time-feedback) on your code quality and performance.
Expand All @@ -17,29 +17,37 @@ The Script Editor supports all types of [scripts](../scripting/index.md) and ope
You can [customize](#editor-settings) the Script Editor to suit your preferences and workflows, including font family/size, formatting behavior, and colors for syntax highlighting. You can also toggle features such as [autocomplete](#autocomplete), [signature help](#signature-help), and [script analysis](#script-analysis).
</Alert>

## Autocomplete
## Autocomplete Features

The Script Editor generates code-related information that can improve your programming efficiency.
The Script Editor's autocomplete features generate code-related information that can improve your programming efficiency, such as:

- Autocomplete offers suggestions on how to complete phrases as you type them. Use the <kbd>↑</kbd> and <kbd>↓</kbd> keys to browse the suggestions, then press <kbd>Tab</kbd> or <kbd>Enter</kbd> to accept a suggestion and insert the complete phrase.
- **Informed suggestions** on how to complete phrases as you type them that are contextual to the experience's [data model](../projects/data-model.md). For example, if you have a `Class.Model` in `Class.Workspace` called **RocketShip**, autocomplete suggests `RocketShip` when you type `workspace.roc` and indicates that it's a `Class.Model`.

<img src="../assets/studio/script-editor/Autocomplete-Suggestions.png" width="790" alt="Autocomplete showing suggestions based on what user has typed" />
<img src="../assets/studio/script-editor/Autocomplete-Data-Model.png" width="780" alt="Autocomplete showing suggestions based on the experience's data model" />

- Autocomplete is tied to the experience's [data model](../projects/data-model.md). For example, if you have a `Class.Model` in `Class.Workspace` called **RocketShip**, autocomplete suggests `RocketShip` when you type `workspace.roc` and indicates that it's a `Class.Model`.
<Alert severity="info">
Use the <kbd>↑</kbd> and <kbd>↓</kbd> keys to browse the suggestions, then press <kbd>Tab</kbd> or <kbd>Enter</kbd> to accept a suggestion and insert the complete phrase.
</Alert>

<img src="../assets/studio/script-editor/Autocomplete-Data-Model.png" width="790" alt="Autocomplete showing suggestions based on the experience's data model" />
- **Autofill names** for variables and functions that you declare, helping you avoid pesky typos.

- Autocomplete offers names for variables and functions that you declare, helping you avoid typos.
<img src="../assets/studio/script-editor/Autocomplete-Variable.png" width="780" alt="Autocomplete showing suggestions based on a previously declared variable." />

<img src="../assets/studio/script-editor/Autocomplete-Variable.png" width="790" alt="Autocomplete showing suggestions based on a previously declared variable" />
- **Documentation pop-ups with code samples** that are similar to those on the [Engine API Reference](/reference/engine), giving you context on the API's usage.

- The autocomplete pop-up provides documentation and code samples similar to those on the [Engine API Reference](/reference/engine), providing you with context on an API's usage.
<img src="../assets/studio/script-editor/Autocomplete-API.png" width="780" alt="Autocomplete showing suggestions based on a Roblox engine API." />

<img src="../assets/studio/script-editor/Autocomplete-API.png" width="790" alt="Autocomplete showing suggestions based on a Roblox engine API" />
- **On-hover tooltips** that you can customize with your own defined documentation.

- When you type an argument into a function, the autocomplete pop-up also shows the function's **signature**, providing you with a reference for its parameters and return values.
<img src="../assets/studio/script-editor/Autocomplete-CustomDocs.png" width="780" alt="Autocomplete showing custom documentation." />

<img src="../assets/studio/script-editor/Autocomplete-Signature.png" width="790" alt="Autocomplete showing function signature" />
- **On-hover script analysis diagnostics** with information you can use to troubleshoot errors.

<img src="../assets/studio/script-editor/Autocomplete-Diagnostics.png" width="780" alt="Autocomplete showing diagnostic information." />

- **Function signatures** when you type an argument, providing you a reference for its parameters and return values.

<img src="../assets/studio/script-editor/Autocomplete-Signature.png" width="780" alt="Autocomplete showing function signature" />

## Code Navigation

Expand Down Expand Up @@ -137,7 +145,7 @@ Furthermore, all suggestions are generated **by** the AI model and do not transf
The Script Editor supports usage of multiple cursors to make edits simultaneously. You can add cursors based on your needs with a mouse click or keyboard shortcut. The initial cursor is called the **primary cursor** and additional cursors are called **secondary cursors**.

- Edits that you make at the primary cursor copy to the secondary cursors. Each edit counts as one action, so undo/redo of an edit applies to all cursors.
- Widgets such as [autocomplete](#autocomplete) appear on the primary cursor but not the secondary cursors.
- Widgets such as [autocomplete](#autocomplete-features) appear on the primary cursor but not the secondary cursors.
- All of the standard [keyboard shortcuts](#keyboard-shortcuts) for script editing work with multi-cursor editing, including code indentation, toggling comments, and deleting lines.

The following table summarizes multi-cursor workflows and their shortcuts.
Expand Down

0 comments on commit 4df1975

Please sign in to comment.