Chapters 2 and 3 grammar reformatting#167
Chapters 2 and 3 grammar reformatting#167d0ctorzer0 wants to merge 5 commits intoStrataSource:as-guidefrom
Conversation
Changed a few misspellings and edited the grammar to make the flow more natural.
Fixed the broken link. Also edited one more sentence to align with the rest of the doc.
Minor grammatical changes to chapters 2 and 3. Fixed one minor typo in Chapter 1.
OrsellGit
left a comment
There was a problem hiding this comment.
Just some smallish changes that need to be done but everything else is very good!
| - [Integer size reference table](#integer-size-reference-table). | ||
|
|
||
| > Unfortunately, in this chapter you won't learn anything really interesting, but this knowledge is crucial to continue further. Data types in general are a very extensive subject, but you don't need to know everything. This chapter is supposed to teach you how to handle value types in your script. | ||
| > The knowledge in this chapter is crucial to continue further. Data types are an extensive subject, but you don't need to know everything. This chapter's goal is to teach you how to handle value types in your script. |
There was a problem hiding this comment.
The knowledge in this chapter is crucial to continue further. Data types are an extensive subject, but you don't need to know everything.
This can be dumbed down to just, something like "most of this content is optional but some might be helpful so feel free to read"
| > This chapter won't cover every detail about any of data types, it is recommended you visit the [Data Types Section](../game/type) of the wiki for more information. | ||
| > Alternatively, you can find references on the [AS Official Documentation](https://www.angelcode.com/angelscript/sdk/docs/manual/doc_datatypes.html), however please note that Strata's wiki will be the most representative, some functionality might have been changed! | ||
| > This chapter won't cover every detail of every data type. It is recommended you visit the [Data Types Section](../game/type) of the Wiki for more information. | ||
| > Alternatively, you can find references on the [AS Official Documentation](https://www.angelcode.com/angelscript/sdk/docs/manual/doc_datatypes.html). Please note, however, that the Strata Wiki is a better reference, as some functionality may have been changed. |
There was a problem hiding this comment.
"however, that" can be removed.
| Once declared, variables cannot change their type without redeclaration. This is not allowed: | ||
| Once declared, variables cannot change their type without redeclaration. This, for example, is not allowed: | ||
| ```cpp | ||
| int myInt; |
There was a problem hiding this comment.
these two lines can be combined
| ``` | ||
|
|
||
| The `auto` keyword is not recommended for several cases. The main one of them is that you cannot immediately see the data type of a returned object especially from functions, like the one above. We don't know what that function will return. Another reason is that sometimes the compiler might guess wrong, especially in cases like integers, where you have multiple ways that `1` could have been described (e.g. int8/int16, both can describe `1`, even `bool` can). | ||
| The `auto` keyword is not recommended in many cases. Using `auto`, you cannot immediately see the data type of a returned object, especially from functions such the one above. We don't know what that function will return. Additionally, there is always a chance the compiler may guess incorrectly. This issue is especially prominent in cases such as integers, where there are multiple ways `1` could be described (e.g. int8/int16, both can describe `1`, as can `bool`). |
There was a problem hiding this comment.
Using
auto
Instead, do "When using auto".
| - NOT - denoted as `!`. Evaluates to true if value is false and vice versa. | ||
| - AND - denoted as `&&`. Evaluates to true if both values are true. | ||
| - OR - denoted as `||`. Evaluates to true, if even one only of the values is true. Otherwise evaluates to false if both values are false. | ||
| - XOR - denoted as `^^`. Evaluates to True if and only if **one** of the values is True. |
There was a problem hiding this comment.
True is capitalized here when it shouldn't
| } | ||
| ``` | ||
| In this case my_number doesn't exist inside *my_func2*, it only exists inside *my_func1* and only for the duration of that function's execution. | ||
| In this case, `my_number` doesn't exist inside *my_func2*, it only exists inside *my_func1* and only for the duration of that function's execution. |
There was a problem hiding this comment.
match the ticks used with my_number to replace the * with my_func2
Reformatted and updated grammar in Chapters 2 and 3 to be more concise. Fixed minor typo in Chapter 1.