Skip to content

Commit cbb7e5e

Browse files
authored
Merge pull request Tria-Studio#2 from coderheck/master
Pull Request Tria-Studio#1
2 parents fdb708d + 84340f3 commit cbb7e5e

24 files changed

+686
-127
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
build
22
node_modules
33
package-lock.json
4-
wally.lock
4+
wally.lock
5+
foreman.toml

.moonwave/custom.css

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.memberString_node_modules-docusaurus-plugin-moonwave-src-components-styles-module {
2+
font-size: 1.3rem;
3+
margin-bottom: 2rem;
4+
margin-left: 1rem;
5+
background-color: rgb(26, 30, 36);
6+
padding: 1.5%;
7+
}

.vscode/settings.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,8 @@
55
"robloxLsp.typeChecking.mode": "Strict",
66
"robloxLsp.typeChecking.options": {
77
"infer-instance-from-unknown": true
8-
}
8+
},
9+
"robloxLsp.diagnostics.disable": [
10+
"duplicate-doc-class"
11+
]
912
}

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<html>
2+
<head>
3+
</head>
4+
<body>
5+
<div align="center">
6+
<br></br>
7+
8+
<strong>TRIA.os MapLib Documentation</strong><br></br>
9+
10+
This is the documentation on MapLib methods, features, tutoials and other scripting-related issues.<br></br>
11+
</div>
12+
</body>
13+
</html>

default.project.json

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"name": "Tria-Escape-MapLib",
33
"tree": {
4-
"$className": "ModuleScript",
54
"$path": "src"
65
}
76
}

docs/Tutorials/EffectScript.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# EffectScript
2+
3+
EffectScript is a localscript inside of the Tria.OS Map Making Kit, it should be used as an alternative to the LocalMapScript if you want your code to be replicated to other spectators.
4+
5+
In order for the EffectScript to communicate we use RemoteEvents which are fired from the MapScript to the EffectScript.
6+
7+
When a round starts all the old EffectScripts are deleted and if a new EffectScript is present, the script will be inserted into the Players PlayerGui, this is to prevent the EffectScript from being deleted if the player dies.
8+
9+
If you wish to manually edit the EffectScript the location of it is `game.Players.LocalPlayer.PlayerGui`
10+
Keep in mind that reparenting the EffectScript will cause the EffectScript not to be deleted on the next round and can potentially cause memory leaks.
11+
12+
## Example of usage
13+
14+
The EffectScript uses the same methods as the MapScript to get the MapLib, being
15+
`local MapLib = game.GetMapLib:Invoke()()`
16+
17+
Below is a simple example of how to use the EffectScript, in this example we will make a laser effect similar to Dystopia.
18+
19+
MapScript
20+
```lua
21+
local MapLib = game.GetMapLib:Invoke()()
22+
local map = MapLib.map
23+
24+
task.wait(10)
25+
map.StartLaser:FireAllClients()
26+
27+
task.wait(10)
28+
map.StopLaser:FireAllClients()
29+
```
30+
31+
EffectScript
32+
```lua
33+
local MapLib = game.GetMapLib:Invoke()()
34+
local map = MapLib.map
35+
36+
local RunService = game:GetService("RunService")
37+
38+
local connection
39+
40+
map.StartLaser.OnClientEvent:Connect(function()
41+
connection = RunService.Heartbeat:Connnect(function()
42+
laser.CFrame *= CFrame.Angles(math.rad(1), 0, 0)
43+
end)
44+
end)
45+
46+
map.StopLaser.OnClientEvent:Connect(function()
47+
if connection then
48+
connection:Disconnect()
49+
end
50+
end)
51+
```
52+
53+
54+
55+
56+
57+

docs/Tutorials/SeamlessSpectate.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Seamless Spectate
2+
3+
# Making spectating seamless
4+
When you make a map you might notice that certain things may cause spectating to act strangely, this can be caused by various things that are documented below.
5+
6+
## Anchoring the player
7+
When you anchor the player it stops the replication of the player, when the player is unanchored it takes a second for the replication to start again which makes it looks like the player is lagging for other players.
8+
9+
### Mitigation
10+
If you want to anchor the player but you also want the effect to be seamless then you need to set the players client position to the desired position every heartbeat.
11+
Example:
12+
```lua
13+
local RunService = game:GetService("RunService")
14+
15+
-- Put the players CFrame into a variable
16+
local anchorPoint = humanoidRootPart.CFrame
17+
18+
-- Begin the anchor
19+
local heartbeat = RunService.Heartbeat:Connect(function()
20+
-- Set the characters Velocity to 0
21+
humanoidRootPart.AssemblyLinearVelocity = Vector3.new()
22+
-- Set the characters CFrame to the saved point
23+
humanoidRootPart.CFrame = anchorPoint
24+
end)
25+
26+
-- End the anchor
27+
heartbeat:Disconnect()
28+
```
29+
30+
## Changing the characters position on the server
31+
When you change the position of the character on the server it takes over replication from the client, this causes similar effects to anchoring the player
32+
33+
### Mitigation
34+
To make the effect seamless all you need to do is make the teleportation happen on the client, not only will this make the teleportation seamless to other players it will also make the effect more seamless for the player as well.

docs/intro.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# Basics of scripting in ROBLOX Studio and TRIA.os
6+
7+
Welcome to the scripting documentation of TRIA.os!<br></br>
8+
By default we assume you have some knowledge of general scripting in ROBLOX Studio so the documents will sound a bit nerdy, but if you don't have the neccessary information, you can consult this page.
9+
10+
## Booleans
11+
12+
Boolean is an easy-to-understand data type which one has two values: `true` or `false`. Think of it like a light switch, there are only two states a light bulb can be which is on or off.<br></br>
13+
In [conditional statements](https://create.roblox.com/docs/scripting/luau/control-structures#if-statements), if a boolean isn't `false` or `nil`, Luau (the scripting language used for Studio) will assume the boolean as `true`.<br></br>
14+
15+
## Strings
16+
17+
String is a data type used to store text data, such as letters, numbers and symbols.<br></br>
18+
To declare a string, type out anything you want and then wrap that thing in double quotes (`"`) or single quotes (`'`).<br></br>
19+
`Example:`<br></br>
20+
```lua
21+
message = "Hello world!"
22+
```
23+
Combining (or concatenating) strings is quite simple, add two periods (`..`) between those strings. Concatenating strings won't insert a space between them so you'll have to put one yourself at the end of the first string and beginning of the next string or concatenate a space (`" "`) between the strings.<br></br>
24+
`Example:`<br></br>
25+
```lua
26+
message1 = "Hello"
27+
message2 = "world!"
28+
message2WithSpaceAtTheBeginning = " world!"
29+
print(message1 .. " " .. message2) -- Hello world!
30+
print(message1 .. message2WithSpaceAtTheBeginning) -- Hello world!
31+
print(message1 .. message2) -- Helloworld! (this is not a typo)
32+
```
33+
34+
## Tables
35+
36+
Tables are used to store multiple types of data that isn't `nil` (which is nothing) such as booleans, numbers, strings, functions,...<br></br>
37+
You can declare a table by curly braces (`{}`).
38+
`Example:`<br></br>
39+
```lua
40+
table1 = {} -- creates an empty table
41+
print(table1) -- {}
42+
```
43+
Tables can be used as arrays or dictionaries. Arrays use numbered lists for indexing data; dictionaries can have numbers, strings, objects as indices.

moonwave.toml

+36-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
title = "Tria Escape MapLib"
2-
GitRepoUrl = "https://github.com/Tria-Studio/Tria-Escape-MapLib"
1+
title = "TRIA.os MapLib Documentation"
2+
GitRepoUrl = "https://github.com/Tria-Studio/Tria-Escape-MapLib"
3+
gitSourceBranch = "master"
4+
5+
[home]
6+
enabled = true
7+
includeReadme = true
8+
9+
[docusaurus]
10+
favicon = "https://coderheck.github.io/assets/TRIAosLogoGradient.png"
11+
12+
[[classOrder]]
13+
section = "MapLib"
14+
classes = ["MapLib"]
15+
16+
[[classOrder]]
17+
section = "Features"
18+
classes = ["Skills", "PlayerUI", "Settings", "Players", "Cleanup", "Teleport"]
19+
20+
[[classOrder]]
21+
section = "Miscellaneous"
22+
classes = ["Janitor"]
23+
24+
[[navbar.items]]
25+
href = "https://discord.gg/tria"
26+
label = "Discord"
27+
position = "right"
28+
29+
[[navbar.items]]
30+
href = "https://www.roblox.com/games/6311279644/"
31+
label = "Game"
32+
position = "right"
33+
34+
[footer]
35+
style = "dark"
36+
copyright = "Copyright © 2019 - 2023 TRIA.os. Built with Moonwave and Docusaurus"

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"dependencies": {
3+
"@docusaurus/core": "^2.4.0",
4+
"@docusaurus/preset-classic": "^2.4.0",
35
"moonwave": "^1.0.1"
46
}
57
}

0 commit comments

Comments
 (0)