-
Notifications
You must be signed in to change notification settings - Fork 42
COMMIT Summary #143
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
Open
NotBlackrus
wants to merge
5
commits into
Polytoria:main
Choose a base branch
from
NotBlackrus:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
COMMIT Summary #143
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6ed83dd
COMMIT Summary
NotBlackrus b56ed28
Removed personal recommendation
NotBlackrus a805e79
Changing some warnings into tips, and resolving search exclude issue …
NotBlackrus bede876
Added Purchases API
NotBlackrus b0fcf85
Merge branch 'main' into main
NotBlackrus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,26 @@ | ||
| ## PR Summary | ||
|
|
||
| [ REPLACE this with a DETAILED SUMMARY of your changes ] | ||
| ## Changed all C# mentions of arrays to be Lua-friendly **site-wide** | ||
| ## ex: before, it would mention arrays of instances as Instance[], but now it will mention them as {Instance}. This is so that lua programmers know what they're looking at, and so that we can fit multiple class names as needed. | ||
|
|
||
| Thanks for taking the time to contribute to the Polytoria documentation project! | ||
| Please ensure that this PR meets the following criteria before submitting (you may delete this section after reading): | ||
| ## Edited Camera.md to change the "Freecam" typo to "FreeCam" | ||
| ## Added warning about lua's single-thread nature in BaseScript.md, and how to work around it | ||
|
|
||
| - [ ] The changes you've made are accurate and correct | ||
| - [ ] Distinct changes for separate issues are in separate PRs (do not combine multiple issues into one PR) | ||
| - [ ] Any additions or modifications to the example code were tested in the latest version of Polytoria Creator and work as intended | ||
| ## Environment.md changes: | ||
| ## Added links to nearly every reference of objects in the entire file | ||
| ## Added optional parameter markers for CreateExplosion | ||
| ## Modified CreateExplosion note to be more in depth and specific with wording | ||
| ## Added optional parameter marker for OverlapBox and OverlapSphere | ||
| ## Completely rewrote the Raycast and RaycastAll methods to be more comprehensive | ||
| ## Remade RebuildNavMesh documentation :sob: :pray:, please tell me I'm not the only one that laughed when I saw game["Workspace"] | ||
| ## Added optional parameter marker for GetPointOnNavMesh | ||
| ## Rewrote AutoGenerateNavMesh documentation to be more comprehensive | ||
| ## Added more details to PartDestroyHeight's behavior with NPCs and Players | ||
|
|
||
| ## Added extensive explanation as to how RayResult.Normal works in RayResult.md | ||
|
|
||
| ## Added warning about GUI.Visible behavior in GUI.md | ||
|
|
||
| ## Added warning about Tool-descendant scripts and their odd inability to run until the first Tool.Equipped event in Tool.md | ||
|
|
||
| ## merged with the latest pull request (all they did was organize the layout in creator-setup.md :sob:) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,9 +17,9 @@ weight: 2 | |
|
|
||
| ## Methods | ||
|
|
||
| ### CreateExplosion(Position;Vector3,Radius;float=10,Force;float=5000,affectAnchored;bool=true,callback;function=nil,damage;float=10000) { method } | ||
| ### CreateExplosion(Position;Vector3,?Radius;float=10,?Force;float=5000,?affectAnchored;bool=true,?callback;function=DynamicInstance,?damage;float=10000) { method } | ||
|
|
||
| Creates a deadly explosion killing players and applying force to parts at the given position. | ||
| Creates a deadly explosion killing {{ classLink("Players") }} and applying force to {{ classLink("DynamicInstance") }}s at the given position. | ||
|
|
||
| **Example** | ||
|
|
||
|
|
@@ -28,16 +28,16 @@ game["Environment"]:CreateExplosion(Vector3.New(0, 0, 0), 30, 5000, false, nil, | |
| ``` | ||
|
|
||
| <div data-search-exclude markdown> | ||
| !!! note "When set to true, AffectAnchored will unanchor parts within the explosion radius." | ||
| !!! note "When set to true, AffectAnchored will disable the Anchor property for {{ classLink("DynamicInstance") }}s within the explosion radius." | ||
| </div> | ||
|
|
||
| <div data-search-exclude markdown> | ||
| !!! note "Callback gets called for each part within explosion radius." | ||
| !!! note "Callback gets called for each {{ classLink("DynamicInstance") }} within explosion radius." | ||
| </div> | ||
|
|
||
| ### OverlapBox(position;Vector3,size;Vector3,rotation;Vector3,ignoreList;array=Instance[]):Instance[] { method } | ||
| ### OverlapBox(position;Vector3,size;Vector3,rotation;Vector3,?ignoreList;array={Instance}):{Instance} { method } | ||
|
|
||
| Returns a list of instances intersecting with the box in the given position, size and rotation. | ||
| Returns a list of {{ classLink("DynamicInstance") }}s intersecting with the box in the given position, size and rotation. | ||
|
|
||
| A demo of this method is available [here](https://polytoria.com/places/9269). | ||
|
|
||
|
|
@@ -51,72 +51,88 @@ for i,v in ipairs(intersections) do | |
| end | ||
| ``` | ||
|
|
||
| ### OverlapSphere(position;Vector3,radius;float,ignoreList;array=Instance[]):Instance[] { method } | ||
| ### OverlapSphere(position;Vector3,radius;float,?ignoreList;array={Instance}):{Instance} { method } | ||
|
|
||
| Returns a list of instances intersecting with the sphere in the given position and radius. | ||
| Returns a list of {{ classLink("DynamicInstance") }}s intersecting with the sphere in the given position and radius. | ||
|
|
||
| **Example** | ||
|
|
||
| ```lua | ||
| local intersections = game["Environment"]:OverlapSphere(Vector3.New(100,0,45), 25) | ||
| local intersections = game["Environment"]:OverlapSphere(Vector3.New(100,0,45), 25, {game["Environment"]["TheIgnored"]}) | ||
|
|
||
| for i,v in ipairs(intersections) do | ||
| print(v.Name .." is intersecting the sphere!") | ||
| end | ||
| ``` | ||
|
|
||
| ### Raycast(origin;Vector3,direction;Vector3,maxDistance;float=infinite,ignoreList;array=Instance[]):RayResult { method } | ||
| ### Raycast(origin;Vector3,direction;Vector3,?maxDistance;float=infinite,?ignoreList;array={Instance}):RayResult { method } | ||
|
|
||
| Casts a ray from origin with a specified direction and returns a RayResult for the first hit object. | ||
| Casts a ray from origin, shooting in the direction of the second argument until it reaches the distance threshold, only stopping upon reaching a {{ classLink("DynamicInstance") }} that isn't nested in ignoreList. | ||
|
|
||
| **Example** | ||
|
|
||
| ```lua | ||
| local hit = game["Environment"]:Raycast(barrel.Position, barrel.Forward) | ||
|
|
||
| if hit and hit.Instance:IsA("Player") then | ||
| hit.Instance.Health = 0 | ||
| local Ray = game["Environment"]:Raycast(barrel.Position, barrel.Forward, 25, {game["Environment"]["IgnoredInstances"], game["Environment"]["OtherIgnoredInstances"]}) | ||
|
|
||
| if Ray ~= nil then | ||
| local Hit = Ray.Instance -- Player | ||
| if Hit:IsA("Player") then | ||
| print("Hit",Hit,"at",Ray.Position,"!") -- [Hit Player at (3.24, 1.2, 5.93) !] | ||
| Hit.Health = math.max(Hit.Health - 12 * (1.5-(1- Ray.Distance / 25)), 0) | ||
| --Point blank deals 18 damage while max distance deals 6 damage | ||
| end | ||
| end | ||
| ``` | ||
|
|
||
| ### RaycastAll(origin;Vector3,direction;Vector3,maxDistance;float=infinite,ignoreList;array=Instance[]):RayResult[] { method } | ||
| <div data-search-exclude markdown> | ||
| !!! note "The descendants of an {{ classLink("Instance") }} in ignoreList are ignored too." | ||
| !!! warning "If the Raycast fails to hit a {{ classLink("DynamicInstance") }}, it is returned as nil." | ||
| </div> | ||
|
|
||
| ### RaycastAll(origin;Vector3,direction;Vector3,?maxDistance;float=infinite,?ignoreList;array={Instance}):{RayResult} { method } | ||
|
|
||
| Casts a ray from origin with a specified direction and returns a RayResult array for all hit objects. | ||
| Casts a ray from origin, shooting in the given direction until it reaches the distance threshold, only returning a table of {{ classLink("DynamicInstance") }}s that aren't nested within the ignoreList. | ||
|
|
||
| **Example** | ||
|
|
||
| ```lua | ||
| local hits = game["Environment"]:RaycastAll(Vector3.New(0, 10, 0), Vector3.New(0, -1, 0), 100) | ||
|
|
||
| for i, hit in pairs(hits) do | ||
| print("Hit at " .. hit.Position .. "!") | ||
| local Ray = game["Environment"]:RaycastAll(Vector3.New(0, 10, 0), Vector3.New(0, -1, 0), 100, game["Environment"]["Map"]) | ||
|
|
||
| --We call this the Railgun. | ||
| for i, hit in pairs(Ray) do | ||
| if hit.Instance:IsA("NPC") then | ||
| if hit.Position.y - hit.Instance.Position.y >= hit.Instance.Size.y then | ||
| hit.Instance.Health = 0 --An accurate headshot detection, no matter the size of the NPC | ||
| --(hit.Instance.Position.y + hit.instance.Size.y == where the NPC's neck is on the y scale) | ||
| else | ||
| hit.Instance.Health = math.max(0, hit.Instance.Health - 50) --Body shot | ||
| end | ||
| end | ||
| end | ||
| ``` | ||
|
|
||
| ### RebuildNavMesh(root;Instance=nil) { method } | ||
| ### RebuildNavMesh(?root;Instance) { method } | ||
|
|
||
| Rebuilds the navigation mesh which determines the empty space where NPCs can pathfind in. | ||
| Rebuilds the navigation mesh which determines the empty space where {{ classLink("NPC") }}s can pathfind in. | ||
|
|
||
| **Example** | ||
|
|
||
| ```lua | ||
| game["Environment"]:RebuildNavMesh() | ||
| # or | ||
| game["Environment"]:RebuildNavMesh(game["Workspace"]["Map"]) | ||
| game["Environment"]:RebuildNavMesh(game["Environment"]["Map"]) | ||
| ``` | ||
|
|
||
| ### GetPointOnNavMesh(position;Vector3,maxDistance;float=infinite):Vector3 { method } | ||
| ### GetPointOnNavMesh(position;Vector3,?maxDistance;float=infinite):Vector3 { method } | ||
|
|
||
| Returns a point on the navigation mesh at the given position. | ||
|
|
||
| ## Properties | ||
|
|
||
| ### AutoGenerateNavMesh:bool { property } | ||
|
|
||
| Determines whether or not to automatically build a navigation mesh for NPC pathfinding. This property is disabled by default so there are no performance issues with larger maps. | ||
| Determines whether or not to automatically build a navigation mesh from :polytoria-Environment: Environment for {{ classLink("NPC") }} pathfinding. This property is disabled by default so there are no performance issues with larger maps. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Environment could be another classLink, instead of just an icon, like NPC |
||
|
|
||
| <div data-search-exclude markdown> | ||
| !!! note "When updating the map, even if the property is set to true, you will still have to manually call the `Environment:BuildNavMesh()` method." | ||
| !!! warning "AutoGenerateNavMesh only runs once upon being set to true. Changing the map will still require you to run RebuildNavMesh." | ||
| </div> | ||
|
|
||
| ### FogColor:Color { property } | ||
|
|
@@ -137,11 +153,11 @@ Whether or not fog is enabled. | |
|
|
||
| ### FogStartDistance:float { property } | ||
|
|
||
| The distance from the camera at which fog starts to appear | ||
| The distance from the {{ classLink("Camera") }} at which fog starts to appear | ||
|
|
||
| ### FogEndDistance:float { property } | ||
|
|
||
| The distance from the camera at which fog is fully opaque | ||
| The distance from the {{ classLink("Camera") }} at which fog is fully opaque | ||
|
|
||
| ### Gravity:Vector3=Vector3.New(0, -75, 0) { property } | ||
|
|
||
|
|
@@ -157,6 +173,11 @@ The height at which unanchored parts are destroyed when they fall below it. | |
| game["Environment"].PartDestroyHeight = -2000 | ||
| ``` | ||
|
|
||
| <div data-search-exclude markdown> | ||
| !!! note "PartDestroyHeight only kills {{ classLink("Players") }}, and destroys {{ classLink("DynamicInstance") }}s with Anchor set to false." | ||
| !!! warning "PartDestroyHeight may kill {{ classLink("Players") }}, but it does not kill {{ classLink("NPC") }}s." | ||
| </div> | ||
|
|
||
| ### Skybox:SkyboxPreset { property } | ||
|
|
||
| The default skybox preset to use for the world, if no ImageSky is present. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
NotBlackrus marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
uhhh you edited the pull request template for everyone 😭