From 905193401a8ea38a3b78d93e498325f86e8e5248 Mon Sep 17 00:00:00 2001 From: Ashleyanna Rivers Date: Thu, 19 Mar 2026 12:57:25 -0600 Subject: [PATCH 1/2] Rephrasing and grammar changes Changed a few misspellings and edited the grammar to make the flow more natural. --- docs/angelscript/guide/chapter1.md | 76 +++++++++++++++--------------- docs/angelscript/guide/meta.json | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/angelscript/guide/chapter1.md b/docs/angelscript/guide/chapter1.md index 8d4d1480..ef8deb92 100644 --- a/docs/angelscript/guide/chapter1.md +++ b/docs/angelscript/guide/chapter1.md @@ -5,42 +5,42 @@ weight: 0 # Chapter 1 - Introduction -## What will you learn in this chapter +## What You Will Learn In this chapter you will learn about: -- [AngelScript as a programming language](#angelscript), -- [Purpose of AngelScript in Strata Source](#what-can-you-do-with-angelscript), -- [Client - Server model of the engine](#client---server-model), -- [How to load code in the game](#loading-code), -- [Writing your own Hello World program](#your-first-script), -- [Testing out your own code](#how-to-test-out-your-code-in-a-basic-way) -- [Additional tips that might help you](#additional-tips). +- [AngelScript as a programming language](#angelscript) +- [Purpose of AngelScript in Strata Source](#what-can-you-do-with-angelscript) +- [Client-Server model of the engine](#client---server-model) +- [How to load code in the game](#loading-code) +- [Writing your own Hello World program](#your-first-script) +- [Testing out your own code](#how-to-test-out-your-code-the-simple-way) +- [Additional tips that might help you](#additional-tips) > [!TIP] -> In each chapter, you can easily navigate the page by clicking links in the "What will you learn in this chapter" section. +> In each chapter, you can easily navigate the page by clicking the links in the "What You Will Learn" section. > [!CAUTION] -> This guide assumes you have basic skills of programming in languages like Python, C/C++, Squirrel (VScript), etc. -> It is recommended you already have *some* experience in programming, although this guide aims to be as begineer's friendly as possible. +> This guide assumes you have basic programming skills in languages such as Python, C, C++, Squirrel (VScript), etc. +> It is recommended you already have *some* experience in programming, although this guide aims to be as beginner-friendly as possible. > Basic concepts will **not** be taught. > [!NOTE] -> It is recommended that while reading this guide, you will try out the things you have learned. This guide will include example tasks for you to do as a practice. +> It is recommended to try out what you learn in this guide as you go through it. This guide will include example tasks for you to attempt as practice. --- ## AngelScript -The [AngelScript's home page](https://www.angelcode.com/angelscript/) describes AngelScript as: +[AngelScript's home page](https://www.angelcode.com/angelscript/) describes AngelScript as: > The AngelCode Scripting Library, or AngelScript as it is also known, is an extremely flexible cross-platform scripting library designed to allow applications to extend their functionality through external scripts. -Besides that, you can treat AngelScript as some sort of hybrid between C++ and Python. In some areas it behaves like C++, for example it is statically typed, meaning that when you are declaring a variable you also have to declare it's types, and it also implements it's own version of pointers (called handles); it also aims to help out users in writing code, whether by dissallowing certain operations or by assuming. More on that will be explained in later parts of the guide. +Besides that, you may treat AngelScript as a sort of hybrid between C++ and Python. It behaves like C++ in some areas - for example, when it is statically typed. Just as in C++, when you declare a variable in AngelScript, you also must declare its types. In addition, AngelScript also implements its own version of pointers (called handles). It also aims to help users in writing its code, whether by disallowing certain operations or by assuming. More on that will be explained in later parts of the guide. -Its use cases vary, it is much closer to pure engine code than VScript, meaning that you can for example program in custom entities, or custom commands. +Use cases for AngelScript vary heavily. It is much closer to pure engine code than VScript, meaning that you can achieve outputs not possible in VScript, such as programming in custom entities and custom commands. -Its official documentation can be found here: [AS Official Docs](https://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html). +AngelScript's official documentation can be found here: [AS Official Docs](https://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html). -## What can you do with AngelScript -This question is not properly asked, because AngelScript will allow you to do mostly anything you want, however it's main task in Strata Source is to allow users to create custom entities, create custom commands, bind to in-game events, and more. +## What Can You Do With AngelScript +This question is not asked properly; AngelScript will allow you to do most anything you would like it to. However, its main purpose in Strata Source is to allow users to create custom entities, custom commands, bind to in-game events, and more. While VScript (mainly) sits between entities and handles the interactions between them, AngelScripts sits in a level above, where AS can be treated as entities *themselves*. @@ -48,26 +48,26 @@ While VScript (mainly) sits between entities and handles the interactions betwee ## AngelScript in Strata Source -### Client - Server model -Before we get into writing your first script, there is one more thing you need to know. Most engines including Source in general, operate on the client-server model. Meaning that client code is separate from the server code, even on singleplayer. When you start a map in singleplayer you essentially create a one-player server that runs beside the client. This is very important because AS code can be loaded on both. Some functionality will only be available on the server (like entities) and some functionality will only be available on the client (like Panorama/UI). +### Client - Server Model +Before you write your first script, there is one more thing you need to know. Most engines, including the Source engine, operate on the client-server model. This means that client code is separate from the server code, even in singleplayer. When starting a map in singleplayer, you essentially create a one-player server that runs beside the client. This is very important to remember as AS code can be loaded on both. Some functionality will only be available on the server (such as entities) and some functionality will only be available on the client (such as Panorama/UI). -### Loading code -Your first question might be: Where do I place the files containing my code? -The answer is pretty simple, each file that contains your code should be ended with the **.as** extension and be placed in the **code/** folder of a respective `Game` searchpath. Example locations would be `p2ce/custom/my-addon/code/` or just `p2ce/code/` (the latter not being recommended). +### Loading Code +Where should you place the files containing your code? +The answer is quite simple. Each file that contains your code should end with the **.as** extension and be placed in the **code/** folder of your respective `Game` searchpath. Example locations would be `p2ce/custom/my-addon/code/` or just `p2ce/code/` (the latter is not recommended). -You can name your files however you'd like. You can create custom directories, you can loosely place files, it all depends on what you're trying to achieve; in the long run it doesn't matter. What does matter are the "starting points" of sorts. The engine will not attempt to load any files besides 3 files placed **directly** in the **code/** folder: +You may name your files however you'd like. You can create custom directories or you can place your files loosely - it all depends on what you're trying to achieve. In the long run, it's not important. What *is* important is where you place the "starting points". The engine will not attempt to load any files except for these 3 files placed **directly** in the **code/** folder: 1. `init.as` - Will get loaded by server and client. 2. `sv_init.as` - Will only get loaded by the server. 3. `cl_init.as` - Will only get loaded by the client. -### IDE and testing environment -It is suggested to use Visual Studio Code with the [AngelScript Language Server (sashi0034.angel-lsp)](https://marketplace.visualstudio.com/items?itemName=sashi0034.angel-lsp) extension. From there you can open the `code/` folder of your choice as a project and develop there. +### IDE and Testing Environment +It is suggested to use Visual Studio Code with the [AngelScript Language Server (sashi0034.angel-lsp)](https://marketplace.visualstudio.com/items?itemName=sashi0034.angel-lsp) extension. From there, you can open the `code/` folder of your choice as a project and begin development. The engine compiles scripts on every map load (you can use the `reload` command to recompile the scripts). -### Your first script -Now, you should be ready to write your very first and own program that will print a Hello World message to the console. You might not know everything in the code below but don't get dissappointed! You should place this code into `cl_init.as` as it is a client command. +### Your First Script +You should now be ready to begin writing your very first program. For now, let's just print a Hello World message to the console. Though the code below may look foreign for now, don't be dissuaded! Place this code into `cl_init.as` as it is a client command. ```cpp [ClientCommand("HelloWorld", "")] @@ -76,13 +76,13 @@ void MyCommand(const CommandArgs@ args) { } ``` -Now, the only thing left is to launch up the game, open the console and execute the *HelloWorld* command. +Now, the only thing left to do now is launch the game, open the console, and execute the *HelloWorld* command. > ### TASK 1: > Run the HelloWorld program mentioned above. -## How to test out your code in a basic way -For now you need to know how to run your code so that you will be able to solve tasks given to you with this guide. +## How To Test Your Code the Simple Way +For now, you will need to know how to run your code so that you can complete the tasks given to you within this guide. In `sv_init.as` include: ```cpp [ServerCommand("CodeTest", "")] @@ -92,19 +92,19 @@ void CodeTest(const Command@ args) { ``` The code in this function will run whenever you run the `CodeTest` command in game. Remember to `reload` to see the changes! -The `Msg(string)` function will serve you as a way to view your variables (like print or cout), just do `Msg(a)` where a is your variable and a will get printed to the console! -Remember to add `"\n"` to the input of Msg (or just call `Msg("\n");` after your message), otherwise everything will print in one line! +The `Msg(string)` function will serve as a way to view your variables (like print or cout). Just type `Msg(a)` where *a* is your variable, and *a* will be printed to the console. +Remember to add `"\n"` to the input of Msg (or just call `Msg("\n");` after your message), otherwise everything will print in one line. > [!BUG] -> Some types such as `int` cannot be directly converted to string, and so you won't be able to put them directly into Msg(). +> Some types such as `int` cannot be directly converted to string, and as such, you won't be able to put them directly into Msg(). > > [!TIP] -> > In order to avoid that problem you can append to an empty string, just do `"" + a` and in most cases this will work: `Msg("" + a);` +> > In order to avoid this issue, you can append to an empty string. Just do `"" + a` and in most cases this will work: `Msg("" + a);` -### Compilation errors -Most of times scripts will report errors before they are ran, on map load. This is why if you don't see your functionality (like when a command is not there in the console), scroll up and check the error. Additionally you can use the first tip in the [tip section](#additional-tips) and then use `reload`. +### Compilation Errors +Scripts will often report errors before they are ran, usually on map load. If you don't see your functionality (such as a command not being the console), scroll up and check the error. Additionally, you can use the first tip in the [tip section](#additional-tips) and then use `reload`. ## Additional Tips > [!TIP] -> Reading console output can be tiresome as much more is happening in the console than just the script system. However, there is an easy way to just listen to the script system output. You can run `con_filter_text scriptsys; con_filter_enable 1` filter out anything that is not the script system. +> Reading console output can be tiresome, as much more is happening in the console than just the script system. To overcome this problem, you can run `con_filter_text scriptsys; con_filter_enable 1` to filter out anything that is not the script system. diff --git a/docs/angelscript/guide/meta.json b/docs/angelscript/guide/meta.json index 76da0b32..fa31d875 100644 --- a/docs/angelscript/guide/meta.json +++ b/docs/angelscript/guide/meta.json @@ -1,4 +1,4 @@ { - "title": "Begineer's Guide", + "title": "Beginner's Guide", "weight": 0 } From 118eadb53af8a2e81c785aa7d18eb15d55cc4067 Mon Sep 17 00:00:00 2001 From: Ashleyanna Rivers Date: Thu, 19 Mar 2026 13:33:29 -0600 Subject: [PATCH 2/2] Broken link fixed Fixed the broken link. Also edited one more sentence to align with the rest of the doc. --- docs/angelscript/guide/chapter1.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/angelscript/guide/chapter1.md b/docs/angelscript/guide/chapter1.md index ef8deb92..fae9d263 100644 --- a/docs/angelscript/guide/chapter1.md +++ b/docs/angelscript/guide/chapter1.md @@ -12,7 +12,7 @@ In this chapter you will learn about: - [Client-Server model of the engine](#client---server-model) - [How to load code in the game](#loading-code) - [Writing your own Hello World program](#your-first-script) -- [Testing out your own code](#how-to-test-out-your-code-the-simple-way) +- [Testing out your own code](#how-to-test-out-your-code-in-a-basic-way) - [Additional tips that might help you](#additional-tips) > [!TIP] @@ -42,7 +42,7 @@ AngelScript's official documentation can be found here: [AS Official Docs](https ## What Can You Do With AngelScript This question is not asked properly; AngelScript will allow you to do most anything you would like it to. However, its main purpose in Strata Source is to allow users to create custom entities, custom commands, bind to in-game events, and more. -While VScript (mainly) sits between entities and handles the interactions between them, AngelScripts sits in a level above, where AS can be treated as entities *themselves*. +While VScript (mainly) sits between entities and handles the interactions between them, AngelScripts sits in a level above, being able to *create* entities and define their behavior. --- @@ -81,7 +81,7 @@ Now, the only thing left to do now is launch the game, open the console, and exe > ### TASK 1: > Run the HelloWorld program mentioned above. -## How To Test Your Code the Simple Way +## How To Test Out Your Code in a Basic Way For now, you will need to know how to run your code so that you can complete the tasks given to you within this guide. In `sv_init.as` include: ```cpp