From 41eabe6611d8cdc36c5ab7b4075c12e3883d4f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 2 May 2018 12:42:33 +0200 Subject: [PATCH] Update Weblate template from Sphinx templates --- weblate/docs.pot | 9725 +++++++++++++++++++++++++++++++--------------- 1 file changed, 6612 insertions(+), 3113 deletions(-) diff --git a/weblate/docs.pot b/weblate/docs.pot index 3164a7bfa6..2afa873f79 100644 --- a/weblate/docs.pot +++ b/weblate/docs.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine latest\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot-docs-l10n\n" -"POT-Creation-Date: 2018-04-19 09:05+0200\n" +"POT-Creation-Date: 2018-05-02 12:40+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -31,6 +31,7 @@ msgstr "" #: ../../docs/development/cpp/custom_resource_format_loaders.rst:7 #: ../../docs/development/cpp/creating_android_modules.rst:7 #: ../../docs/development/cpp/custom_audiostreams.rst:7 +#: ../../docs/development/cpp/custom_godot_servers.rst:7 #: ../../docs/tutorials/plugins/editor/import_plugins.rst:7 #: ../../docs/tutorials/plugins/gdnative/gdnative-c-example.rst:7 #: ../../docs/tutorials/audio/audio_streams.rst:7 @@ -850,17 +851,17 @@ msgid "Usage in GDScript" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:22 -msgid "Examine this concrete GDScript example::" +msgid "Examine this concrete GDScript example:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:33 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:35 msgid "" "Placeholders always start with a ``%``, but the next character or " "characters, the *format specifier*, determines how the given value is " "converted to a string." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:37 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:39 msgid "" "The ``%s`` seen in the example above is the simplest placeholder and works " "for most use cases: it converts the value by the same method by which an " @@ -870,7 +871,7 @@ msgid "" "data in a human-readable string." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:44 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:46 msgid "" "There is also another way to format text in GDScript, namely the ``String." "format()`` method. It replaces all occurrences of a key in the string with " @@ -878,44 +879,44 @@ msgid "" "the key/value pairs." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:48 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:50 msgid "" "Arrays can be used as key, index, or mixed style (see below examples). Order " "only matters when the index or mixed style of Array is used." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:51 -msgid "A quick example in GDScript::" +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:53 +msgid "A quick example in GDScript:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:62 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:66 msgid "" "There are other `format specifiers`_, but they are only applicable when " "using the ``%`` operator." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:67 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:71 msgid "Multiple placeholders" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:69 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:73 msgid "" "Format strings may contain multiple placeholders. In such a case, the values " "are handed in the form of an array, one value per placeholder (unless using " -"a format specifier with ``*``, see `dynamic padding`_)::" +"a format specifier with ``*``, see `dynamic padding`_):" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:79 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:85 msgid "" "Note the values are inserted in order. Remember all placeholders must be " "replaced at once, so there must be an appropriate number of values." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:84 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:90 msgid "Format specifiers" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:86 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:92 msgid "" "There are format specifiers other than ``s`` that can be used in " "placeholders. They consist of one or more characters. Some of them work by " @@ -923,104 +924,104 @@ msgid "" "with certain values or characters." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:93 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:99 msgid "Placeholder types" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:95 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:101 msgid "" "One and only one of these must always appear as the last character in a " "format specifier. Apart from ``s``, these require certain types of " "parameters." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:99 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:105 msgid "``s``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:99 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:105 msgid "" "**Simple** conversion to String by the same method as implicit String " "conversion." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:102 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:108 msgid "``c``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:102 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:108 msgid "" "A single **Unicode character**. Expects an unsigned 8-bit integer (0-255) " "for a code point or a single-character string." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:105 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:111 msgid "``d``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:105 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:111 msgid "" "A **decimal integral** number. Expects an integral or real number (will be " "floored)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:108 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:114 msgid "``o``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:108 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:114 msgid "" "An **octal integral** number. Expects an integral or real number (will be " "floored)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:111 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:117 msgid "``x``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:111 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:117 msgid "" "A **hexadecimal integral** number with **lower-case** letters. Expects an " "integral or real number (will be floored)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:114 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:120 msgid "``X``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:114 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:120 msgid "" "A **hexadecimal integral** number with **upper-case** letters. Expects an " "integral or real number (will be floored)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:117 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:123 msgid "``f``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:117 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:123 msgid "A **decimal real** number. Expects an integral or real number." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:122 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:128 msgid "Placeholder modifiers" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:124 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:130 msgid "" "These characters appear before the above. Some of them work only under " "certain conditions." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:128 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:134 msgid "``+``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:128 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:134 msgid "In number specifiers, **show + sign** if positive." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:130 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:136 #: ../../docs/tutorials/misc/binary_serialization_api.rst:94 #: ../../docs/tutorials/misc/binary_serialization_api.rst:103 #: ../../docs/tutorials/misc/binary_serialization_api.rst:121 @@ -1043,62 +1044,62 @@ msgstr "" msgid "Integer" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:130 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:136 msgid "" "Set **padding**. Padded with spaces or with zeroes if integer starts with " "``0`` in an integer placeholder. When used after ``.``, see ``.``." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:134 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:140 msgid "``.``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:134 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:140 msgid "" "Before ``f``, set **precision** to 0 decimal places. Can be followed up with " "numbers to change. Padded with zeroes." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:137 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:143 msgid "``-``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:137 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:143 msgid "**Pad to the right** rather than the left." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:139 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:145 msgid "``*``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:139 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:145 msgid "" "**Dynamic padding**, expect additional integral parameter to set padding or " "precision after ``.``, see `dynamic padding`_." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:145 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:151 msgid "Padding" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:147 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:153 msgid "" "The ``.`` (*dot*), ``*`` (*asterisk*), ``-`` (*minus sign*) and digit (``0``-" "``9``) characters are used for padding. This allows printing several values " "aligned vertically as if in a column, provided a fixed-width font is used." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:152 -msgid "To pad a string to a minimum length, add an integer to the specifier::" +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:158 +msgid "To pad a string to a minimum length, add an integer to the specifier:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:158 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:166 msgid "" "If the integer starts with ``0``, integral values are padded with zeroes " -"instead of white space::" +"instead of white space:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:164 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:174 msgid "" "Precision can be specified for real numbers by adding a ``.`` (*dot*) with " "an integer following it. With no integer after ``.``, a precision of 0 is " @@ -1106,190 +1107,189 @@ msgid "" "before the dot." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:176 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:186 msgid "" "The ``-`` character will cause padding to the right rather than the left, " -"useful for right text alignment::" +"useful for right text alignment:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:185 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:197 msgid "Dynamic padding" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:187 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:199 msgid "" "By using the ``*`` (*asterisk*) character, the padding or precision can be " "set without modifying the format string. It is used in place of an integer " "in the format specifier. The values for padding and precision are then " -"passed when formatting::" +"passed when formatting:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:198 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:212 msgid "" "It is still possible to pad with zeroes in integer placeholders by adding " -"``0`` before ``*``::" +"``0`` before ``*``:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:206 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:222 msgid "Escape sequence" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:208 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:224 msgid "" "To insert a literal ``%`` character into a format string, it must be escaped " -"to avoid reading it as a placeholder. This is done by doubling the " -"character::" +"to avoid reading it as a placeholder. This is done by doubling the character:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:217 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:235 msgid "Format method examples" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:219 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:237 msgid "" "The following are some examples of how to use the various invocations of the " "``String.format`` method." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:224 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:260 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:242 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:262 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:293 msgid "**Type**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:224 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:242 msgid "**Style**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:224 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:257 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:242 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:262 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:275 msgid "**Example**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:224 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:257 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:242 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:262 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:275 msgid "**Result**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:226 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:228 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:230 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:195 msgid "Dictionary" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:226 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:232 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 msgid "key" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:226 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 msgid "" "\"Hi, {name} v{version}!\".format({\"name\":\"Godette\", \"version\":" "\"3.0\"})" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:226 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:228 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:230 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:232 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:234 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:236 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:244 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:252 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:254 msgid "Hi, Godette v3.0!" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:228 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:234 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:252 msgid "index" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:228 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 msgid "\"Hi, {0} v{1}!\".format({\"0\":\"Godette\", \"1\":\"3.0\"})" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:230 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:236 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:254 msgid "mix" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:230 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 msgid "" "\"Hi, {0} v{version}!\".format({\"0\":\"Godette\", \"version\":\"3.0\"})" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:232 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:234 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:236 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:252 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:254 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:174 #: ../../docs/getting_started/scripting/c_sharp/c_sharp_differences.rst:182 msgid "Array" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:232 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 msgid "" "\"Hi, {name} v{version}!\".format([[\"version\":\"3.0\"], [\"name\":\"Godette" -"\"])" +"\"]])" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:234 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:252 msgid "\"Hi, {0} v{1}!\".format([\"Godette\",\"3.0\"])" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:236 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:254 msgid "\"Hi, {name} v{0}!\".format([3.0, [\"name\":\"Godette\"]])" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:239 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:257 msgid "" "Placeholders can also be customized when using ``String.format``, here's " "some examples of that functionality." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:264 msgid "Infix (default)" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:264 msgid "\"Hi, {0} v{1}\".format([\"Godette\", \"3.0\"], \"{_}\")" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:246 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:264 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:266 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:268 msgid "Hi, Godette v3.0" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:266 msgid "Postfix" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:248 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:266 msgid "\"Hi, 0% v1%\".format([\"Godette\", \"3.0\"], \"_%\")" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:268 msgid "Prefix" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:250 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:268 msgid "\"Hi, %0 v%1\".format([\"Godette\", \"3.0\"], \"%_\")" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:253 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:271 msgid "" "Combining both the ``String.format`` method and the ``%`` operator could be " "useful as ``String.format`` does not have a way to manipulate the " "representation of numbers." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:259 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:277 msgid "" "\"Hi, {0} v{version}\".format({0:\"Godette\", \"version\":\"%0.2f\" % 3.114})" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:259 +#: ../../docs/getting_started/scripting/gdscript/gdscript_format_string.rst:277 msgid "Hi, Godette v3.11" msgstr "" @@ -1298,7 +1298,7 @@ msgid "GDScript Style Guide" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:7 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:144 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:154 #: ../../docs/getting_started/workflow/assets/importing_images.rst:50 #: ../../docs/tutorials/plugins/editor/import_plugins.rst:242 #: ../../docs/tutorials/inputs/inputevent.rst:117 @@ -1393,7 +1393,7 @@ msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:83 #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:107 #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:127 -msgid "**Good**" +msgid "**Good**:" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:40 @@ -1401,7 +1401,7 @@ msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:93 #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:114 #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:137 -msgid "**Bad**" +msgid "**Bad**:" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:50 @@ -1453,10 +1453,11 @@ msgid "" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:147 -msgid "**Never!**" +msgid "**NEVER**:" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:156 +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:193 msgid "Naming Conventions" msgstr "" @@ -1493,7 +1494,7 @@ msgid "" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:183 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1189 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1237 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:164 #: ../../docs/development/cpp/object_class.rst:211 msgid "Signals" @@ -1504,7 +1505,7 @@ msgid "Use past tense:" msgstr "" #: ../../docs/getting_started/scripting/gdscript/gdscript_styleguide.rst:193 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:508 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:547 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:211 #: ../../docs/development/cpp/object_class.rst:94 msgid "Constants" @@ -1608,29 +1609,29 @@ msgid "" "a simple example of how GDScript looks." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:118 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:123 msgid "" "If you have previous experience with statically typed languages such as C, C+" "+, or C# but never used a dynamically typed one before, it is advised you " "read this tutorial: :ref:`doc_gdscript_more_efficiently`." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:123 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:128 msgid "Language" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:125 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:130 msgid "" "In the following, an overview is given to GDScript. Details, such as which " "methods are available to arrays or other objects, should be looked up in the " "linked class descriptions." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:130 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:135 msgid "Identifiers" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:132 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:137 msgid "" "Any string that restricts itself to alphabetic characters (``a`` to ``z`` " "and ``A`` to ``Z``), digits (``0`` to ``9``) and ``_`` qualifies as an " @@ -1638,307 +1639,405 @@ msgid "" "Identifiers are case-sensitive (``foo`` is different from ``FOO``)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:138 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:143 msgid "Keywords" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:140 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:145 msgid "" "The following is the list of keywords supported by the language. Since " -"keywords are reserved words (tokens), they can't be used as identifiers." +"keywords are reserved words (tokens), they can't be used as identifiers. " +"Operators (like ``in``, ``not``, ``and`` or ``or``) and names of built-in " +"types as listed in the following sections are also reserved." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:144 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:150 +msgid "" +"Keywords are defined in the `GDScript tokenizer `_ in " +"case you want to take a look under the hood." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:154 msgid "Keyword" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:146 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:156 msgid "if" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:146 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:148 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:150 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:156 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:158 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:160 msgid "See `if/else/elif`_." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:148 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:158 msgid "elif" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:150 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:160 msgid "else" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:152 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:663 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:162 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:695 msgid "for" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:152 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:162 msgid "See for_." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:154 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:164 msgid "do" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:154 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:164 msgid "Reserved for future implementation of do...while loops." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:156 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:652 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:166 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:684 msgid "while" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:156 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:166 msgid "See while_." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:158 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:692 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:168 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:724 msgid "match" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:158 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:168 msgid "See match_." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:160 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:170 msgid "switch" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:160 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:162 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:170 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:172 msgid "Reserved for future implementation." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:162 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:172 msgid "case" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:164 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:174 msgid "break" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:164 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:174 msgid "Exits the execution of the current ``for`` or ``while`` loop." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:166 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:176 msgid "continue" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:166 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:176 msgid "" "Immediately skips to the next iteration of the ``for`` or ``while`` loop." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:168 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:178 msgid "pass" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:168 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:178 msgid "" "Used where a statement is required syntactically but execution of code is " "undesired, e.g. in empty functions." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:170 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:180 msgid "return" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:170 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:180 msgid "Returns a value from a function." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:172 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:182 msgid "class" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:172 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:182 msgid "Defines a class." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:174 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:184 msgid "extends" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:174 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:184 msgid "Defines what class to extend with the current class." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:176 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:186 #: ../../docs/tutorials/i18n/locales.rst:360 msgid "is" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:176 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:186 msgid "Tests whether a variable extends a given class." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:178 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:188 +msgid "self" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:188 +msgid "Refers to current class instance." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:190 msgid "tool" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:178 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:190 msgid "Executes the script in the editor." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:180 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:192 msgid "signal" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:180 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:192 msgid "Defines a signal." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:182 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:194 msgid "func" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:182 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:194 msgid "Defines a function." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:184 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:196 msgid "static" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:184 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:196 msgid "Defines a static function. Static member variables are not allowed." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:186 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:198 msgid "const" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:186 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:198 msgid "Defines a constant." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:188 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:200 msgid "enum" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:188 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:200 msgid "Defines an enum." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:190 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:202 msgid "var" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:190 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:202 msgid "Defines a variable." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:192 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:204 msgid "onready" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:192 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:204 msgid "" "Initializes a variable once the Node the script is attached to and its " "children are part of the scene tree." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:194 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:206 msgid "export" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:194 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:206 msgid "" "Saves a variable along with the resource it's attached to and makes it " "visible and modifiable in the editor." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:196 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:208 msgid "setget" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:196 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:208 msgid "Defines setter and getter functions for a variable." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:198 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:210 msgid "breakpoint" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:198 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:210 msgid "Editor helper for debugger breakpoints." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:202 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:212 +msgid "preload" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:212 +msgid "Preloads a class or variable. See `Classes as resources`_." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:214 +msgid "yield" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:214 +msgid "Coroutine support. See `Coroutines with yield`_." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:216 +msgid "assert" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:216 +msgid "" +"Asserts a condition, logs error on failure. Ignored in non-debug builds. See " +"`Assert keyword`_." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:218 +msgid "remote" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:218 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:220 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:222 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:224 +msgid "" +"Networking RPC annotation. See :ref:`high-level multiplayer docs " +"`." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:220 +msgid "master" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:222 +msgid "slave" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:224 +msgid "sync" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:226 +msgid "PI" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:226 +msgid "PI constant." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:228 +msgid "TAU" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:228 +msgid "TAU constant." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:230 +msgid "INF" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:230 +msgid "Infinity constant. Used for comparisons." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:232 +msgid "NAN" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:232 +msgid "NAN (not a number) constant. Used for comparisons." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:236 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:472 msgid "Operators" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:204 -msgid "" -"The following is the list of supported operators and their precedence (TODO, " -"change since this was made to reflect python operators)" +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:238 +msgid "The following is the list of supported operators and their precedence." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:208 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:241 msgid "**Operator**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:208 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:241 #: ../../docs/getting_started/workflow/export/feature_tags.rst:32 msgid "**Description**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:210 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:243 msgid "``x[index]``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:210 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:243 msgid "Subscription, Highest Priority" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:212 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:245 msgid "``x.attribute``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:212 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:245 msgid "Attribute Reference" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:214 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:247 msgid "``is``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:214 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:247 msgid "Instance Type Checker" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:216 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:249 msgid "``~``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:216 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:249 msgid "Bitwise NOT" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:218 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:251 msgid "``-x``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:218 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:251 msgid "Negative" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:220 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:253 msgid "``*`` ``/`` ``%``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:220 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:253 msgid "Multiplication / Division / Remainder" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:222 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:255 msgid "" "NOTE: The result of these operations depends on the operands types. If both " "are Integers, then the result will be an Integer. That means 1/10 returns 0 " @@ -1946,224 +2045,241 @@ msgid "" "is a float: float(1)/10 or 1.0/10 return both 0.1." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:231 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:264 msgid "``+`` ``-``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:231 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:264 msgid "Addition / Subtraction" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:233 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:266 msgid "``<<`` ``>>``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:233 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:266 msgid "Bit Shifting" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:235 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:268 msgid "``&``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:235 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:268 msgid "Bitwise AND" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:237 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:270 msgid "``^``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:237 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:270 msgid "Bitwise XOR" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:239 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:272 msgid "``|``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:239 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:272 msgid "Bitwise OR" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:241 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:274 msgid "``<`` ``>`` ``==`` ``!=`` ``>=`` ``<=``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:241 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:274 msgid "Comparisons" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:243 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:276 msgid "``in``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:243 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:276 msgid "Content Test" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:245 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:278 msgid "``!`` ``not``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:245 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:278 msgid "Boolean NOT" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:247 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:280 msgid "``and`` ``&&``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:247 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:280 msgid "Boolean AND" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:249 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:282 msgid "``or`` ``||``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:249 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:282 msgid "Boolean OR" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:251 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:284 msgid "``if x else``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:251 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:284 msgid "Ternary if/else" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:253 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:286 msgid "``=`` ``+=`` ``-=`` ``*=`` ``/=`` ``%=`` ``&=`` ``|=``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:253 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:286 msgid "Assignment, Lowest Priority" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:257 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:290 msgid "Literals" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:260 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:293 msgid "**Literal**" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:262 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:295 msgid "``45``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:262 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:295 msgid "Base 10 integer" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:264 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:297 msgid "``0x8F51``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:264 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:297 msgid "Base 16 (hex) integer" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:266 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:299 msgid "``3.14``, ``58.1e-10``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:266 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:299 msgid "Floating point number (real)" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:268 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:301 msgid "``\"Hello\"``, ``\"Hi\"``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:268 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:301 msgid "Strings" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:270 -msgid "``\"\"\"Hello, Dude\"\"\"``" +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:303 +msgid "``\"\"\"Hello\"\"\"``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:270 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:303 msgid "Multiline string" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:272 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:305 msgid "``@\"Node/Label\"``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:272 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:305 msgid "NodePath or StringName" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:276 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:309 msgid "Comments" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:278 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:311 msgid "" "Anything from a ``#`` to the end of the line is ignored and is considered a " "comment." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:297 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:319 +msgid "" +"Multi-line comments can be created using \"\"\" (three quotes in a row) at " +"the beginning and end of a block of text. Note that this creates a string, " +"therefore, it will not be stripped away when the script is compiled." +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:330 msgid "Built-in types" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:300 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:332 +msgid "" +"Built-in types are stack-allocated. They are passed as values. This means a " +"copy is created on each assignment or when passing them as arguments to " +"functions. The only exceptions are ``Array``s and ``Dictionaries``, which " +"are passed by reference so they are shared. (Not ``PoolArray``s like " +"``PoolByteArray`` though, those are passed as values too, so consider this " +"when deciding which to use!)" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:339 msgid "Basic built-in types" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:302 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:341 msgid "A variable in GDScript can be assigned to several built-in types." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:305 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:344 #: ../../docs/tutorials/misc/binary_serialization_api.rst:25 msgid "null" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:307 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:346 msgid "" "``null`` is an empty data type that contains no information and can not be " "assigned any other value." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:311 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:350 #: ../../docs/tutorials/misc/binary_serialization_api.rst:27 msgid "bool" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:313 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:352 msgid "The Boolean data type can only contain ``true`` or ``false``." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:316 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:355 msgid "int" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:318 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:357 msgid "" "The integer data type can only contain integer numbers, (both negative and " "positive)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:322 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:361 #: ../../docs/tutorials/misc/binary_serialization_api.rst:31 msgid "float" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:324 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:363 msgid "Used to contain a floating point value (real numbers)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:327 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:366 msgid ":ref:`String `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:329 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:368 msgid "" "A sequence of characters in `Unicode format `_. Strings can contain the `standard C escape sequences `." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:335 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:374 msgid "Vector built-in types" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:338 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:377 msgid ":ref:`Vector2 `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:340 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:379 msgid "" "2D vector type containing ``x`` and ``y`` fields. Can also be accessed as " "array." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:344 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:383 msgid ":ref:`Rect2 `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:346 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:385 msgid "" "2D Rectangle type containing two vectors fields: ``position`` and ``size``. " "Alternatively contains an ``end`` field which is ``position+size``." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:350 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:389 msgid ":ref:`Vector3 `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:352 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:391 msgid "" "3D vector type containing ``x``, ``y`` and ``z`` fields. This can also be " "accessed as an array." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:356 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:395 msgid ":ref:`Transform2D `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:358 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:397 msgid "3x2 matrix used for 2D transforms." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:361 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:400 msgid ":ref:`Plane `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:363 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:402 msgid "" "3D Plane type in normalized form that contains a ``normal`` vector field and " "a ``d`` scalar distance." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:367 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:406 msgid ":ref:`Quat `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:369 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:408 msgid "" "Quaternion is a datatype used for representing a 3D rotation. It's useful " "for interpolating rotations." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:373 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:412 msgid ":ref:`AABB `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:375 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:414 msgid "" "Axis-aligned bounding box (or 3D box) contains 2 vectors fields: " "``position`` and ``size``. Alternatively contains an ``end`` field which is " "``position+size``." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:380 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:419 msgid ":ref:`Basis `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:382 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:421 msgid "" "3x3 matrix used for 3D rotation and scale. It contains 3 vector fields " "(``x``, ``y`` and ``z``) and can also be accessed as an array of 3D vectors." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:387 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:426 msgid ":ref:`Transform `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:389 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:428 msgid "" "3D Transform contains a Basis field ``basis`` and a Vector3 field ``origin``." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:393 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:432 msgid "Engine built-in types" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:396 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:435 msgid ":ref:`Color `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:398 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:437 msgid "" "Color data type contains ``r``, ``g``, ``b``, and ``a`` fields. It can also " "be accessed as ``h``, ``s``, and ``v`` for hue/saturation/value." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:402 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:441 msgid ":ref:`NodePath `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:404 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:443 msgid "" "Compiled path to a node used mainly in the scene system. It can be easily " "assigned to, and from, a String." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:408 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:447 msgid ":ref:`RID `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:410 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:449 msgid "Resource ID (RID). Servers use generic RIDs to reference opaque data." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:413 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:452 msgid ":ref:`Object `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:415 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:454 msgid "Base class for anything that is not a built-in type." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:418 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:457 msgid "Container built-in types" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:421 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:460 msgid ":ref:`Array `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:423 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:462 msgid "" "Generic sequence of arbitrary object types, including other arrays or " "dictionaries (see below). The array can resize dynamically. Arrays are " @@ -2319,7 +2435,7 @@ msgid "" "negative like in Python, to count from the end." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:437 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:476 msgid "" "GDScript arrays are allocated linearly in memory for speed. Very large " "arrays (more than tens of thousands of elements) may however cause memory " @@ -2329,51 +2445,51 @@ msgid "" "arrays. They are therefore only recommended to use for very large data sets:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:444 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:483 msgid "" ":ref:`PoolByteArray `: An array of bytes (integers from " "0 to 255)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:445 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:484 msgid ":ref:`PoolIntArray `: An array of integers." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:446 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:485 msgid ":ref:`PoolRealArray `: An array of floats." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:447 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:486 msgid ":ref:`PoolStringArray `: An array of strings." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:448 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:487 msgid "" ":ref:`PoolVector2Array `: An array of :ref:`Vector2 " "` objects." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:449 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:488 msgid "" ":ref:`PoolVector3Array `: An array of :ref:`Vector3 " "` objects." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:450 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:489 msgid "" ":ref:`PoolColorArray `: An array of :ref:`Color " "` objects." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:453 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:492 msgid ":ref:`Dictionary `" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:455 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:494 msgid "Associative container which contains values referenced by unique keys." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:468 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:507 msgid "" "Lua-style table syntax is also supported. Lua-style uses ``=`` instead of ``:" "`` and doesn't use quotes to mark string keys (making for slightly less to " @@ -2381,58 +2497,58 @@ msgid "" "form cannot start with a digit." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:482 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:521 msgid "" "To add a key to an existing dictionary, access it like an existing key and " "assign to it::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:491 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:530 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:228 msgid "Data" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:494 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:533 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:131 msgid "Variables" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:496 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:535 msgid "" "Variables can exist as class members or local to functions. They are created " "with the ``var`` keyword and may, optionally, be assigned a value upon " "initialization." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:510 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:549 msgid "" "Constants are similar to variables, but must be constants or constant " "expressions and must be assigned on initialization." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:524 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:563 msgid "Enums" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:526 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:565 msgid "" "Enums are basically a shorthand for constants, and are pretty useful if you " "want to assign consecutive integers to some constant." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:529 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:568 msgid "" "If you pass a name to the enum, it would also put all the values inside a " "constant dictionary of that name." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:550 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:589 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:391 #: ../../docs/tutorials/shading/shading_language.rst:255 msgid "Functions" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:552 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:591 msgid "" "Functions always belong to a `class `_. The scope priority for " "variable look-up is: local → class member → global. The ``self`` variable is " @@ -2441,22 +2557,16 @@ msgid "" "argument, unlike Python)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:565 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:604 msgid "" "A function can ``return`` at any point. The default return value is ``null``." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:568 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:607 msgid "Referencing Functions" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:570 -msgid "" -"To call a function in a *base class* (i.e. one ``extend``-ed in your current " -"class), prepend ``.`` to the function name:" -msgstr "" - -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:577 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:609 msgid "" "Contrary to Python, functions are *not* first class objects in GDScript. " "This means they cannot be stored in variables, passed as an argument to " @@ -2464,14 +2574,14 @@ msgid "" "performance reasons." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:581 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:613 msgid "" "To reference a function by name at runtime, (e.g. to store it in a variable, " "or pass it to another function as an argument) one must use the ``call`` or " "``funcref`` helpers::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:594 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:626 msgid "" "Remember that default functions like ``_init``, and most notifications such " "as ``_enter_tree``, ``_exit_tree``, ``_process``, ``_physics_process``, etc. " @@ -2479,33 +2589,33 @@ msgid "" "call the function explicitly when overloading them in some way." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:602 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:634 msgid "Static functions" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:604 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:636 msgid "" "A function can be declared static. When a function is static it has no " "access to the instance member variables or ``self``. This is mainly useful " "to make libraries of helper functions:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:615 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:647 msgid "Statements and control flow" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:617 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:649 msgid "" "Statements are standard and can be assignments, function calls, control flow " "structures, etc (see below). ``;`` as a statement separator is entirely " "optional." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:622 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:654 msgid "if/else/elif" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:624 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:656 msgid "" "Simple conditions are created by using the ``if``/``else``/``elif`` syntax. " "Parenthesis around conditions are allowed, but not required. Given the " @@ -2513,23 +2623,23 @@ msgid "" "``else``/``if`` to maintain a level of indentation." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:638 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:670 msgid "Short statements can be written on the same line as the condition::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:645 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:677 msgid "" "Sometimes you might want to assign a different initial value based on a " "boolean expression. In this case ternary-if expressions come in handy::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:654 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:686 msgid "" "Simple loops are created by using ``while`` syntax. Loops can be broken " "using ``break`` or continued using ``continue``:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:665 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:697 msgid "" "To iterate through a range, such as an array or table, a *for* loop is used. " "When iterating over an array, the current array element is stored in the " @@ -2537,44 +2647,44 @@ msgid "" "the loop variable." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:694 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:726 msgid "" "A ``match`` statement is used to branch execution of a program. It's the " "equivalent of the ``switch`` statement found in many other languages but " "offers some additional features." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:697 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:729 msgid "Basic syntax:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:710 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:742 msgid "**Crash-course for people who are familiar to switch statements**:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:712 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:744 msgid "Replace ``switch`` with ``match``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:713 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:745 msgid "Remove ``case``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:714 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:746 msgid "" "Remove any ``break``'s. If you don't want to ``break`` by default you can " "use ``continue`` for a fallthrough." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:715 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:747 msgid "Change ``default`` to a single underscore." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:718 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:750 msgid "**Control flow**:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:720 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:752 msgid "" "The patterns are matched from top to bottom. If a pattern matches, the " "corresponding block will be executed. After that, the execution continues " @@ -2583,127 +2693,127 @@ msgid "" "it." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:724 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:756 msgid "There are 6 pattern types:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:736 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:768 msgid "constant pattern" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:727 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:759 msgid "constant primitives, like numbers and strings ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:748 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:780 msgid "variable pattern" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:739 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:771 msgid "matches the contents of a variable/enum ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:762 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:794 msgid "wildcard pattern" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:751 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:783 msgid "This pattern matches everything. It's written as a single underscore." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:753 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:785 msgid "" "It can be used as the equivalent of the ``default`` in a ``switch`` " "statement in other languages. ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:775 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:807 msgid "binding pattern" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:765 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:797 msgid "" "A binding pattern introduces a new variable. Like the wildcard pattern, it " "matches everything - and also gives that value a name. It's especially " "useful in array and dictionary patterns. ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:794 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:826 msgid "array pattern" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:778 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:810 msgid "" "matches an array. Every single element of the array pattern is a pattern " "itself so you can nest them." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:780 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:812 msgid "" "The length of the array is tested first, it has to be the same size as the " "pattern, otherwise the pattern don't match." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:782 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:814 msgid "" "**Open-ended array**: An array can be bigger than the pattern by making the " "last subpattern ``..``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:784 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:816 msgid "Every subpattern has to be comma separated. ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:819 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:851 msgid "dictionary pattern" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:797 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:829 msgid "" "Works in the same way as the array pattern. Every key has to be a constant " "pattern." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:799 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:831 msgid "" "The size of the dictionary is tested first, it has to be the same size as " "the pattern, otherwise the pattern don't match." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:801 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:833 msgid "" "**Open-ended dictionary**: A dictionary can be bigger than the pattern by " "making the last subpattern ``..``" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:803 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:835 msgid "Every subpattern has to be comma separated." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:805 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:837 msgid "" "If you don't specify a value, then only the existence of the key is checked." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:807 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:839 msgid "A value pattern is separated from the key pattern with a ``:`` ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:830 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:862 msgid "Multipatterns:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:822 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:854 msgid "" "You can also specify multiple patterns separated by a comma. These patterns " "aren't allowed to have any bindings in them. ::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:833 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:865 msgid "Classes" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:835 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:867 msgid "" "By default, the body of a script file is an unnamed class and it can only be " "referenced externally as a resource or file. Class syntax is meant to be " @@ -2714,49 +2824,62 @@ msgid "" "dictionaries) are initialized every time an instance is created." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:844 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:876 msgid "Below is an example of a class file." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:856 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:888 msgid "Inheritance" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:858 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:890 msgid "A class (stored as a file) can inherit from" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:860 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:892 msgid "A global class" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:861 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:893 msgid "Another class file" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:862 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:894 msgid "An inner class inside another class file." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:864 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:896 msgid "Multiple inheritance is not allowed." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:866 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:898 msgid "Inheritance uses the ``extends`` keyword:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:880 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:912 msgid "" "To check if a given instance inherits from a given class the ``is`` keyword " "can be used:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:895 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:926 +msgid "" +"To call a function in a *base class* (i.e. one ``extend``-ed in your current " +"class), prepend ``.`` to the function name:" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:933 +msgid "" +"This is especially useful because functions in extending classes replace " +"functions with the same name in their base classes. So if you still want to " +"call them, you can use ``.`` like the ``super`` keyword in other languages:" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:943 msgid "Class Constructor" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:897 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:945 msgid "" "The class constructor, called on class instantiation, is named ``_init``. As " "mentioned earlier, the constructors of parent classes are called " @@ -2764,25 +2887,25 @@ msgid "" "``._init()`` explicitly." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:901 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:949 msgid "If a parent constructor takes arguments, they are passed like this:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:909 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:957 msgid "Inner classes" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:911 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:959 msgid "" "A class file can contain inner classes. Inner classes are defined using the " "``class`` keyword. They are instanced using the ``ClassName.new()`` function." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:931 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:979 msgid "Classes as resources" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:933 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:981 msgid "" "Classes stored as files are treated as :ref:`resources `. " "They must be loaded from disk to access them in other classes. This is done " @@ -2791,11 +2914,11 @@ msgid "" "class object::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:949 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:997 msgid "Exports" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:951 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:999 msgid "" "Class members can be exported. This means their value gets saved along with " "the resource (e.g. the :ref:`scene `) they're attached " @@ -2803,13 +2926,13 @@ msgid "" "Exporting is done by using the ``export`` keyword::" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:960 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1008 msgid "" "An exported variable must be initialized to a constant expression or have an " "export hint in the form of an argument to the export keyword (see below)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:963 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1011 msgid "" "One of the fundamental benefits of exporting member variables is to have " "them visible and editable in the editor. This way artists and game designers " @@ -2817,47 +2940,47 @@ msgid "" "special export syntax is provided." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1043 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1091 msgid "" "It must be noted that even if the script is not being run while at the " "editor, the exported properties are still editable (see below for \"tool\")." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1048 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1096 msgid "Exporting bit flags" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1050 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1098 msgid "" "Integers used as bit flags can store multiple ``true``/``false`` (boolean) " "values in one property. By using the export hint ``int, FLAGS``, they can be " "set from the editor:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1059 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1107 msgid "" "Restricting the flags to a certain number of named flags is also possible. " "The syntax is very similar to the enumeration syntax:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1067 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1115 msgid "" "In this example, ``Fire`` has value 1, ``Water`` has value 2, ``Earth`` has " "value 4 and ``Wind`` corresponds to value 8. Usually, constants should be " "defined accordingly (e.g. ``const ELEMENT_WIND = 8`` and so on)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1072 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1120 msgid "" "Using bit flags requires some understanding of bitwise operations. If in " "doubt, boolean variables should be exported instead." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1076 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1124 msgid "Exporting arrays" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1078 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1126 msgid "" "Exporting arrays works but with an important caveat: While regular arrays " "are created local to every class instance, exported arrays are *shared* " @@ -2866,24 +2989,24 @@ msgid "" "initializers, but they must be constant expressions." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1104 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1152 msgid "Setters/getters" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1106 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1154 msgid "" "It is often useful to know when a class' member variable changes for " "whatever reason. It may also be desired to encapsulate its access in some " "way." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1109 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1157 msgid "" "For this, GDScript provides a *setter/getter* syntax using the ``setget`` " "keyword. It is used directly after a variable definition:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1116 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1164 msgid "" "Whenever the value of ``variable`` is modified by an *external* source (i.e. " "not from local usage in the class), the *setter* function (``setterfunc`` " @@ -2893,27 +3016,27 @@ msgid "" "``return`` the desired value. Below is an example:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1133 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1181 msgid "Either of the *setter* or *getter* functions can be omitted:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1142 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1190 msgid "" "Get/Setters are especially useful when exporting variables to editor in tool " "scripts or plugins, for validating input." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1145 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1193 msgid "" "As said *local* access will *not* trigger the setter and getter. Here is an " "illustration of this:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1160 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1208 msgid "Tool mode" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1162 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1210 msgid "" "Scripts, by default, don't run inside the editor and only the exported " "properties can be changed. In some cases it is desired that they do run " @@ -2922,11 +3045,11 @@ msgid "" "top of the file:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1177 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1225 msgid "Memory management" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1179 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1227 msgid "" "If a class inherits from :ref:`class_Reference`, then instances will be " "freed when no longer in use. No garbage collector exists, just simple " @@ -2937,43 +3060,43 @@ msgid "" "weak references." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1191 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1239 msgid "" "It is often desired to send a notification that something happened in an " "instance. GDScript supports creation of built-in Godot signals. Declaring a " "signal in GDScript is easy using the `signal` keyword." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1202 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1250 msgid "" "These signals, just like regular signals, can be connected in the editor or " "from code. Just take the instance of a class where the signal was declared " "and connect it to the method of another instance:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1218 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1266 msgid "" "It is also possible to bind arguments to a signal that lacks them with your " "custom values:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1226 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1274 msgid "" "This is very useful when a signal from many objects is connected to a single " "callback and the sender must be identified:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1238 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1286 msgid "" "Finally, emitting a custom signal is done by using the Object.emit_signal " "method:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1249 -msgid "Coroutines" +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1297 +msgid "Coroutines with yield" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1251 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1299 msgid "" "GDScript offers support for `coroutines `_ via the ``yield`` built-in function. Calling ``yield()`` will " @@ -2983,32 +3106,32 @@ msgid "" "returns. Once resumed the state object becomes invalid. Here is an example:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1273 -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1297 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1321 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1345 msgid "Will print:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1281 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1329 msgid "" "It is also possible to pass values between yield() and resume(), for example:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1306 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1354 msgid "Coroutines & signals" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1308 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1356 msgid "" "The real strength of using ``yield`` is when combined with signals. " "``yield`` can accept two parameters, an object and a signal. When the signal " "is received, execution will recommence. Here are some examples:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1324 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1372 msgid "Onready keyword" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1326 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1374 msgid "" "When using nodes, it's very common to desire to keep references to parts of " "the scene in a variable. As scenes are only warranted to be configured when " @@ -3016,7 +3139,7 @@ msgid "" "call to Node._ready() is made." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1338 +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1386 msgid "" "This can get a little cumbersome, especially when nodes and external " "references pile up. For this, GDScript has the ``onready`` keyword, that " @@ -3024,6 +3147,16 @@ msgid "" "replace the above code with a single line:" msgstr "" +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1396 +msgid "Assert keyword" +msgstr "" + +#: ../../docs/getting_started/scripting/gdscript/gdscript_basics.rst:1398 +msgid "" +"The ``assert`` keyword can be used to check conditions in debug builds. " +"These assertions are ignored in non-debug builds." +msgstr "" + #: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:4 msgid "GDScript: An introduction to dynamic languages" msgstr "" @@ -3150,11 +3283,11 @@ msgid "" "different arguments, for example:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:106 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:107 msgid "Pointers & referencing:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:108 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:109 msgid "" "In static languages such as C or C++ (and to some extent Java and C#), there " "is a distinction between a variable and a pointer/reference to a variable. " @@ -3162,7 +3295,7 @@ msgid "" "reference to the original one." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:113 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:114 msgid "" "In C# or Java, everything not a built-in type (int, float, sometimes String) " "is always a pointer or a reference. References are also garbage-collected " @@ -3170,19 +3303,19 @@ msgid "" "typed languages tend to use this memory model too. Some Examples:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:119 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:120 msgid "C++:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:135 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:136 msgid "Java:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:153 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:154 msgid "GDScript:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:165 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:166 msgid "" "In GDScript, only base types (int, float, string and the vector types) are " "passed by value to functions (value is copied). Everything else (instances, " @@ -3192,36 +3325,36 @@ msgid "" "from :ref:`class_Object`." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:173 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:174 msgid "Arrays" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:175 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:176 msgid "" "Arrays in dynamically typed languages can contain many different mixed " "datatypes inside and are always dynamic (can be resized at any time). " "Compare for example arrays in statically typed languages:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:202 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:203 msgid "And in GDScript:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:211 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:212 msgid "" "In dynamically typed languages, arrays can also double as other datatypes, " "such as lists:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:221 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:222 msgid "Or unordered sets:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:230 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:231 msgid "Dictionaries" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:232 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:233 msgid "" "Dictionaries are a very powerful tool in dynamically typed languages. Most " "programmers that come from statically typed languages (such as C++ or C#) " @@ -3230,7 +3363,7 @@ msgid "" "form)." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:238 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:239 msgid "" "Dictionaries can map any value to any other value with complete disregard " "for the datatype used as either key or value. Contrary to popular belief, " @@ -3239,17 +3372,17 @@ msgid "" "implementing arrays as dictionaries." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:244 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:245 msgid "Example of Dictionary:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:251 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:252 msgid "" "Dictionaries are also dynamic, keys can be added or removed at any point at " "little cost:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:260 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:261 msgid "" "In most cases, two-dimensional arrays can often be implemented more easily " "with dictionaries. Here's a simple battleship game example:" @@ -3297,28 +3430,28 @@ msgstr "" msgid "Translate to:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:390 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:393 msgid "And backwards looping is done through a negative counter:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:396 -msgid "becomes" +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:399 +msgid "Becomes:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:403 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:407 #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:384 msgid "While" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:405 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:409 msgid "while() loops are the same everywhere:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:416 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:420 msgid "Custom iterators" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:417 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:421 msgid "" "You can create custom iterators in case the default ones don't quite meet " "your needs by overriding the Variant class's ``_iter_init``, ``_iter_next``, " @@ -3326,21 +3459,21 @@ msgid "" "forward iterator follows:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:449 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:453 msgid "And it can be used like any other iterator:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:457 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:461 msgid "" "Make sure to reset the state of the iterator in ``_iter_init``, otherwise " "nested for-loops that use custom iterators will not work as expected." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:461 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:465 msgid "Duck typing" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:463 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:467 msgid "" "One of the most difficult concepts to grasp when moving from a statically " "typed language to a dynamic one is duck typing. Duck typing makes overall " @@ -3348,14 +3481,14 @@ msgid "" "how it works." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:468 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:472 msgid "" "As an example, imagine a situation where a big rock is falling down a " "tunnel, smashing everything on its way. The code for the rock, in a " "statically typed language would be something like:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:479 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:483 msgid "" "This way, everything that can be smashed by a rock would have to inherit " "Smashable. If a character, enemy, piece of furniture, small rock were all " @@ -3366,14 +3499,14 @@ msgid "" "them can be smashed." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:487 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:491 msgid "" "With dynamically typed languages, this is not a problem. Duck typing makes " "sure you only have to define a ``smash()`` function where required and " "that's it. No need to consider inheritance, base classes, etc." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:496 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:500 msgid "" "And that's it. If the object that hit the big rock has a smash() method, it " "will be called. No need for inheritance or polymorphism. Dynamically typed " @@ -3382,26 +3515,26 @@ msgid "" "make this clearer:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:502 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:506 msgid "" "*\"When I see a bird that walks like a duck and swims like a duck and quacks " "like a duck, I call that bird a duck\"*" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:505 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:509 msgid "In this case, it translates to:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:507 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:511 msgid "" "*\"If the object can be smashed, don't care what it is, just smash it.\"*" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:509 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:513 msgid "Yes, we should call it Hulk typing instead." msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:511 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:515 msgid "" "It's possible that the object being hit doesn't have a smash() function. " "Some dynamically typed languages simply ignore a method call when it doesn't " @@ -3409,13 +3542,13 @@ msgid "" "function exists is desirable:" msgstr "" -#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:522 +#: ../../docs/getting_started/scripting/gdscript/gdscript_advanced.rst:526 msgid "" "Then, simply define that method and anything the rock touches can be smashed." msgstr "" #: ../../docs/getting_started/scripting/index.rst:2 -#: ../../docs/getting_started/step_by_step/resources.rst:138 +#: ../../docs/getting_started/step_by_step/resources.rst:164 #: ../../docs/getting_started/step_by_step/scripting.rst:4 #: ../../docs/tutorials/networking/http_request_class.rst:22 msgid "Scripting" @@ -4187,6 +4320,329 @@ msgid "" "or ``EmitSignal``)." msgstr "" +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:4 +msgid "Style Guide" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:6 +msgid "" +"Having well-defined and consistent coding conventions is important for every " +"project, and Godot is no exception to this rule." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:9 +msgid "" +"This page contains a coding style guide which is followed by developers and " +"contributors of Godot itself. As such, it is mainly intended for those who " +"want to contribute to the project, but since the conventions and guidelines " +"mentioned in this article are those most widely adopted by the users of the " +"language, we encourage you to do the same, especially if you do not have " +"such a guide yet." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:14 +msgid "" +"This article is by no means an exhaustive guide on how to follow the " +"standard coding conventions or best practices. If you feel unsure of an " +"aspect which is not covered here, please refer to more comprehensive " +"documentation, such as `C# Coding Conventions `_ or " +"`Framework Design Guidelines `_." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:21 +msgid "Language Specification" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:23 +msgid "" +"Currently, Godot uses C# version 6.0 in its engine and example source code. " +"So, before we move to a newer version, care must be taken to avoid mixing " +"language features only available in C# 7.0 or later, such as pattern " +"matching or expression-bodied members inside get/set accessors." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:27 +msgid "" +"For detailed information of C# features in different versions, please see " +"`What's New in C# `_." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:31 +msgid "Formatting Conventions" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:33 +msgid "" +"If you create a new file, make sure that it uses linefeed (*LF*) characters " +"to break lines, not *CRLF* or *CR*." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:34 +msgid "" +"Use UTF-8 encoding without a byte order mark (BOM )." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:35 +msgid "" +"Use 4 spaces instead of tabs for indentation (which is referred to as 'soft " +"tabs')." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:38 +msgid "Line Breaks and Blank Lines" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:40 +msgid "" +"For a general indentation rule, follow `The 'Allman Style' `_ which recommends " +"placing the brace associated with a control statement on the next line, " +"indented to the same level:" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:57 +msgid "However, you may choose to omit line breaks inside brackets," +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:59 +msgid "For simple property accessors." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:60 +msgid "For simple object, array, or collection initializers." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:61 +msgid "For abstract auto property, indexer, or event declarations." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:83 +msgid "Insert a blank line," +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:85 +msgid "After *using* statement list." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:86 +msgid "Between method, properties, and inner type declarations." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:88 +msgid "" +"Field and constant declarations can be grouped together according to " +"relevance. In that case, consider inserting a blank line between the groups " +"for easier reading." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:91 +msgid "Avoid inserting a blank line," +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:93 +msgid "After an opening bracket ('{')." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:94 +msgid "Before a closing bracket ('}')." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:95 +msgid "After a comment block, or a single line comment." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:96 +msgid "Adjacent to another blank line." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:133 +msgid "" +"Consider breaking a line when it's longer than 100 characters. And it's also " +"a good practice to insert a line feed (LF) character at the end of a file " +"because some utilities have trouble recognizing the last line without it (i." +"e. Linux's *cat* command)." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:138 +msgid "Using Spaces" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:140 +msgid "Insert a space," +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:142 +msgid "Around a binary and tertiary operator." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:143 +msgid "" +"Between an opening parenthesis and *if*, *for*, *foreach*, *catch*, *while*, " +"*lock* or *using* keywords." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:144 +msgid "Before and within a single line accessor block." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:145 +msgid "Between accessors in a single line accessor block." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:146 +msgid "After a comma." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:147 +msgid "After a semi-colon in a *for* statement." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:148 +msgid "After a colon in a single line *case* statement." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:149 +msgid "Around a colon in a type declaration." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:150 +msgid "Around a lambda arrow." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:151 +msgid "" +"After a single line comment symbol ('//'), and before it if used at the end " +"of a line." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:153 +msgid "Do not use a space," +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:155 +msgid "After a type cast parentheses." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:156 +msgid "Within single line initializer braces." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:158 +msgid "" +"The following example shows a proper use of spaces, according to some of the " +"the above mentioned conventions:" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:195 +msgid "" +"Use *PascalCase* for all namespaces, type names and member level identifiers " +"(i.e. methods, properties, constants, events), except for private fields:" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:216 +msgid "" +"Use *camelCase* for all other identifiers (i.e. local variables, method " +"arguments), and use underscore('_') as a prefix for private fields (but not " +"for methods or properties, as explained above):" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:230 +msgid "" +"There's an exception with acronyms which consist of two letters like *'UI'* " +"which should be written in upper case letters when used where Pascal case " +"would be expected, and in lower case letters otherwise." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:233 +msgid "" +"Note that *'id'* is **not** an acronym, so it should be treated as a normal " +"identifier:" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:244 +msgid "" +"It is generally discouraged to use a type name as a prefix of an identifier " +"like *'string strText'* or *'float fPower'*, for example. However, there's " +"an exception about interfaces, in which case they **should** be named using " +"an upper case *'I'* as a prefix, like *'IInventoryHolder'* or " +"*'IDamageable'*." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:248 +msgid "" +"Lastly, consider choosing descriptive names and do not try to shorten them " +"too much if it affects readability." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:251 +msgid "" +"For instance, if you want to write a code to find a nearby enemy and hit " +"with an weapon, prefer" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:257 +msgid "Rather than," +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:264 +msgid "Implicitly Typed Local Variables" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:266 +msgid "" +"Consider using implicitly typing (*'var'*) for declaration of a local " +"variable, but do so **only when the type is evident** from the right side of " +"the assignment:" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:296 +msgid "Other Considerations" +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:298 +msgid "Use explicit access modifiers." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:299 +msgid "Use properties instead of non-private fields." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:300 +msgid "" +"Use modifiers in this order: *'public/protected/private/internal virtual/" +"override/abstract/new static readonly'*." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:301 +msgid "" +"Avoid using fully qualified names or *'this.'* prefix for members when it's " +"not necessary." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:302 +msgid "Remove unused *'using'* statements and unnecessary parentheses." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:303 +msgid "Consider omitting default initial value for a type." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:304 +msgid "" +"Consider using null-conditional operators or type initializers to make the " +"code more compact." +msgstr "" + +#: ../../docs/getting_started/scripting/c_sharp/c_sharp_style_guide.rst:305 +msgid "" +"Use safe cast when there is a possibility of the value being a different " +"type, and use direct cast otherwise." +msgstr "" + #: ../../docs/getting_started/scripting/visual_script/nodes_purposes.rst:4 msgid "Nodes and Terminology" msgstr "" @@ -5262,7 +5718,7 @@ msgid "" msgstr "" #: ../../docs/getting_started/workflow/export/exporting_projects.rst:91 -#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:189 +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:199 msgid "Export templates" msgstr "" @@ -10056,8 +10512,8 @@ msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:27 msgid "" -"To learn how to control the interface and connect it to other scripts, read " -"`Build your first game UI in Godot <#>`__." +"To learn how to control the interface and connect it to other scripts, read :" +"ref:`Build your first game UI in Godot `." msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:30 @@ -10110,104 +10566,103 @@ msgstr "" #: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:53 msgid "" "Godot ships with dozens of Control nodes. A lot of them are here to help you " -"build editor plugins and applications. To learn more about them, check the " -"guide about `Advanced UI nodes and Themes `__." +"build editor plugins and applications." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:57 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:56 msgid "" "For most games, you'll only need five types of UI elements, and a few " "Containers. These five Control nodes are:" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:60 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:59 msgid "Label: for displaying text" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:61 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:60 msgid "" "TextureRect: used mostly for backgrounds, or everything that should be a " "static image" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:63 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:62 msgid "" "TextureProgress: for lifebars, loading bars, horizontal, vertical or radial" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:65 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:64 msgid "NinePatchRect: for scalable panels" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:66 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:65 msgid "TextureButton: to create buttons" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:70 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:69 msgid "The 5 most common Control nodes for UI design" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:73 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:72 msgid "TextureRect" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:75 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:74 msgid "" "**TextureRect** displays a texture or image inside a UI. It seems similar to " "the Sprite node but it offers multiple scaling modes. Set the Stretch Mode " "property to change its behaviour:" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:79 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:78 msgid "" "``Scale On Expand (compat)`` scales the texture to fit the node’s bounding " "rectangle, only if ``expand`` property is ``true``; otherwise, it behaves " "like ``Keep`` mode. Default mode for backwards compatibility." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:80 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:79 msgid "``Scale`` scales the texture to fit the node’s bounding rectangle" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:81 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:80 msgid "``Tile`` makes the texture repeat, but it won't scale" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:82 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:81 msgid "" "``Keep`` and ``Keep Centered`` force the texture to remain at its original " "size, in the top left corner or the center of the frame respectively" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:85 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:84 msgid "" "``Keep Aspect`` and ``Keep Aspect Centered`` scales the texture but force it " "to remain its original aspect ratio, in the top left corner or the center of " "the frame respectively" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:86 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:85 msgid "" "``Keep Aspect Covered`` works just like ``Keep Aspect Centered`` but the " "shorter side fits the bounding rectangle and the other one clips to the " "node’s limits" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:88 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:87 msgid "" "As with Sprite nodes, you can modulate the TextureRect's colour. Click the " "``Modulate`` property and use the color picker." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:93 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:92 msgid "TextureRect modulated with a red color" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:96 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:95 msgid "TextureButton" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:98 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:97 msgid "" "**TextureButton** is like TextureRect, except it has 5 texture slots: one " "for each of the button's states. Most of the time, you'll use the Normal, " @@ -10216,7 +10671,7 @@ msgid "" "the clickable area using a 2-bit, pure black and white image." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:105 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:104 msgid "" "In the Base Button section, you'll find a few checkboxes that change how the " "button behaves. When ``Toggle Mode`` is on, the button will toggle between " @@ -10227,22 +10682,22 @@ msgid "" "modes to change its scale behavior." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:115 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:114 msgid "TextureButton and its 5 texture slots" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:118 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:117 msgid "TextureProgress" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:120 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:119 msgid "" "**TextureProgress** layers up to 3 sprites to create a progress bar. The " "Under and Over textures sandwich the Progress one, which displays the bar's " "value." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:124 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:123 msgid "" "The ``Mode`` property controls the direction in which the bar grows: " "horizontally, vertically, or radially. If you set it to radial, the " @@ -10250,7 +10705,7 @@ msgid "" "the gauge." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:129 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:128 msgid "" "To animate the bar, you'll want to look at the Range section. Set the " "``Min`` and ``Max`` properties to define the range of the gauge. For " @@ -10261,16 +10716,16 @@ msgid "" "40% of the ``Progress`` texture will show up, and 60% of it will stay hidden." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:139 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:138 msgid "TextureProgress bar, two thirds filled" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:142 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:141 #: ../../docs/getting_started/step_by_step/scripting.rst:116 msgid "Label" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:144 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:143 msgid "" "**Label** prints text to the screen. You'll find all its properties in the " "Label section, in the Inspector. Write the text in the ``Text`` property, " @@ -10279,15 +10734,15 @@ msgid "" "horizontally and vertically with Align and Valign respectively." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:153 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:152 msgid "Picture of a Label" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:156 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:155 msgid "NinePatchRect" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:158 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:157 msgid "" "**NinePatchRect** takes a texture split in 3 rows and 3 columns. The center " "and the sides tile when you scale the texture, but it never scales the " @@ -10295,32 +10750,32 @@ msgid "" "backgrounds for your UI." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:165 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:164 msgid "NinePatchRect scaled with the min\\_size property" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:168 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:167 msgid "There are two workflows to build responsive UIs" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:170 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:169 msgid "" "There are two workflows to build scalable and flexible interfaces in Godot:" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:172 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:171 msgid "" "You have many container nodes at your disposal that scale and place UI " "elements for you. They take control over their children." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:173 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:172 msgid "" "On the other side, you have the layout menu. It helps you to anchor, place " "and resize a UI element within its parent." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:175 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:174 msgid "" "The two approaches are not always compatible. Because a container controls " "its children, you cannot use the layout menu on them. Each container has a " @@ -10331,17 +10786,17 @@ msgid "" "grid, etc." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:177 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:176 msgid "" "As you create UIs for your games and tools, you'll develop a sense for what " "fits best in each situation." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:181 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:180 msgid "Place UI elements precisely with anchors" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:183 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:182 msgid "" "Control nodes have a position and size, but they also have anchors and " "margins. Anchors define the origin, or the reference point, for the Left, " @@ -10349,15 +10804,15 @@ msgid "" "change the reference point of the margins." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:190 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:189 msgid "The anchor property" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:193 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:192 msgid "How to change the anchor" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:195 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:194 msgid "" "Like any properties, you can edit the 4 anchor points in the Inspector, but " "this is not the most convenient way. When you select a control node, the " @@ -10367,15 +10822,15 @@ msgid "" "a control node." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:204 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:203 msgid "The layout menu in the viewport" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:207 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:206 msgid "Anchors are relative to the parent container" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:209 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:208 msgid "" "Each anchor is a value between 0 and 1. For the left and top anchors, a " "value of 0 means that without any margin, the node's edges will align with " @@ -10386,17 +10841,17 @@ msgid "" "size." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:219 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:218 msgid "" "Margins are relative to the anchor position, which is relative to the " "anchors. In practice, you'll often let the container update margins for you" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:224 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:223 msgid "Margins change with the anchor" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:226 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:225 msgid "" "Margins update automatically when you move or resize a control node. They " "represent the distance from the control node's edges to its anchor, which is " @@ -10406,11 +10861,11 @@ msgid "" "Rectangle, set in the Rect section, in the inspector." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:236 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:235 msgid "Margins on a CenterContainer set to the \"Full Rect\" anchor" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:238 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:237 msgid "" "Try to change the anchors or nest your Control nodes inside Containers: the " "margins will update. You'll rarely need to edit the margins manually. Always " @@ -10420,11 +10875,11 @@ msgid "" "menu? Use the VBoxContainer. More on these below." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:247 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:246 msgid "Use size tags to change how UI elements fill the available space" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:249 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:248 msgid "" "Every control node has Size Flags. They tell containers how the UI elements " "should scale. If you add the \"Fill\" flag to the Horizontal or Vertical " @@ -10435,33 +10890,33 @@ msgid "" "over the node and resize it automatically." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:259 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:258 msgid "3 UI elements in an HBoxContainer, they align horizontally" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:261 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:260 msgid "" "The \"Expand\" flag lets the UI element take all the space it can, and push " "against its siblings. Its bounding rectangle will grow against the edges of " "its parent, or until it's blocked by another UI node." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:267 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:266 msgid "" "The same example as above, but the center node has the \"Expand\" size flag" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:270 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:269 msgid "" "You'll need some practice to understand the size tags, as their effect can " "change quite a bit depending on how you set up your interface." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:274 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:273 msgid "Arrange control nodes automatically with containers" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:276 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:275 msgid "" "Containers automatically arrange all children Control nodes including other " "containers in rows, columns, and more. Use them to add padding around your " @@ -10469,41 +10924,41 @@ msgid "" "containers update in the editor so you can see the effect instantly." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:282 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:281 msgid "" "Containers have a few special properties to control how they arrange UI " "elements. To change them, navigate down to the Custom Constants section in " "the Inspector." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:287 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:286 msgid "The 5 most useful containers" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:289 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:288 msgid "" "If you build tools, you might need all of the containers. But for most " "games, a handful will be enough:" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:292 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:291 msgid "MarginContainer, to add margins around part of the UI" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:293 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:292 msgid "CenterContainer, to center its children in its bounding box" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:294 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:293 msgid "" "VboxContainer and HboxContainer, to arrange UI elements in rows or columns" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:296 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:295 msgid "GridContainer, to arrange Controls nodes in a grid-like pattern" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:298 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:297 msgid "" "CenterContainer centers all its children inside of its bounding rectangle. " "It's one you typically use for title screens, if you want the options to " @@ -10512,12 +10967,12 @@ msgid "" "instead, they'll stack up." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:306 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:305 msgid "" "CenterContainer in action. The life bar centers inside its parent container." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:309 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:308 msgid "" "The MarginContainer adds a margin on any side of the child nodes. Add a " "MarginContainer that encompasses the entire viewport to add a separation " @@ -10527,11 +10982,11 @@ msgid "" "automatically." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:318 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:317 msgid "The MarginContainer adds a 40px margin around the Game User Interface" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:320 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:319 msgid "" "There are two BoxContainers: VBoxContainer and HBoxContainer. You cannot add " "the BoxContainer node itself, as it is a helper class, but you can use " @@ -10541,11 +10996,11 @@ msgid "" "content." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:329 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:328 msgid "The HBoxContainer horizontally aligns UI elements" msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:331 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:330 msgid "" "VBoxContainer automatically arranges its children into a column. It puts " "them one after the other. If you use the separation parameter, it will leave " @@ -10555,7 +11010,7 @@ msgid "" "from a script." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:338 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:337 msgid "" "The GridContainer lets you arrange UI elements in a grid-like pattern. You " "can only control the number of columns it has, and it will set the number of " @@ -10567,15 +11022,15 @@ msgid "" "respectively." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:349 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:348 msgid "A GridContainer with 2 columns. It sizes each column automatically." msgstr "" -#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:351 +#: ../../docs/getting_started/step_by_step/ui_introduction_to_the_ui_system.rst:350 msgid "" "Godot's UI system is complex, and has a lot more to offer. To learn how to " -"design more advanced interface, read `Design advanced UI with other Control " -"nodes `__." +"design more advanced interface, head to the :ref:`GUI section ` of the docs." msgstr "" #: ../../docs/getting_started/step_by_step/singletons_autoload.rst:4 @@ -10664,15 +11119,15 @@ msgid "" "with:" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:54 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:60 msgid "Or even simpler using the name directly:" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:61 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:73 msgid "Custom scene switcher" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:63 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:75 msgid "" "This short tutorial will explain how to make a scene switcher using " "autoload. For simple scene switching, the :ref:`SceneTree.change_scene() " @@ -10681,13 +11136,13 @@ msgid "" "switching between scenes." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:69 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:81 msgid "" "First download the template from here: :download:`autoload.zip `, then open it." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:72 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:84 msgid "" "Two scenes are present, scene_a.tscn and scene_b.tscn on an otherwise empty " "project. Each are identical and contain a button connected to a callback for " @@ -10696,21 +11151,21 @@ msgid "" "work." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:79 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:91 msgid "global.gd" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:81 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:93 msgid "" "First of all, create a global.gd script. The easy way to create a resource " "from scratch is from the new resource button in the inspector tab:" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:86 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:98 msgid "Save the script as `global.gd`:" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:90 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:102 msgid "" "The script should open in the script editor. The next step is to add it to " "AutoLoad list. Select Project > Project Settings from the menu, switch to " @@ -10718,11 +11173,11 @@ msgid "" "this file:" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:97 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:109 msgid "Now, whenever you run any of your scenes, the script is always loaded." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:99 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:111 msgid "" "Returning to our script, the current scene needs to be fetched in the " "`_ready()` function. Both the current scene and `global.gd` are children of " @@ -10730,18 +11185,18 @@ msgid "" "child of root is always the loaded scene." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:104 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:116 msgid "" "Note: Make sure that global.gd extends Node, otherwise it won't be loaded!" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:117 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:146 msgid "" "Next up is the function for changing the scene. This function frees the " "current scene and replaces it with the requested one." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:154 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:218 msgid "" "As mentioned in the comments above, we really want to avoid the situation of " "having the current scene being deleted while being used (code from functions " @@ -10751,25 +11206,25 @@ msgid "" "when no code from the current scene is running." msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:162 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:226 msgid "" "Finally, all that is left is to fill the empty functions in scene_a.gd and " "scene_b.gd:" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:172 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:247 #: ../../docs/development/cpp/core_types.rst:122 #: ../../docs/tutorials/math/vector_math.rst:276 msgid "and" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:181 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:267 msgid "" "Now if you run the project, you can switch between both scenes by pressing " "the button!" msgstr "" -#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:184 +#: ../../docs/getting_started/step_by_step/singletons_autoload.rst:270 msgid "" "To load scenes with a progress bar, check out the next tutorial, :ref:" "`doc_background_loading`" @@ -11033,37 +11488,37 @@ msgid "" "is to use load(), like this:" msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:91 +#: ../../docs/getting_started/step_by_step/resources.rst:101 msgid "" "The second way is more optimal, but only works with a string constant " "parameter, because it loads the resource at compile-time." msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:101 +#: ../../docs/getting_started/step_by_step/resources.rst:116 msgid "Loading scenes" msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:102 +#: ../../docs/getting_started/step_by_step/resources.rst:117 msgid "" "Scenes are also resources, but there is a catch. Scenes saved to disk are " "resources of type :ref:`PackedScene `. This means that " "the scene is packed inside a resource." msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:106 +#: ../../docs/getting_started/step_by_step/resources.rst:121 msgid "" "To obtain an instance of the scene, the method :ref:`PackedScene.instance() " "` must be used." msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:116 +#: ../../docs/getting_started/step_by_step/resources.rst:142 msgid "" "This method creates the nodes in the scene's hierarchy, configures them " "(sets all the properties) and returns the root node of the scene, which can " "be added to any other node." msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:120 +#: ../../docs/getting_started/step_by_step/resources.rst:146 msgid "" "The approach has several advantages. As the :ref:`PackedScene.instance() " "` function is pretty fast, adding extra content " @@ -11073,11 +11528,11 @@ msgid "" "are all shared between the scene instances." msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:129 +#: ../../docs/getting_started/step_by_step/resources.rst:155 msgid "Freeing resources" msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:131 +#: ../../docs/getting_started/step_by_step/resources.rst:157 msgid "" "Resource extends from :ref:`Reference `. As such, when a " "resource is no longer in use, it will automatically free itself. Since, in " @@ -11085,7 +11540,7 @@ msgid "" "when a node is removed or freed, all the children resources are freed too." msgstr "" -#: ../../docs/getting_started/step_by_step/resources.rst:140 +#: ../../docs/getting_started/step_by_step/resources.rst:166 msgid "" "Like any object in Godot, not just nodes, resources can be scripted, too. " "However, there isn't generally much of an advantage, as resources are just " @@ -15030,7 +15485,7 @@ msgid "" msgstr "" #: ../../docs/getting_started/step_by_step/scripting_continued.rst:151 -#: ../../docs/tutorials/gui/custom_gui_controls.rst:115 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:171 msgid "Notifications" msgstr "" @@ -15787,6 +16242,7 @@ msgid "" msgstr "" #: ../../docs/development/cpp/custom_resource_format_loaders.rst:14 +#: ../../docs/development/cpp/custom_godot_servers.rst:16 msgid "" "This guide assumes the reader knows how to create C++ modules and godot data " "types. If not, refer to this guide :ref:`doc_custom_modules_in_c++`." @@ -15808,7 +16264,10 @@ msgstr "" #: ../../docs/development/cpp/core_types.rst:234 #: ../../docs/development/cpp/custom_audiostreams.rst:23 #: ../../docs/development/cpp/custom_audiostreams.rst:119 -#: ../../docs/development/cpp/custom_audiostreams.rst:342 +#: ../../docs/development/cpp/custom_audiostreams.rst:356 +#: ../../docs/development/cpp/custom_godot_servers.rst:20 +#: ../../docs/development/cpp/custom_godot_servers.rst:279 +#: ../../docs/development/cpp/custom_godot_servers.rst:429 #: ../../docs/development/cpp/object_class.rst:31 #: ../../docs/development/cpp/object_class.rst:89 #: ../../docs/development/cpp/object_class.rst:251 @@ -15831,6 +16290,7 @@ msgstr "" #: ../../docs/development/cpp/custom_resource_format_loaders.rst:25 #: ../../docs/development/cpp/custom_modules_in_cpp.rst:22 #: ../../docs/development/cpp/custom_audiostreams.rst:31 +#: ../../docs/development/cpp/custom_godot_servers.rst:29 msgid "What for?" msgstr "" @@ -17098,6 +17558,7 @@ msgid "" msgstr "" #: ../../docs/development/cpp/core_types.rst:236 +#: ../../docs/development/cpp/custom_godot_servers.rst:282 msgid "" "`core/rid.h `__" msgstr "" @@ -17450,14 +17911,14 @@ msgstr "" #: ../../docs/development/cpp/custom_audiostreams.rst:25 #: ../../docs/development/cpp/custom_audiostreams.rst:121 -#: ../../docs/development/cpp/custom_audiostreams.rst:344 +#: ../../docs/development/cpp/custom_audiostreams.rst:358 msgid "" "`servers/audio/audio_stream.h `__" msgstr "" #: ../../docs/development/cpp/custom_audiostreams.rst:26 -#: ../../docs/development/cpp/custom_audiostreams.rst:345 +#: ../../docs/development/cpp/custom_audiostreams.rst:359 msgid "" "`scene/audio/audioplayer.cpp `__" @@ -17511,11 +17972,11 @@ msgid "" "memory allocation are forbidden." msgstr "" -#: ../../docs/development/cpp/custom_audiostreams.rst:228 +#: ../../docs/development/cpp/custom_audiostreams.rst:235 msgid "Resampling" msgstr "" -#: ../../docs/development/cpp/custom_audiostreams.rst:231 +#: ../../docs/development/cpp/custom_audiostreams.rst:238 msgid "" "Godot’s AudioServer currently uses 44100 Hz sample rate. When other sample " "rates are needed such as 48000, either provide one or use " @@ -17523,19 +17984,190 @@ msgid "" "resampling." msgstr "" -#: ../../docs/development/cpp/custom_audiostreams.rst:235 +#: ../../docs/development/cpp/custom_audiostreams.rst:242 msgid "" "Instead of overloading ``mix``, AudioStreamPlaybackResampled uses " "``_mix_internal`` to query AudioFrames and ``get_stream_sampling_rate`` to " "query current mix rate." msgstr "" -#: ../../docs/development/cpp/custom_audiostreams.rst:343 +#: ../../docs/development/cpp/custom_audiostreams.rst:357 msgid "" "`core/math/audio_frame.h `__" msgstr "" +#: ../../docs/development/cpp/custom_godot_servers.rst:4 +msgid "Custom Godot Servers" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:9 +msgid "" +"Godot implements multi threading as servers. Servers are daemons which " +"manages data, processes, and pushes the result. Server implements the " +"mediator pattern which interprets resource ID and process data for the " +"engine and other modules. In addition, the server claims ownership for its " +"RID allocations." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:22 +msgid "" +"`Why does Godot use Servers and RIDs? `__" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:24 +msgid "`Sigleton Pattern `__" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:26 +msgid "`Mediator Pattern `__" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:31 +msgid "Adding AI" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:32 +msgid "Adding a custom asynchronous threads" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:33 +msgid "Adding Input support" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:34 +msgid "Adding writing threads" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:35 +msgid "Adding custom VOIP protocol" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:36 +#: ../../docs/development/compiling/compiling_for_windows.rst:227 +msgid "etc." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:39 +msgid "Creating a Godot Server" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:41 +msgid "" +"At minimum, a server must to have: a static instance, sleep timer, thread " +"loop, initialize state, and cleanup." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:245 +msgid "Custom Managed Resource Data" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:247 +msgid "" +"Godot servers implement a mediator pattern. All data types inherit " +"``RID_Data``. `RID_Owner`` owns the object when ``make_rid`` is " +"called. Only during debug mode, RID_Owner maintains a list of RID. In " +"practice, RID is similar to writing object oriented C code." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:281 +msgid ":ref:`RID`" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:286 +msgid "Registering the class to GDScript" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:288 +msgid "" +"Server are allocated in ``register_types.cpp``. The constructor sets the " +"static instance and init creates the managed thread. ``unregister_types." +"cpp`` cleans up the server" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:292 +msgid "" +"Since Godot Server class creates an instance and binds it to a static " +"singleton, binding the class might not reference the correct instance. " +"Therefore, a dummy class must be created to reference the proper Godot " +"Server." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:296 +msgid "" +"In ``register_godotserver_types()``, ``Engine::get_singleton()-" +">add_singleton`` is used to register the dummy class to GDScript." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:338 +msgid "" +"`servers/register_server_types.cpp `__" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:341 +msgid "Bind methods" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:343 +msgid "" +"The dummy class binds singleton methods to gdscript. In most cases, the " +"dummy class methods wraps around." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:351 +msgid "Binding Signals" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:353 +msgid "" +"It is possible to emit signals to gdscript but calling the GDScript dummy " +"object." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:420 +msgid "MessageQueue" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:422 +msgid "" +"In order to send commands into scenetree, MessageQueue is a thread safe " +"buffer to queue set and call methods for other threads. To queue a command, " +"obtain the target object RID and use either push_call, push_set, or " +"push_notification to execute the desired behavior. Queue will be flushed " +"whenever either ``SceneTree::idle`` or ``SceneTree::iteration`` are executed." +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:431 +msgid "" +"`core/message_queue.cpp `__" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:434 +msgid "Summing it up" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:436 +msgid "Here is the GDScript sample code" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:469 +#: ../../docs/development/compiling/compiling_with_mono.rst:47 +msgid "Notes" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:471 +msgid "" +"Actual `Hilbert Hotel `__ is impossible" +msgstr "" + +#: ../../docs/development/cpp/custom_godot_servers.rst:473 +msgid "Connecting signal example code is pretty hacky" +msgstr "" + #: ../../docs/development/cpp/object_class.rst:4 msgid "Object class" msgstr "" @@ -17881,7 +18513,6 @@ msgid "Reference" msgstr "" #: ../../docs/development/cpp/inheritance_class_tree.rst:15 -#: ../../docs/tutorials/viewports/viewports.rst:146 msgid "Control" msgstr "" @@ -18211,10 +18842,6 @@ msgid "" "located in the ``bin`` subfolder, it becomes ``bin/godot``." msgstr "" -#: ../../docs/development/compiling/compiling_with_mono.rst:47 -msgid "Notes" -msgstr "" - #: ../../docs/development/compiling/compiling_with_mono.rst:48 msgid "" "**Do not** build normal binaries with ``mono_glue=no``. This option disables " @@ -18654,28 +19281,45 @@ msgid "" "relevant." msgstr "" +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:189 +msgid "Other build options" +msgstr "" + #: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:191 msgid "" +"There are several other build options that you can use to configure the way " +"Godot should be built (compiler, debug options, etc.) as well as the " +"features to include/disable." +msgstr "" + +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:195 +msgid "" +"Check the output of ``scons --help`` for details about each option for the " +"version you are willing to compile." +msgstr "" + +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:201 +msgid "" "Official export templates are downloaded from the Godot Engine site: " "`godotengine.org `__. However, you might want to " "build them yourself (in case you want newer ones, you are using custom " "modules, or simply don't trust your own shadow)." msgstr "" -#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:196 +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:206 msgid "" "If you download the official export templates package and unzip it, you will " "notice that most are just optimized binaries or packages for each platform:" msgstr "" -#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:219 +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:229 msgid "" "To create those yourself, just follow the instructions detailed for each " "platform in this same tutorial section. Each platform explains how to create " "its own template." msgstr "" -#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:223 +#: ../../docs/development/compiling/introduction_to_the_buildsystem.rst:233 msgid "" "If you are developing for multiple platforms, macOS is definitely the most " "convenient host platform for cross compilation, since you can cross-compile " @@ -20126,10 +20770,6 @@ msgstr "" msgid "Visual Studio 2015 is in the \"Microsoft Visual Studio 14.0\" folder." msgstr "" -#: ../../docs/development/compiling/compiling_for_windows.rst:227 -msgid "etc." -msgstr "" - #: ../../docs/development/compiling/compiling_for_windows.rst:246 msgid "" "After you create the shortcut, in the shortcut's properties, that you can " @@ -22460,7 +23100,7 @@ msgid "" "basics of the Git command line is *highly* recommended. There exist some " "graphical interfaces for Git, but they usually encourage users to take bad " "habits regarding the Git and PR workflow, and we therefore recommend not to " -"use them. In particular, we advise not to use Github's online editor for " +"use them. In particular, we advise not to use GitHub's online editor for " "code contributions (although it's tolerated for small fixes or documentation " "changes) as it enforces one commit per file and per modification, which " "quickly leads to PRs with an unreadable Git history (especially after peer " @@ -22481,26 +23121,26 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:53 msgid "" -"The *master* branch is where the development of the next major version " +"The ``master`` branch is where the development of the next major version " "occurs. As a development branch, it can be unstable and is not meant for use " "in production. This is where PRs should be done in priority." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:57 msgid "" -"The stable branches are named after their version, e.g. *3.0* and *2.1*. " -"They are used to backport bugfixes and enhancements from the *master* branch " -"to the currently maintained stable release (e.g. 3.0.2 or 2.1.5). As a rule " -"of thumb, the last stable branch is maintained until the next major version " -"(e.g. the *2.0* branch was maintained until the release of Godot 2.1). If " -"you want to make PRs against a maintained stable branch, you will have to " -"check if your changes are also relevant for the *master* branch." +"The stable branches are named after their version, e.g. ``3.0`` and ``2.1``. " +"They are used to backport bugfixes and enhancements from the ``master`` " +"branch to the currently maintained stable release (e.g. 3.0.2 or 2.1.5). As " +"a rule of thumb, the last stable branch is maintained until the next major " +"version (e.g. the ``2.0`` branch was maintained until the release of Godot " +"2.1). If you want to make PRs against a maintained stable branch, you will " +"have to check if your changes are also relevant for the ``master`` branch." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:65 msgid "" "There might be feature branches at time, usually meant to be merged into the " -"*master* branch at some time." +"``master`` branch at some time." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:69 @@ -22526,13 +23166,13 @@ msgid "" "You can then *clone* your fork, i.e. create a local copy of the online " "repository (in Git speak, the *origin remote*). If you haven't already, " "download Git from `its website `_ if you're using " -"Windows or Mac, if you're using Linux install it through your package " -"manager." +"Windows or macOS, or install it through your package manager if you're using " +"Linux." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:88 msgid "" -"if you are on Windows open Git Bash to type commands. Mac and linux users " +"If you are on Windows, open Git Bash to type commands. macOS and Linux users " "can use their respective terminals." msgstr "" @@ -22560,10 +23200,10 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:115 msgid "" -"This will create a reference named *upstream* pointing to the original " +"This will create a reference named ``upstream`` pointing to the original " "godotengine/godot repository. This will be useful when you want to pull new " -"commits from its *master* branch to update your fork. You have another " -"*remote* reference named *origin*, which points to your fork." +"commits from its ``master`` branch to update your fork. You have another " +"``remote`` reference named ``origin``, which points to your fork." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:120 @@ -22602,9 +23242,9 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:142 msgid "" -"By default, the ``git clone`` should have put you on the *master* branch of " -"your fork (*origin*). To start your own feature development, we will create " -"a feature branch:" +"By default, the ``git clone`` should have put you on the ``master`` branch " +"of your fork (``origin``). To start your own feature development, we will " +"create a feature branch:" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:154 @@ -22612,7 +23252,7 @@ msgid "This command is equivalent:" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:161 -msgid "If you want to go back to the *master* branch, you'd use:" +msgid "If you want to go back to the ``master`` branch, you'd use:" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:167 @@ -22627,17 +23267,17 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:180 msgid "" -"This would not be needed the first time, just after you forked the upstream " -"repository. However, the next time you want to work on something, you will " -"notice that your fork's *master* is several commits behind the upstream " -"*master* branch: pull requests from other contributors would have been " +"This would not be needed the first time (just after you forked the upstream " +"repository). However, the next time you want to work on something, you will " +"notice that your fork's ``master`` is several commits behind the upstream " +"``master`` branch: pull requests from other contributors would have been " "merged in the meantime." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:186 msgid "" "To ensure there won't be conflicts between the feature you develop and the " -"current upstream *master* branch, you will have to update your branch by " +"current upstream ``master`` branch, you will have to update your branch by " "*pulling* the upstream branch." msgstr "" @@ -22647,13 +23287,13 @@ msgid "" "\"merge commit\", and you will soon hear from fellow contributors that those " "are not wanted in PRs. Then how to update the branch without creating a " "merge commit? You will have to use the ``--rebase`` option, so that your " -"local commits are replayed on top of the updated upstream *master* branch. " +"local commits are replayed on top of the updated upstream ``master`` branch. " "It will effectively modify the Git history of your branch, but that is for " "the greater good." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:201 -msgid "Then command that you should (almost) always use is there:" +msgid "Therefore, the command that you should (almost) always use is:" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:208 @@ -22671,7 +23311,7 @@ msgid "" "By default, those changes are *unstaged*. The staging area is a layer " "between your working directory (where you make your modifications) and the " "local git repository (the commits and all the metadata in the ``.git`` " -"folder). To bring changes from the working directory to the git repository, " +"folder). To bring changes from the working directory to the Git repository, " "you need to *stage* them with the ``git add`` command, and then to commit " "them with the ``git commit`` command." msgstr "" @@ -22718,9 +23358,9 @@ msgstr "" msgid "" "``git commit`` will commit the staged files. It will open a text editor (you " "can define the one you want to use with the ``GIT_EDITOR`` environment " -"variable or the ``core.editor`` setting in your Git config) to let you write " -"a commit log. You can use ``git commit -m \"Cool commit log\"`` to write the " -"log directly." +"variable or the ``core.editor`` setting in your Git configuration) to let " +"you write a commit log. You can use ``git commit -m \"Cool commit log\"`` to " +"write the log directly." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:239 @@ -22747,8 +23387,8 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:279 msgid "" -"With this, we should have two new commits in our *better-project-manager* " -"branch which were not in the *master* branch. They are still only local " +"With this, we should have two new commits in our ``better-project-manager`` " +"branch which were not in the ``master`` branch. They are still only local " "though, the remote fork does not know about them, nor does the upstream repo." msgstr "" @@ -22784,10 +23424,10 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:310 msgid "" -"When you load your fork's branch on GitHub, you should see a line saying " -"\"This branch is 2 commits ahead of godotengine:master.\" (and potentially " -"some commits behind, if your *master* branch was out of sync with the " -"upstream *master* branch." +"When you load your fork's branch on GitHub, you should see a line saying *" +"\"This branch is 2 commits ahead of godotengine:master.\"* (and potentially " +"some commits behind, if your ``master`` branch was out of sync with the " +"upstream ``master`` branch." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:317 @@ -22803,7 +23443,7 @@ msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:323 msgid "" "Use an explicit title for the PR and put the necessary details in the " -"comment area. You can drag and drop screenshots, gifs or zipped projects if " +"comment area. You can drag and drop screenshots, GIFs or zipped projects if " "relevant, to showcase what your work implements. Click \"Create a pull " "request\", and tadaa!" msgstr "" @@ -22894,9 +23534,9 @@ msgstr "" msgid "" "You could have avoided this rebase by using ``git commit --amend`` when " "fixing the typo. This command will write the staged changes directly into " -"the *last* commit (*HEAD*), instead of creating a new commit like we did in " -"this example. So it is equivalent to what we did with a new commit and then " -"a rebase to mark it as \"fixup\"." +"the *last* commit (``HEAD``), instead of creating a new commit like we did " +"in this example. So it is equivalent to what we did with a new commit and " +"then a rebase to mark it as \"fixup\"." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:411 @@ -22922,19 +23562,19 @@ msgid "" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:438 -msgid "Deleting a Git Branch" +msgid "Deleting a Git branch" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:440 msgid "" -"After your pull request gets merged there's one last thing you should do, " -"delete your Git branch for the PR. There wont be issues if you don't delete " +"After your pull request gets merged, there's one last thing you should do: " +"delete your Git branch for the PR. There won't be issues if you don't delete " "your branch, but it's good practice to do so. You'll need to do this twice, " "once for the local branch and another for the remote branch on GitHub." msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:445 -msgid "To delete our better project manager branch locally use this command:" +msgid "To delete our better project manager branch locally, use this command:" msgstr "" #: ../../docs/community/contributing/pr_workflow.rst:451 @@ -25373,7 +26013,7 @@ msgid "" msgstr "" #: ../../docs/tutorials/io/encrypting_save_games.rst:73 -msgid "Note that ``OS.get_unique_ID()`` only works on iOS and Android." +msgid "Note that ``OS.get_unique_id()`` only works on iOS and Android." msgstr "" #: ../../docs/tutorials/io/encrypting_save_games.rst:75 @@ -25550,7 +26190,7 @@ msgid "" msgstr "" #: ../../docs/tutorials/viewports/viewports.rst:28 -#: ../../docs/tutorials/gui/custom_gui_controls.rst:81 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:112 msgid "Input" msgstr "" @@ -25588,7 +26228,7 @@ msgstr "" #: ../../docs/tutorials/viewports/viewports.rst:53 #: ../../docs/tutorials/viewports/viewports.rst:61 -#: ../../docs/tutorials/viewports/viewports.rst:148 +#: ../../docs/tutorials/viewports/viewports.rst:159 msgid "Viewport" msgstr "" @@ -25681,45 +26321,55 @@ msgid "" "following API:" msgstr "" -#: ../../docs/tutorials/viewports/viewports.rst:130 +#: ../../docs/tutorials/viewports/viewports.rst:137 msgid "" -"After a frame or two (check _process()), the capture will be ready, get it " -"back by using:" +"But if you use this in _ready() or from the very first frame of the " +"viewport's initialization you will get an empty texture cause there is " +"nothing to get as texture. You can deal with it using (for example):" msgstr "" -#: ../../docs/tutorials/viewports/viewports.rst:137 +#: ../../docs/tutorials/viewports/viewports.rst:148 msgid "" "If the returned image is empty, capture still didn't happen, wait a little " "more, as this API is asynchronous." msgstr "" -#: ../../docs/tutorials/viewports/viewports.rst:141 +#: ../../docs/tutorials/viewports/viewports.rst:152 msgid "Sub-viewport" msgstr "" -#: ../../docs/tutorials/viewports/viewports.rst:143 +#: ../../docs/tutorials/viewports/viewports.rst:154 msgid "" -"If the viewport is a child of a control, it will become active and display " -"anything it has inside. The layout is something like this:" -msgstr "" - -#: ../../docs/tutorials/viewports/viewports.rst:150 -msgid "The viewport will cover the area of its parent control completely." -msgstr "" - -#: ../../docs/tutorials/viewports/viewports.rst:155 -msgid "Render target" +"If the viewport is a child of a :ref:`ViewportContainer " +"`, it will become active and display anything it " +"has inside. The layout is something like this:" msgstr "" #: ../../docs/tutorials/viewports/viewports.rst:157 +msgid "ViewportContainer" +msgstr "" + +#: ../../docs/tutorials/viewports/viewports.rst:161 msgid "" -"To set as a render target, just toggle the \"render target\" property of the " -"viewport to enabled. Note that whatever is inside will not be visible in the " -"scene editor. To display the contents, the render target texture must be " -"used. This can be requested via code using (for example):" +"The viewport will cover the area of its parent control completely, if " +"stretch is set to true in Viewport Container. But you will have to setup the " +"Viewport Size to get the the appropriate part of the Viewport. And Viewport " +"Container can not be smaller than the size of the Viewport." msgstr "" #: ../../docs/tutorials/viewports/viewports.rst:168 +msgid "Render target" +msgstr "" + +#: ../../docs/tutorials/viewports/viewports.rst:170 +msgid "" +"To set as a render target, just toggle the \"render target\" property of the " +"viewport to enabled. Note that whatever is inside will not be visible in the " +"scene editor. To display the contents, the method remains the same. This can " +"be requested via code using (for example):" +msgstr "" + +#: ../../docs/tutorials/viewports/viewports.rst:181 msgid "" "By default, re-rendering of the render target happens when the render target " "texture has been drawn in a frame. If visible, it will be rendered, " @@ -25727,30 +26377,11 @@ msgid "" "(once), or always render, no matter if visible or not." msgstr "" -#: ../../docs/tutorials/viewports/viewports.rst:173 -msgid "" -"A few classes are created to make this easier in most common cases inside " -"the editor:" +#: ../../docs/tutorials/viewports/viewports.rst:186 +msgid "``TODO: Review the doc, change outdated and add more images.``" msgstr "" -#: ../../docs/tutorials/viewports/viewports.rst:176 -msgid ":ref:`ViewportSprite ` (for 2D)." -msgstr "" - -#: ../../docs/tutorials/viewports/viewports.rst:177 -msgid "ViewportQuad (for 3D)." -msgstr "" - -#: ../../docs/tutorials/viewports/viewports.rst:178 -msgid "ViewportFrame (for GUI)." -msgstr "" - -#: ../../docs/tutorials/viewports/viewports.rst:180 -msgid "" -"*TODO: Review the doc, ViewportQuad and ViewportFrame don't exist in 2.0.*" -msgstr "" - -#: ../../docs/tutorials/viewports/viewports.rst:182 +#: ../../docs/tutorials/viewports/viewports.rst:188 msgid "" "Make sure to check the viewport demos! Viewport folder in the demos archive " "available to download, or https://github.com/godotengine/godot-demo-projects/" @@ -36739,28 +37370,29 @@ msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:13 msgid "" -"Skeleton node can be directly added anywhere you want on scene. Usually mesh " -"is a child of Skeleton, as it easier to manipulate this way, as Transforms " -"within skeleton are relative to where Skeleton is. But you can specify " -"Skeleton node in every MeshInstance." +"The Skeleton node can be directly added anywhere you want on a scene. " +"Usually mesh is a child of Skeleton, as it easier to manipulate this way, as " +"Transforms within a skeleton are relative to where the Skeleton is. But you " +"can specify a Skeleton node in every MeshInstance." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:18 msgid "" "Being obvious, Skeleton is intended to deform meshes, and consists of " -"structures called \"bones\". Each \"bone\" is represented as Transform, " +"structures called \"bones\". Each \"bone\" is represented as a Transform, " "which is applied to a group of vertices within a mesh. You can directly " -"control a group of vertices from Godot. For that please reference :ref:" -"`class_MeshDataTool` class, method :ref:`set_vertex_bones " +"control a group of vertices from Godot. For that please reference the :ref:" +"`class_MeshDataTool` class and its method :ref:`set_vertex_bones " "`. This class is very powerful." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:25 msgid "" -"The \"bones\" are organized in hierarchy, every bone, except for root " -"bone(s) have parent. Every bone have associated name you can use to refer to " -"it (e.g. \"root\" or \"hand.L\", etc.). Also bones are all numbered, these " -"numbers are bone IDs. Bone parents are referred by their numbered IDs." +"The \"bones\" are organized hierarchically, every bone, except for root " +"bone(s) have a parent. Every bone has an associated name you can use to " +"refer to it (e.g. \"root\" or \"hand.L\", etc.). Also all bones are " +"numbered, these numbers are bone IDs. Bone parents are referred by their " +"numbered IDs." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:31 @@ -36769,8 +37401,8 @@ msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:39 msgid "" -"This scene is imported from Blender. It contains arm mesh with 2 bones - " -"upperarm and lowerarm, with lowerarm parented to upperarm." +"This scene is imported from Blender. It contains an arm mesh with 2 bones - " +"upperarm and lowerarm, with the lowerarm bone parented to the upperarm." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:43 @@ -36779,96 +37411,100 @@ msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:45 msgid "" -"You can view Godot internal help for descriptions of every function. " +"You can view Godots internal help for descriptions of all functions. " "Basically all operations on bones are done using their numeric ID. You can " -"convert from name to numeric ID and vise versa." +"convert from a name to a numeric ID and vice versa." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:49 msgid "" -"**To find number of bones in skeleton we use get_bone_count() function**" +"**To find the number of bones in a skeleton we use the get_bone_count() " +"function:**" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:64 -msgid "**to find ID for the bone, use find_bone() function**" +msgid "**To find the ID of a bone, use the find_bone() function:**" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:76 msgid "" -"Now, we want to do something interesting with ID except for printing it. " -"Also, we might need additional information - to find bone parents to " -"complete chain, etc. This all is done with get/set_bone\\_\\* functions." +"Now, we want to do something interesting with the ID, not just printing it. " +"Also, we might need additional information - finding bone parents to " +"complete chains, etc. This is done with the get/set_bone\\_\\* functions." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:80 -msgid "**To find bone parent we use get_bone_parent(id) function**" +msgid "" +"**To find the parent of a bone we use the get_bone_parent(id) function:**" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:94 msgid "" -"Bone transforms is the thing why we're here at all. There are 3 kind of " +"The bone transforms are the things of our interest here. There are 3 kind of " "transforms - local, global, custom." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:97 -msgid "**To find bone local Transform we use get_bone_pose(id) function**" +msgid "" +"**To find the local Transform of a bone we use get_bone_pose(id) function:**" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:113 msgid "" -"So we see 3x4 matrix there, with first column of 1s. What can we do about " -"that? It is a Transform, so we can do everything we can do with Transform, " -"basically translate, rotate and scale. Also we can multiply transforms to " -"have complex transforms. Remember, \"bones\" in Godot are just Transforms " -"over a group of vertices. Also we can copy Transforms of other objects " -"there. So lets rotate our \"upperarm\" bone:" +"So we get a 3x4 matrix there, with the first column filled with 1s. What can " +"we do with this matrix? It is a Transform, so we can do everything we can do " +"with Transforms, basically translate, rotate and scale. We could also " +"multiply transforms to have more complex transforms. Remember, \"bones\" in " +"Godot are just Transforms over a group of vertices. We could also copy " +"Transforms of other objects there. So lets rotate our \"upperarm\" bone:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:141 msgid "" "Now we can rotate individual bones. The same happens for scale and translate " -"- try these on your own and see results." +"- try these on your own and check the results." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:144 msgid "" -"What we used now was local pose. By default all bones are not modified. But " -"this Transform tells us nothing about relationship between bones. This " -"information is needed for quite a number of tasks. How can we get it? Here " -"comes global transform:" +"What we used here was the local pose. By default all bones are not modified. " +"But this Transform tells us nothing about the relationship between bones. " +"This information is needed for quite a number of tasks. How can we get it? " +"Here the global transform comes into play:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:149 msgid "" -"**To find bone global Transform we use get_bone_global_pose(id) function**" +"**To find the bone global Transform we use get_bone_global_pose(id) function:" +"**" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:152 -msgid "We will find global Transform for lowerarm bone:" +msgid "Let's find the global Transform for the lowerarm bone:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:168 msgid "" -"As you see, this transform is not zeroed. While being called global, it is " -"actually relative to Skeleton origin. For root bone, origin is always at 0 " -"if not modified. Lets print origin for our lowerarm bone:" +"As you can see, this transform is not zeroed. While being called global, it " +"is actually relative to the Skeleton origin. For a root bone, origin is " +"always at 0 if not modified. Lets print the origin for our lowerarm bone:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:186 msgid "" "You will see a number. What does this number mean? It is a rotation point of " -"Transform. So it is base part of the bone. In Blender you can go to Pose " +"the Transform. So it is base part of the bone. In Blender you can go to Pose " "mode and try there to rotate bones - they will rotate around their origin. " -"But what about tip? We can't know things like bone length, which we need for " -"many things, without knowing tip location. For all bones in chain except for " -"last one we can calculate tip location - it is simply a child bone origin. " -"Yes, there are situations when this is not true, for non-connected bones. " -"But that is OK for us for now, as it is not important regarding Transforms. " -"But the leaf bone tip is nowhere to be found. Leaf bone is a bone without " -"children. So you don't have any information about its tip. But this is not a " -"showstopper. You can overcome this by either adding extra bone to the chain " -"or just calculating leaf bone length in Blender and store the value in your " -"script." +"But what about the bone tip? We can't know things like the bone length, " +"which we need for many things, without knowing the tip location. For all " +"bones in a chain except for the last one we can calculate the tip location - " +"it is simply a child bone's origin. Yes, there are situations when this is " +"not true, for non-connected bones. But that is OK for us for now, as it is " +"not important regarding Transforms. But the leaf bone tip is nowhere to be " +"found. A leaf bone is a bone without children. So you don't have any " +"information about its tip. But this is not a showstopper. You can overcome " +"this by either adding an extra bone to the chain or just calculating the " +"length of the leaf bone in Blender and storing the value in your script." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:202 @@ -36877,8 +37513,8 @@ msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:204 msgid "" -"Now as you know basics we can apply these to make full FK-control of our arm " -"(FK is forward-kinematics)" +"Now as you know the basics we can apply these to make full FK-control of our " +"arm (FK is forward-kinematics)" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:207 @@ -36903,16 +37539,16 @@ msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:223 msgid "" -"Set up Camera so that arm is properly visible. Rotate DirectionLight so that " -"arm is properly lit while in scene play mode." +"Set up the Camera so that the arm is properly visible. Rotate DirectionLight " +"so that the arm is properly lit while in scene play mode." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:226 -msgid "Now we need to create new script under main:" +msgid "Now we need to create a new script under main:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:228 -msgid "First we setup parameters:" +msgid "First we define the setup parameters:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:235 @@ -36920,7 +37556,7 @@ msgid "Now we need to setup a way to change them. Let us use keys for that." msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:237 -msgid "Please create 7 actions under project settings:" +msgid "Please create 7 actions under project settings -> Input Map:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:239 @@ -36963,14 +37599,14 @@ msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:323 msgid "" -"Pressing keys 1/2 select upperarm/lowerarm, select axis by pressing x, y, z, " -"rotate using numpad \"+\"/\"-\"" +"Pressing keys 1/2 selects upperarm/lowerarm, select the axis by pressing x, " +"y, z, rotate using numpad \"+\"/\"-\"" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:326 msgid "" "This way you fully control your arm in FK mode using 2 bones. You can add " -"additional bones and/or improve \"feel\" of the interface by using " +"additional bones and/or improve the \"feel\" of the interface by using " "coefficients for the change. I recommend you play with this example a lot " "before going to next part." msgstr "" @@ -36980,7 +37616,7 @@ msgid "You can clone the demo code for this chapter using" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:338 -msgid "Or you can browse it using web-interface:" +msgid "Or you can browse it using the web-interface:" msgstr "" #: ../../docs/tutorials/3d/working_with_3d_skeletons.rst:340 @@ -37396,22 +38032,1372 @@ msgid "" "variables." msgstr "" +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:4 +msgid "Part 6" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:7 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:7 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:67 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:7 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:7 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:7 +msgid "Part Overview" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:9 +msgid "" +"In this part we're going to add a main menu and pause menu, add a respawn " +"system for the player, and change/move the sound system so we can use it " +"from any script." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:12 +msgid "" +"This is the last part of the FPS tutorial, by the end of this you will have " +"a solid base to build amazing FPS games with Godot!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:16 +msgid "" +"You are assumed to have finished :ref:`doc_fps_tutorial_part_five` before " +"moving on to this part of the tutorial." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:18 +msgid "" +"The finished project from :ref:`doc_fps_tutorial_part_four` will be the " +"starting project for part 6" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:20 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:22 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:17 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:21 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:17 +msgid "Let's get started!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:23 +msgid "Adding the main menu" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:25 +msgid "" +"First, open up ``Main_Menu.tscn`` and take a look at how the scene is set up." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:27 +msgid "" +"The main menu is broken up into three different panels, each representing a " +"different 'screen' of our main menu." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:30 +msgid "" +"The ``Background_Animation`` node is just so the background of the menu is a " +"bit more interesting than a solid color. It's just a camera looking around " +"the skybox, nothing fancy." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:33 +msgid "" +"Feel free to expand all of the nodes and see how their set up. Just remember " +"to keep only ``Start_Menu`` visible when you're done, as that's the screen " +"we want to show first when we enter the main menu." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:36 +msgid "" +"Select ``Main_Menu`` (the root node) and create a new script called " +"``Main_Menu.gd``. Add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:123 +msgid "" +"Most of the code here relates to making UIs, which is really outside of the " +"purpose of this tutorial series. **We're only going to look at the UI " +"related code briefly.**" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:126 +msgid "" +"See :ref:`doc_ui_main_menu` and the tutorials following for better ways to " +"make GUIs and UIs!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:128 +msgid "Let's look at the global variables first." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:130 +msgid "" +"``start_menu``: A variable to hold the ``Start_Menu`` :ref:`Panel " +"`." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:131 +msgid "" +"``level_select_menu``: A variable to hold the ``Level_Select_Menu`` :ref:" +"`Panel `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:132 +msgid "" +"``options_menu``: A variable to hold the ``Options_Menu`` :ref:`Panel " +"`." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:133 +msgid "" +"``testing_area_scene``: The path to the ``Testing_Area.tscn`` file, so we " +"can change to it from this scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:134 +msgid "" +"``space_level_scene``: The path to the ``Space_Level.tscn`` file, so we can " +"change to it from this scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:135 +msgid "" +"``ruins_level_scene``: The path to the ``Ruins_Level.tscn`` file, so we can " +"change to it from this scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:137 +msgid "" +"You'll have to set the paths to the correct files in the editor before " +"testing this script! Otherwise it will not work!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:141 +msgid "Now let's go over ``_ready``" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:143 +msgid "" +"First we get all of the :ref:`Panel ` nodes and assign them to " +"the proper variables." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:145 +msgid "" +"Next we connect all of the buttons ``pressed`` signals to their respective " +"``[panel_name_here]_button_pressed`` functions." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:147 +msgid "" +"We then set the mouse mode to ``MOUSE_MODE_VISIBLE`` to ensure whenever we " +"return to this scene our mouse will be visible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:149 +msgid "" +"Then we get a singleton, called ``Globals``. We then set the values for the :" +"ref:`HSlider ` nodes so their values line up with the mouse " +"and joypad sensitivity in the singleton." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:152 +msgid "" +"We have not made the ``Globals`` singleton yet, so don't worry! We're going " +"to make it soon!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:156 +msgid "In ``start_menu_pressed``, we check to see which button is pressed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:158 +msgid "" +"Based on the button pressed, we either change the currently visible panel, " +"quit the application, or open the Godot engine website." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:162 +msgid "" +"In ``level_select_menu_button_pressed``, we check to see which button is " +"pressed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:164 +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:175 +msgid "" +"If the ``back`` button has been pressed, we change the currently visible " +"panels so we return to the main menu." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:166 +msgid "" +"If one of the scene changing buttons are pressed, we fist call " +"``set_mouse_and_joypad_sensitivity`` so our singleton has the values from " +"the :ref:`HSlider ` nodes. Then we tell the singleton to " +"change nodes using it's ``load_new_scene`` function, passing in the file " +"path of the scene we're wanting to change to." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:169 +msgid "Don't worry about the singleton, we'll get there soon!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:173 +msgid "" +"In ``options_menu_button_pressed``, we check to see which button is pressed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:177 +msgid "" +"If the ``fullscreen`` button is pressed we toggle the :ref:`OS `'s " +"full screen mode by setting it to the flipped version of it's current value." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:179 +msgid "" +"If the ``vsync`` button is pressed we set the :ref:`OS `'s Vsync " +"based on the state of the Vsync check button." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:183 +msgid "Finally, lets take a look at ``set_mouse_and_joypad_sensitivity``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:185 +msgid "" +"First we get the ``Globals`` singleton and assign it to a local variable." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:187 +msgid "" +"We then set the ``mouse_sensitivity`` and ``joypad_sensitvity`` variables to " +"the values in their respective :ref:`HSlider ` node " +"counterparts." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:190 +msgid "Making the ``Globals`` singleton" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:192 +msgid "" +"Now, for this all to work we really need to make the ``Globals`` singleton. " +"Make a new script in the ``Script`` tab and call it ``Globals.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:194 +msgid "Add the following to ``Globals.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:209 +msgid "" +"As you can see, it's really quite small and simple. As this part progresses " +"we will keeping adding complexities to ``Global.gd``, but for now all it " +"really is doing is holding two variables for us, and abstracting how we " +"change scenes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:212 +msgid "" +"``mouse_sensitivity``: The current sensitivity for our mouse, so we can load " +"it in ``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:213 +msgid "" +"``joypad_sensitivity``: The current sensitivity for our joypad, so we can " +"load it in ``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:215 +msgid "" +"Right now all we're using ``Globals.gd`` for is a way to carry variables " +"across scenes. Because the sensitivity for our mouse and joypad are stored " +"in ``Globals.gd``, any changes we make in one scene (like ``Main_Menu``) " +"effect the sensitivity for our player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:218 +msgid "" +"All we're doing in ``load_new_scene`` is calling :ref:`SceneTree " +"`'s ``change_scene`` function, passing in the scene path " +"given in ``load_new_scene``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:220 +msgid "" +"That's all of the code needed for ``Globals.gd`` right now! Before we can " +"test the main menu, we first need to set ``Globals.gd`` as an autoload " +"script." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:222 +msgid "Open up the project settings and click the ``AutoLoad`` tab." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:226 +msgid "" +"Then select the path to ``Globals.gd`` in the ``Path`` field by clicking the " +"button beside it. Make sure the name in the ``Node Name`` field is " +"``Globals``. If you have everything like the picture above, then press " +"``Add``!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:229 +msgid "" +"This will make ``Globals.gd`` a singleton/autoload script, which will allow " +"us to access it from anywhere in any scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:231 +msgid "" +"For more information on singleton/autoload scripts, see :ref:" +"`doc_singletons_autoload`." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:233 +msgid "" +"Now that ``Globals.gd`` is a singleton/autoload script, you can test the " +"main menu!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:235 +msgid "" +"You may also want to change the main scene from ``Testing_Area.tscn`` to " +"``Main_Menu.tscn`` so when we export the game we start at the main menu. You " +"can do this through the project settings, under the ``General`` tab. Then in " +"the ``Application`` category, click the ``Run`` subcategory and you can " +"change the main scene by changing the value in ``Main Scene``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:239 +msgid "" +"You'll have to set the paths to the correct files in ``Main_Menu`` in the " +"editor before testing the main menu! Otherwise you will not be able to " +"change scenes from the level select menu/screen." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:243 +msgid "Adding the debug menu" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:245 +msgid "" +"Now let's add a simple debugging scene so we can track things like FPS in " +"game. Open up ``Debug_Display.tscn``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:247 +msgid "" +"You can see it's a :ref:`Panel ` positioned in the top right " +"corner of the screen. It has three :ref:`Labels `, one for " +"displaying the FPS the game is running at, one for showing what OS the game " +"is running on, and a label for showing the Godot version the game is running " +"with." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:250 +msgid "" +"Let's add the code needed to fill these :ref:`Labels `. Select " +"``Debug_Display`` and create a new script called ``Debug_Display.gd``. Add " +"the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:263 +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:919 +msgid "Let's go over what this script does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:267 +msgid "" +"In ``_ready`` we set the ``OS_Label``'s text to the name provided in :ref:" +"`OS ` using the ``get_name`` function. This will return the name " +"of the OS (or Operating System) that Godot was compiled for. For example, " +"when you are running Windows it will return ``Windows``, while when you are " +"running Linux it will return ``X11``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:271 +msgid "" +"Then we set the ``Engine_Label``'s text to the version info provided by " +"``Engine.get_version_info``. ``Engine.get_version_info`` returns a " +"dictionary full of useful information about the version Godot is currently " +"running with. We only care for the string version for the purposes of this " +"display, so we get the string and assign that as the ``text`` in " +"``Engine_Label``. See :ref:`Engine ` for more information on " +"the values ``get_version_info`` returns." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:275 +msgid "" +"In ``_process`` we set the text of the ``FPS_Label`` to ``Engine." +"get_frames_per_second``, but because ``get_frames_per_second`` returns a " +"int, we have to cast it to a string using ``str`` before we can add it to " +"our label." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:280 +msgid "" +"Now let's jump back to ``Main_Menu.gd`` and change the following in " +"``options_menu_button_pressed``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:287 +msgid "to this instead:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:294 +msgid "" +"This will call a new function in our singleton called ``set_debug_display``, " +"so let's add that next!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:298 +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:386 +msgid "Open up ``Globals.gd`` and add the following global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:312 +msgid "``canvas_layer``: A canvas layer so our GUI/UI is always drawn on top." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:313 +msgid "``DEBUG_DISPLAY``: The debug display scene we worked on earlier." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:314 +msgid "" +"``debug_display``: A variable to hold the debug display when there is one." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:316 +msgid "" +"Now that we have our global variables defined, we need to add a few lines to " +"ready so we have a canvas layer to use in ``canvas_layer``. Change " +"``_ready`` to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:325 +msgid "" +"Now in ``_ready`` we're creating a new canvas layer and adding it as a child " +"of the autoload script." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:327 +msgid "" +"The reason we're adding a :ref:`CanvasLayer ` is so all " +"of our GUI and UI nodes we instance/spawn in ``Globals.gd`` are always drawn " +"on top of everything else." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:330 +msgid "" +"When adding nodes to a singleton/autoload, you have to be careful not to " +"lose reference to any of the child nodes. This is because nodes will not be " +"freed/destroyed when you change scene, meaning you can run into memory " +"problems if you are instancing/spawning lots of nodes and are not freeing " +"them." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:336 +msgid "Now we just need to add ``set_debug_display`` to ``Globals.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:350 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:506 +msgid "Let's go over what's happening." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:352 +msgid "" +"First we check to see if we're trying to turn on the debug display, or turn " +"it off." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:354 +msgid "" +"If we are turning off the display, we then check to see if ``debug_display`` " +"is not equal to ``null``. If ``debug_display`` is not equal to ``null``, " +"then we most have a debug display currently active. If we have a debug " +"display active, we free it using ``queue_free`` and then assign " +"``debug_display`` to ``null``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:357 +msgid "" +"If we are turning on the display, we then check to make sure we do not " +"already have a debug display active. We do this by making sure " +"``debug_display`` is equal to ``null``. If ``debug_display`` is ``null``, we " +"instance a new ``DEBUG_DISPLAY_SCENE``, and add it as a child of " +"``canvas_layer``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:362 +msgid "" +"With that done, we can now toggle the debug display on and off by switching " +"the :ref:`CheckButton ` in the ``Options_Menu`` panel. Go " +"give it a try!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:364 +msgid "" +"Notice how the debug display stays even when you change scenes from the " +"``Main_Menu.tscn`` to another scene (like ``Testing_Area.tscn``). This is " +"the beauty of instancing/spawning nodes in a singleton/autoload and adding " +"them as children to the singleton/autoload. Any of the nodes added as " +"children of the singleton/autoload will stay for as long as the game is " +"running, without any additional work on our part!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:369 +msgid "Adding a pause menu" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:371 +msgid "" +"Let's add a pause menu so we can return to the main menu when we press the " +"``ui_cancel`` action." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:373 +msgid "Open up ``Pause_Popup.tscn``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:375 +msgid "" +"Notice how the root node in ``Pause_Popup`` is a :ref:`WindowDialog " +"`. :ref:`WindowDialog ` inherits " +"from :ref:`Popup `, which means :ref:`WindowDialog " +"` can act like a popup." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:378 +msgid "" +"Select ``Pause_Popup`` and scroll down all the way till you get to the " +"``Pause`` menu in the inspector. Notice how the pause mode is set to " +"``process`` instead of ``inherit`` like it is normally set by default. This " +"makes it where it will continue to process even when the game is paused, " +"which we need in order to interact with the UI elements." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:382 +msgid "" +"Now that we've looked at how ``Pause_Popup.tscn`` is set up, lets write the " +"code to make it work. Normally we'd attach a script to the root node of the " +"scene, ``Pause_Popup`` in this case, but since we'll be needed to receive a " +"couple signals in ``Globals.gd``, we'll write all of the code for the pop up " +"there." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:394 +msgid "``MAIN_MENU_PATH``: The path to the main menu scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:395 +msgid "``POPUP_SCENE``: The pop up scene we looked at earlier." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:396 +msgid "``popup``: A variable to hold the pop up scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:398 +msgid "" +"Now we need to add ``_process`` to ``Globals.gd`` so we can respond when the " +"``ui_cancel`` action is pressed. Add the following to ``_process``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:419 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:360 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:411 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:359 +msgid "Let's go over what's happening here." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:423 +msgid "" +"First we check to see if the ``ui_cancel`` action is pressed. Then we check " +"to make sure we do not already have a ``popup`` open by checking to see if " +"``popup`` is equal to ``null``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:426 +msgid "" +"If we do not have a pop up open, we instance ``POPUP_SCENE`` and assign it " +"to ``popup``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:428 +msgid "" +"We then get the quit button and assign it's ``pressed`` signal to " +"``popup_quit``, which we will be adding shortly." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:430 +msgid "" +"Next we assign both the ``popup_hide`` signal from the :ref:`WindowDialog " +"` and the ``pressed`` signal from the resume button to " +"``popup_closed``, which we will be adding shortly." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:433 +msgid "" +"Then we add ``popup`` as a child of ``canvas_layer`` so it's drawn on top. " +"We then tell ``popup`` to pop up at the center of the screen using " +"``popup_centered``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:435 +msgid "" +"Next we make sure the mouse mode is ``MOUSE_MODE_VISIBLE`` to we can " +"interact with the pop up. If we did not do this, we would not be able to " +"interact with the pop up in any scene where the mouse mode is " +"``MOUSE_MODE_CAPTURED``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:438 +msgid "Finally, get pause the entire :ref:`SceneTree `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:440 +msgid "For more information on pausing in Godot, see :ref:`doc_pausing_games`" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:444 +msgid "" +"Now we need to add the functions we've connected the signals to. Let's add " +"``popup_closed`` first." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:446 +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:461 +msgid "Add the following to ``Globals.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:457 +msgid "" +"``popup_closed`` will resume the game and destroy the pop up if there is one." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:459 +msgid "" +"``popup_quit`` is very similar, but we're also making sure the mouse is " +"visible and changing scenes to the title screen." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:476 +msgid "" +"``popup_quit`` will resume the game, set the mouse mode to " +"``MOUSE_MODE_VISIBLE`` to ensure the mouse is visible in the main menu, " +"destroy the pop up if there is one, and change scenes to the main menu." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:481 +msgid "" +"Before we're ready to test the pop up, we should change one thing in " +"``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:483 +msgid "" +"Open up ``Player.gd`` and in ``process_input``, change the code for " +"capturing/freeing the cursor to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:490 +msgid "" +"Now instead of capturing/freeing the mouse, we check to see if the current " +"mouse mode is ``MOUSE_MODE_VISIBLE``. If it is, we set it back to " +"``MOUSE_MODE_CAPTURED``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:493 +msgid "" +"Because the pop up makes the mouse mode ``MOUSE_MODE_VISIBLE`` whenever you " +"pause, we no longer have to worry about freeing the cursor in ``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:497 +msgid "" +"Now the pause menu pop up is finished. You can now pause at any point in the " +"game and return to the main menu!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:500 +msgid "Starting the respawn system" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:502 +msgid "" +"Since our player can lose all their health, it would be ideal if our players " +"died and respawned too, so let's add that!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:504 +msgid "" +"First, open up ``Player.tscn`` and expand ``HUD``. Notice how there's a :ref:" +"`ColorRect ` called ``Death_Screen``. When the player dies, " +"we're going to make ``Death_Screen`` visible, and show them how long they " +"have to wait before they're able to respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:507 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:200 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:454 +msgid "Open up ``Player.gd`` and add the following global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:517 +msgid "``RESPAWN_TIME``: The amount of time (in seconds) it takes to respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:518 +msgid "``dead_time``: A variable to track how long the player has been dead." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:519 +msgid "" +"``is_dead``: A variable to track whether or not the player is currently dead." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:520 +msgid "``globals``: A variable to hold the ``Globals.gd`` singleton." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:524 +msgid "" +"We now need to add a couple lines to ``_ready``, so we can use ``Globals." +"gd``. Add the following to ``_ready``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:532 +msgid "" +"Now we're getting the ``Globals.gd`` singleton and assigning it to " +"``globals``. We also set our global position using the origin from our " +"global :ref:`Transform ` to the position returned by " +"``globals.get_respawn_position``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:535 +msgid "Don't worry, we'll add ``get_respawn_position`` further below!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:539 +msgid "" +"Next we need to make a few changes to ``physics_process``. Change " +"``physics_processing`` to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:557 +msgid "" +"Now we're not processing input or movement input when we're dead. We're also " +"now calling ``process_respawn``, but we haven't written ``process_respawn`` " +"yet, so let's change that." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:562 +msgid "Let's add ``process_respawn``. Add the following to ``Player.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:621 +msgid "Let's go through what this function is doing." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:625 +msgid "" +"First we check to see if we just died by checking to see if ``health`` is " +"equal or less than ``0`` and ``is_dead`` is ``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:627 +msgid "" +"If we just died, we disable our collision shapes for the player. We do this " +"to make sure we're not blocking anything with our dead body." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:629 +msgid "" +"We next set ``changing_weapon`` to ``true`` and set ``changing_weapon_name`` " +"to ``UNARMED``. This is so if we are using a weapon, we put it away when we " +"die." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:632 +msgid "" +"We then make the ``Death_Screen`` :ref:`ColorRect ` visible " +"so we get a nice grey overlay over everything. We then make the rest of the " +"UI, the ``Panel`` and ``Crosshair`` nodes, invisible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:635 +msgid "" +"Next we set ``dead_time`` to ``RESPAWN_TIME`` so we can start counting down " +"how long we've been dead. We also set ``is_dead`` to ``true`` so we know " +"we've died." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:637 +msgid "" +"If we are holding an object when we died, we need to throw it. We first " +"check to see if we are holding an object or not. If we are, we then throw " +"it, using the same code as the throwing code we added in :ref:" +"`doc_fps_tutorial_part_five`." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:642 +msgid "" +"Then we check to see if we are dead. If we are, we then remove ``delta`` " +"from ``dead_time``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:644 +msgid "" +"We then make a new variable called ``dead_time_pretty``, where we convert " +"``dead_time`` to a string, using only the first three characters starting " +"from the left. This gives us a nice looking string showing how much time we " +"have left to wait before we respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:647 +msgid "" +"We then change the :ref:`Label ` in ``Death_Screen`` to show " +"how much time we have left." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:649 +msgid "" +"Next we check to see if we've waited long enough and can respawn. We do this " +"by checking to see if ``dead_time`` is ``0`` or less." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:651 +msgid "" +"If we have waited long enough to respawn, we set the player's position to a " +"new respawn position provided by ``get_respawn_position``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:653 +msgid "" +"We then enable both of our collision shapes so the player can collide with " +"the environment." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:655 +msgid "" +"Next we make the ``Death_Screen`` invisible and make the rest of the UI, the " +"``Panel`` and ``Crosshair`` nodes, visible again." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:657 +msgid "" +"We then go through each weapon and call it's ``reset_weapon`` function. " +"We'll add ``reset_weapon`` soon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:659 +msgid "" +"Then we reset ``health`` to ``100``, ``grenade_amounts`` to it's default " +"values, and change ``current_grenade`` to ``Grenade``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:661 +msgid "Finally, we set ``is_dead`` to ``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:665 +msgid "" +"Before we leave ``Player.gd``, we need to add one quick thing to ``_input``. " +"Add the following at the beginning of ``_input``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:672 +msgid "Now when we're dead we cannot look around with the mouse." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:675 +msgid "Finishing the respawn system" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:677 +msgid "" +"First let's open ``Weapon_Pistol.gd`` and add the ``reset_weapon`` function. " +"Add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:685 +msgid "" +"Now when we call ``reset_weapon``, the ammo in our weapon and the ammo in " +"the spares will be reset to their default values." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:687 +msgid "Now let's add ``reset_weapon`` in ``Weapon_Rifle.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:695 +msgid "And add the following to ``Weapon_Knife.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:703 +msgid "Now our weapons will reset when we die." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:707 +msgid "" +"Now we need to add a few things to ``Globals.gd``. First, add the following " +"global variable:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:713 +msgid "" +"``respawn_points``: A variable to hold all of the respawn points in a level" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:715 +msgid "" +"Because we're getting a random spawn point each time, we need to randomize " +"the number generator. Add the following to ``_ready``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:721 +msgid "" +"``randomize`` will get us a new random seed so we get a (relatively) random " +"string of numbers when we using any of the random functions." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:723 +msgid "Now let's add ``get_respawn_position`` to ``Globals.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:734 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:543 +msgid "Let's go over what this function does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:738 +msgid "" +"First we check to see if we have any ``respawn_points`` by checking to see " +"if ``respawn_points`` is ``null`` or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:740 +msgid "" +"If ``respawn_points`` is ``null``, we return a position of empty :ref:" +"`Vector 3 ` with the position ``(0, 0, 0)``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:742 +msgid "" +"If ``respawn_points`` is not ``null``, we then get a random number between " +"``0`` and the number of elements we have in ``respawn_points``, minus ``1`` " +"since most programming languages (including ``GDScript``) start counting " +"from ``0`` when you are accessing elements in a list." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:745 +msgid "" +"We then return the position of the :ref:`Spatial ` node at " +"``respawn_point`` position in ``respawn_points``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:749 +msgid "" +"Before we're done with ``Globals.gd``. We need to add the following to " +"``load_new_scene``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:755 +msgid "" +"We set ``respawn_points`` to ``null`` so when/if we get to a level with no " +"respawn points, we do not respawn at the respawn points in the level prior." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:760 +msgid "" +"Now all we need is a way to set the respawn points. Open up ``Ruins_Level." +"tscn`` and select ``Spawn_Points``. Add a new script called " +"``Respawn_Point_Setter.gd`` and attach it to ``Spawn_Points``. Add the " +"following to ``Respawn_Point_Setter.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:771 +msgid "" +"Now when a node with ``Respawn_Point_Setter.gd`` has it's ``_ready`` " +"function called, all of the children nodes of the node with " +"``Respawn_Point_Setter.gd``, ``Spawn_Points`` in the case of ``Ruins_Level." +"tscn``, we be added to ``respawn_points`` in ``Globals.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:775 +msgid "" +"Any node with ``Respawn_Point_Setter.gd`` has to be above the player in the :" +"ref:`SceneTree ` so the respawn points are set before the " +"player needs them in the player's ``_ready`` function." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:780 +msgid "Now when you die you'll respawn after waiting ``4`` seconds!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:782 +msgid "" +"No spawn points are already set up for any of the levels besides " +"``Ruins_Level.tscn``! Adding spawn points to ``Space_Level.tscn`` is left as " +"an exercise for the reader." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:786 +msgid "Writing a sound system we can use anywhere" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:788 +msgid "" +"Finally, lets make a sound system so we can play sounds from anywhere, " +"without having to use the player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:790 +msgid "First, open up ``SimpleAudioPlayer.gd`` and change it to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:833 +msgid "" +"There's several changes from the old version, first and foremost being we're " +"no longer storing the sound files in ``SimpleAudioPlayer.gd`` anymore. This " +"is much better for performance since we're no longer loading each audio clip " +"when we create a sound, but instead we're forcing a audio stream to be " +"passed in to ``play_sound``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:837 +msgid "" +"Another change is we have a new global variable called ``should_loop``. " +"Instead of just destroying the audio player every time it's finished, we " +"instead want check to see if we are set to loop or not. This allows us to " +"have audio like looping background music without having to spawn a new audio " +"player with the music when the old one is finished." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:841 +msgid "" +"Finally, instead of being instanced/spawned in ``Player.gd``, we're instead " +"going to be spawned in ``Globals.gd`` so we can create sounds from any " +"scene. We now need to store the ``Globals.gd`` singleton so when we destroy " +"the audio player, we also remove it from a list in ``Globals.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:844 +msgid "Let's go over the changes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:848 +msgid "" +"For the global variables we removed all of the ``audio_[insert name here]`` " +"variables since we will instead have these passed in to. We also added two " +"new global variables, ``should_loop`` and ``globals``. We'll use " +"``should_loop`` to tell whether we want to loop when the sound has finished, " +"and ``globals`` will hold the ``Globals.gd`` singleton." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:853 +msgid "" +"The only change in ``_ready`` is now we're getting the ``Globals.gd`` " +"singleton and assigning it to ``globals``" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:855 +msgid "" +"In ``play_sound`` we now expect a audio stream, named ``audio_stream``, to " +"be passed in, instead of ``sound_name``. Instead of checking the sound name " +"and setting the stream for the audio player, we instead check to make sure " +"an audio stream was passed in. If a audio stream is not passed in, we print " +"an error message, remove the audio player from a list in the ``Globals.gd`` " +"singleton called ``created_audio``, and then free the audio player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:859 +msgid "" +"Finally, in ``sound_finished`` we first check to see if we are supposed to " +"loop or not using ``should_loop``. If we are supposed to loop, we play the " +"sound again from the start of the audio, at position ``0.0``. If we are not " +"supposed to loop, we remove the audio player from a list in the ``Globals." +"gd`` singleton called ``created_audio``, and then free the audio player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:865 +msgid "" +"Now that we've finished our changes to ``SimpleAudioPlayer.gd``, we now need " +"to turn our attention to ``Globals.gd``. First, add the following global " +"variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:883 +msgid "Lets go over these global variables." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:885 +msgid "" +"``audio_clips``: A dictionary holding all of the audio clips we can play." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:886 +msgid "``SIMPLE_AUDIO_PLAYER_SCENE``: The simple audio player scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:887 +msgid "" +"``created_audio``: A list to hold all of the simple audio players we create" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:889 +msgid "" +"If you want to add additional audio, you just need to add it to " +"``audio_clips``. No audio files are provided in this tutorial, so you will " +"have to provide your own." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:892 +msgid "" +"One site I'd recommend is **GameSounds.xyz**. I'm using the Gamemaster audio " +"gun sound pack included in the Sonniss' GDC Game Audio bundle for 2017. The " +"tracks I've used (with some minor editing) are as follows:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:896 +msgid "gun_revolver_pistol_shot_04," +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:897 +msgid "gun_semi_auto_rifle_cock_02," +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:898 +msgid "gun_submachine_auto_shot_00_automatic_preview_01" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:902 +msgid "" +"Now we need to add a new function called ``play_sound`` to ``Globals.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:921 +msgid "" +"First we check to see if we have a audio clip with the name ``sound_name`` " +"in ``audio_clips``. If we do not, we print an error message." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:923 +msgid "" +"If we do have a audio clip with the name ``sound_name``, we then instance/" +"spawn a new ``SIMPLE_AUDIO_PLAYER_SCENE`` and assign it to ``new_audio``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:925 +msgid "" +"We then set ``should_loop``, and add ``new_audio`` as a child of ``Globals." +"gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:927 +msgid "" +"Remember, we have to be careful adding nodes to a singleton, since these " +"nodes will not be destroyed when changing scenes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:929 +msgid "" +"We then call ``play_sound``, passing in the audio clip associated with " +"``sound_name``, and the sound position." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:933 +msgid "" +"Before we leave ``Globals.gd``, we need to add a few lines of code to " +"``load_new_scene`` so when we change scenes, we destroy all of the audio." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:935 +msgid "Add the following to ``load_new_scene``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:944 +msgid "" +"Now before we change scenes we go through each simple audio player in " +"``created_sounds`` and free/destroy them. Once we've gone through all of the " +"sounds in ``created_audio``, we clear ``created_audio`` so it no longer " +"holds any references to any of the previously created simple audio players." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:949 +msgid "" +"Let's change ``create_sound`` in ``Player.gd`` to use this new system. " +"First, remove ``simple_audio_player`` from ``Player.gd``'s global variables, " +"since we will no longer be directly instancing/spawning sounds from ``Player." +"gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:952 +msgid "Now, change ``create_sound`` to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:959 +msgid "" +"Now whenever ``create_sound`` is called, we simply call ``play_sound`` in " +"``Globals.gd``, passing in all of the arguments we've revived." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:963 +msgid "" +"Now all of the sounds in our FPS can be played from anywhere. All we have to " +"do is get the ``Globals.gd`` singleton, and call ``play_sound``, passing in " +"the name of the sound we want to play, whether we want it to loop or not, " +"and the position to play the sound from." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:966 +msgid "" +"For example, if you want to play an explosion sound when the grenades " +"explode you'd need to add a new sound to ``audio_clips`` in ``Globals.gd``, " +"get the ``Globals.gd`` singleton, and then you just need to add something " +"like ``globals.play_sound(\"explosion\", false, global_transform.origin)`` " +"in the grenades ``_process`` function, right after the grenade damages all " +"of the bodies within it's blast radius." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:972 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:668 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:629 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:724 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1224 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:947 +msgid "Final notes" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:976 +msgid "Now you have a fully working single player FPS!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:978 +msgid "At this point you have a good base to build more complicated FPS games." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:980 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:683 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:642 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:733 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1235 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:956 +msgid "If you ever get lost, be sure to read over the code again!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:982 +msgid "" +"You can download the finished project for the entire tutorial here: :" +"download:`Godot_FPS_Part_6.zip `" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:984 +msgid "" +"The finished project source files contain the same exact code, just written " +"in a different order. This is because the finished project source files are " +"what the tutorial is based on." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:987 +msgid "" +"The finished project code was written in the order that features were " +"created, not necessarily in a order that is ideal for learning." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:990 +msgid "" +"Other than that, the source is exactly the same, just with helpful comments " +"explaining what each part does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:993 +msgid "" +"The finished project source is hosted on Github as well: https://github.com/" +"TwistedTwigleg/Godot_FPS_Tutorial" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:995 +msgid "" +"**Please note that the code in Github may or may not be in sync with the " +"tutorial on the documentation**." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:997 +msgid "" +"The code in the documentation is likely better managed and/or more up to " +"date. If you are unsure on which to use, use the project(s) provided in the " +"documentation as they are maintained by the Godot community." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1000 +msgid "" +"You can download all of the ``.blend`` files used in this tutorial here: :" +"download:`Godot_FPS_BlenderFiles.zip `" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1002 +msgid "" +"All assets provided in the started assets (unless otherwise noted) were " +"**originally created by TwistedTwigleg, with changes/additions by the Godot " +"community.** All original assets provided for this tutorial are released " +"under the ``MIT`` license." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1005 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:57 +msgid "" +"Feel free to use these assets however you want! All original assets belong " +"to the Godot community, with the other assets belonging to those listed " +"below:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1007 +msgid "" +"The skybox is created by **StumpyStrust** and can be found at OpenGameArt." +"org. https://opengameart.org/content/space-skyboxes-0 . The skybox is " +"licensed under the ``CC0`` license." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1010 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:62 +msgid "" +"The font used is **Titillium-Regular**, and is licensed under the ``SIL Open " +"Font License, Version 1.1``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1012 +msgid "" +"The skybox was convert to a 360 equirectangular image using this tool: " +"https://www.360toolkit.co/convert-cubemap-to-spherical-equirectangular.html" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1014 +msgid "" +"While no sounds are provided, you can find many game ready sounds at https://" +"gamesounds.xyz/" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_six.rst:1016 +msgid "" +"**OpenGameArt.org, 360toolkit.co, the creator(s) of Titillium-Regular, " +"StumpyStrust, and GameSounds.xyz are in no way involved in this tutorial.**" +msgstr "" + #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:4 msgid "Part 3" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:7 -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:51 -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:7 -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:7 -msgid "Part Overview" -msgstr "" - #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:9 msgid "" -"In this part we will be limiting our guns by giving them ammo. We will also " -"be giving the player the ability to reload, and we will be adding sounds " -"when the guns fire." +"In this part we will be limiting our weapons by giving them ammo. We will " +"also be giving the player the ability to reload, and we will be adding " +"sounds when the weapons fire." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:15 @@ -37422,382 +39408,501 @@ msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:18 msgid "" -"You are assumed to have finished :ref:`part two ` " -"before moving on to this part of the tutorial." +"You are assumed to have finished :ref:`doc_fps_tutorial_part_two` before " +"moving on to this part of the tutorial." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:20 -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:24 -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:19 -msgid "Let's get started!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:24 -msgid "Changing levels" +msgid "" +"The finished project from :ref:`doc_fps_tutorial_part_two` will be the " +"starting project for part 3" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:26 +msgid "Changing levels" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:28 msgid "" -"Now that we have a fully working FPS, let's move to a more FPS like level. " -"Open up ``Test_Level.tscn``. ``Test_Level.tscn`` is a complete custom FPS " -"level created for the purpose of this tutorial. Press ``F6`` to play the " -"open scene, or press the \"play current scene button\", and give it a whirl." +"Now that we have a fully working FPS, let's move to a more FPS like level." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:30 msgid "" -"There will (likely) be the occasional random freeze as you go through the " -"level. This is a known issue." +"Open up ``Space_Level.tscn`` (``assets/Space_Level_Objects/Space_Level." +"tscn``) and/or ``Ruins_Level.tscn`` (``assets/Ruin_Level_Objects/Ruins_Level." +"tscn``)." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:33 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:32 msgid "" -"If you find any way to solve it, please let me know on the Github " -"repository, the Godot forums, or on Twitter! Be sure to include " -"``@TwistedTwigleg`` so I will have a greater chance of seeing it!" +"``Space_Level.tscn`` and ``Ruins_Level.tscn`` are complete custom FPS levels " +"created for the purpose of this tutorial. Press ``F6`` to play the open " +"scene, or press the ``play current scene button``, and give it them a whirl." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:36 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:35 msgid "" -"You might have noticed there are several boxes and cylinders placed " -"throughout the level. They are :ref:`RigidBody ` nodes we " -"can place ``RigidBody_hit_test.gd`` on and then they will react to being hit " -"with bullets, so lets do that!" +"``Space_Level.tscn`` is more graphically demanding of the GPU than " +"``Ruins_Level.tscn``. If your computer is struggling to render ``Space_Level." +"tscn``, try using ``Ruins_Level.tscn`` instead." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:39 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:38 msgid "" -"Select ``Center_room`` and open it up. From there select ``Physics_objects`` " -"and open that up. You'll find there are ``6`` crates in a seemingly random " -"order. Go select one of them and press the \"Open in Editor\" button. It's " -"the one that looks like a little movie slide." +"You might have noticed there are several :ref:`RigidBody ` " +"nodes placed throughout the level. We can place ``RigidBody_hit_test.gd`` on " +"them and then they will react to being hit with bullets, so let's do that!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:43 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:41 msgid "" -"The reason the objects seem to be placed in a random order is because all of " -"the objects were copied and pasted around in the Godot editor to save on " -"time. If you want to move any of the nodes around, it is highly suggested to " -"just left click inside the editor viewport to get the node you want, and " -"then move it around with the :ref:`Spatial ` gizmo." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:47 -msgid "" -"This will bring you to the crate's scene. From there, select the ``Crate`` :" -"ref:`RigidBody ` (the one that is the root of the scene) " -"and scroll down in the inspector until you get to the script section. From " -"there, click the drop down and select \"Load\". Chose ``RigidBody_hit_test." -"gd`` and then return to ``Test_Level.tscn``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:51 -msgid "" -"Now open ``Upper_room``, select ``Physics_objects``, and chose one of the " -"cylinder :ref:`RigidBody ` nodes. Press the \"Open in Editor" -"\" button beside one of the cylinders. This will bring you to the cylinder's " -"scene." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:54 -msgid "" -"From there, select the ``Cylinder`` :ref:`RigidBody ` (the " -"one that is the root of the scene) and scroll down in the inspector until " -"you get to the script section. From there, click the drop down and select " -"\"Load\". Chose ``RigidBody_hit_test.gd`` and then return to ``Test_Level." -"tscn``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:58 -msgid "" -"Now you can fire at the boxes and cylinders and they will react to your " -"bullets just like the cubes in ``Testing_Area.tscn``!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:62 -msgid "Adding ammo" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:64 -msgid "" -"Now that we've got working guns, lets give them a limited amount of ammo." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:66 -msgid "" -"Lets define some more global variables in ``Player.gd``, ideally nearby the " -"other gun related variables:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:75 -msgid "Here is what these variables will be doing for us:" +"Follow the instructions below for either (or both) of the scenes you want to " +"use" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:77 +msgid "Now you can fire at all of the rigid bodies in either level!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:80 +msgid "Adding ammo" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:82 msgid "" -"``ammo_for_guns``: The amount of ammo we have in reserve for each weapon/gun." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:78 -msgid "``ammo_in_guns``: The amount of ammo currently inside the weapon/gun." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:79 -msgid "``AMMO_IN_MAGS``: How much ammo is in a fully filled weapon/gun." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:81 -msgid "" -"There is no reason we've included ammo for the knife, so feel free to remove " -"the knife's ammo if you desire." +"Now that we've got working guns, let's give them a limited amount of ammo." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:84 -msgid "" -"Depending on how you program melee weapons, you may need to define an ammo " -"count even if the weapon does not use ammo. Some games use extremely short " -"range 'guns' as their melee weapons, and in those cases you may need to " -"define ammo for your melee weapons." +msgid "First we need to define a few variables in each of our weapon scripts." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:90 -msgid "Now we need to add a few ``if`` checks to ``_physics_process``." +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:86 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:195 +msgid "Open up ``Weapon_Pistol.gd`` and add the following global variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:92 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:94 +msgid "``ammo_in_weapon``: The amount of ammo currently in the pistol" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:95 msgid "" -"We need to make sure we have ammo in our gun before we try to fire a bullet. " -"Go find the line that checks for the fire action being pressed and add the " -"following new bits of code:" +"``spare_ammo``: The amount of ammo we have left in reserve for the pistol" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:96 +msgid "``AMMO_IN_MAG``: The amount of ammo in a fully reload weapon/magazine" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:98 +msgid "Now all we need to do is add a single line of code to ``fire_weapon``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:100 +msgid "" +"Add the following right under ``Clone.BULLET_DAMAGE = DAMAGE``: " +"``ammo_in_weapon -= 1``" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:102 +msgid "" +"This will remove one from ``ammo_in_weapon`` every time we fire. Notice " +"we're not checking to see if we have ammo count of ``0`` or greater in " +"``fire_weapon``. Instead we're going to check that the ammo count in " +"``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:107 +msgid "Now we need to add ammo for both the rifle and the knife." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:109 +msgid "" +"You may be wondering why we are adding ammo for the knife given it does not " +"consume any ammunition. The reason we want to add ammo to the knife is so we " +"have a consistent interface for all of our weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:112 +msgid "" +"If we did not add ammo variables for the knife, we would have to add checks " +"for the knife. By adding the ammo variables to the knife, we don't need to " +"worry about whether or all our weapons have the same variables." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:115 -msgid "" -"These two additional ``if`` checks make sure we have a bullet to fire before " -"setting our firing animation." +msgid "Add the following global variables to ``Weapon_Rifle.gd``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:117 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:123 msgid "" -"While we're still in ``_physics_process``, let's also add a way to track how " -"much ammo we have. Find the line that has ``UI_status_label.text = \"HEALTH: " -"\" + str(health)`` in ``_physics_process`` and replace it with the following:" +"And then add the following to ``fire_weapon``: ``ammo_in_weapon -= 1``. Make " +"sure that ``ammo_in_weapon -= 1`` is outside of the ``if ray." +"is_colliding()`` check so we lost ammo regardless of whether we've hit " +"something or not." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:129 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:126 msgid "" -"Did you now that you can combine two lines using ``\\``? We're using it here " -"so we do not have a extremely long line of code all on one line by splitting " -"it into two lines!" +"Now all that's left is the knife. Add the following to ``Weapon_Knife.gd``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:133 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:134 msgid "" -"This will show the player how much ammo they currently have and how much " -"ammo they currently have in reserve, only for the appropriate weapons (not " -"unarmed or the knife). Regardless of the currently selected weapon/gun, we " -"will always show how much health the player has" +"And because our knife does not consume ammo, that is all we need to add." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:137 -msgid "" -"we cannot just add ``ammo_for_guns[current_gun]`` or " -"``ammo_in_guns[current_gun]`` to the ``string`` we are passing in to the :" -"ref:`Label `. Instead we have to cast them from ``floats`` to " -"``strings``, which is what we are doing by using ``str()``." +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:138 +msgid "Now all we need to do is change a one thing in ``Player.gd``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:141 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:140 msgid "" -"For more information on casting, see this page from wiki books: https://en." -"wikibooks.org/wiki/Computer_Programming/Type_conversion" +"All we need to change how we're firing our weapons in ``process_input``. " +"Change the code for firing weapons to the following:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:144 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:155 msgid "" -"We are currently not using the player's health just yet in the tutorial. We " -"will start using health for the player and objects when we include turrets " -"and targets in later parts." +"Now our weapons have a limited amount of ammo, and will stop firing when we " +"run out." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:148 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:159 msgid "" -"Now we need to remove a bullet from the gun when we fire. To do that, we " -"just need to add a few lines in ``fire_bullet``:" +"Ideally we'd like to be able to see how much ammo we have left. Let's make a " +"new function called ``process_ui``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:161 +msgid "First, add ``process_UI(delta)`` to ``_physics_process``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:163 +msgid "Now add the following to ``Player.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:175 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:237 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:162 +msgid "Let's go over what's happening:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:177 +msgid "" +"First we check to see if the current weapon is either ``UNARMED`` or " +"``KNIFE``. If it is, we change the ``UI_status_label``'s text to only show " +"our health, since ``UNARMED`` and ``KNIFE`` do not consume ammo." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:180 +msgid "" +"If we are using a weapon that does consume ammo, we first get the weapon " +"node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:182 +msgid "" +"Then change ``UI_status_label``'s text to show our health, how much ammo we " +"have in the weapon, along with how much spare ammo we have for that weapon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:186 +msgid "Now we can see how much ammo we have through the HUD." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:189 +msgid "Adding reloading to the weapons" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:191 msgid "" -"Go play the project again! Now you'll lose ammo as you fire, until you reach " -"zero and cannot fire anymore." +"Now that we can run our weapons out of ammo, we really need a way to fill " +"them back up. Let's add reloading next!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:195 -msgid "Adding reloading" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:197 -msgid "Now that we can empty our gun, we need a way to refill it!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:199 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:193 msgid "" -"First, let's start by adding another global variable. Add ``var " -"reloading_gun = false`` somewhere along with your other global variables, " -"preferably near the other gun related variables." +"For reloading we need to add a few more variables and a function to every " +"weapon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:204 +msgid "" +"``CAN_RELOAD``: A boolean to track whether this weapon has the ability to " +"reload" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:205 -msgid "Now we need to add several things to ``_physics_process``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:207 msgid "" -"First, let's make sure we cannot change guns while reloading. We need to " -"change the weapon changing code to include the following:" +"``CAN_REFIL``: A boolean to track whether we can refill this weapon's spare " +"ammo. We will not be using ``CAN_REFIL`` in this part, but we will in the " +"next part!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:227 -msgid "Now the player cannot change guns while reloading." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:231 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:206 msgid "" -"Ideally we want the player to be able to reload when they chose, so lets " -"given them the ability to reload when they press the ``reload`` action. Add " -"the following somewhere in ``_physics_process``, ideally nearby your other " -"input related code:" +"``RELOADING_ANIM_NAME``: The name of the reloading animation for this weapon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:208 +msgid "" +"Now we need to add a function for handling reloading. Add the following " +"function to ``Weapon_Pistol.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:239 +msgid "First we define a variable to see whether or not we can reload." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:241 +msgid "" +"We first check to see if we are in this weapon's idle animation state " +"because we only want to be able to reload when we are not firing. equipping, " +"or unequipping." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:244 msgid "" -"First we see if the player is already reloading. If they are not, then we " -"check if they've pressed the reloading action. If they have pressed the " -"``reload`` action, we then check if they are using a weapon that has the " -"ability to be reloaded. Finally, we make sure they are not already in a " -"reloading animation. If they are not, we set ``reloading_gun`` to ``true``." +"Next we check to see if we have spare ammo, and if the ammo already in our " +"weapon is equal to a fully reloaded weapon. This way we can assure we're not " +"going to reload when we have no ammo or when the weapon is already full of " +"ammo." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:247 +msgid "" +"If we still can reload, then we calculate the amount of ammo needed to " +"reload the weapon." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:249 msgid "" -"We do not want to do our reloading processing here with the input in an " -"effort to keep game logic separate from input logic. Keeping them separate " -"makes the code easier to debug, and as a bonus it keeps the input logic from " -"being overly bloated." +"If we have enough ammo to fill the weapon, we remove the ammo needed from " +"``spare_ammo`` and then set ``ammo_in_weapon`` to a full weapon/magazine." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:251 +msgid "" +"If we do not have enough ammo, we add all of the ammo left in " +"``spare_ammo``, then set ``spare_ammo`` to ``0``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:253 +msgid "" +"Next we play the reloading animation for this weapon, and then return " +"``true``." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:255 -msgid "" -"Finally, we need to add the code that actually handles reloading. Add the " -"following code to ``_physics_process``, ideally somewhere underneath the " -"reloading input code you just inputted:" +msgid "If we could not reload, we return ``false``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:300 -msgid "Lets go over what this code does." +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:259 +msgid "" +"Now we need to add reloading to the rifle. Open up ``Weapon_Rifle.gd`` and " +"add the following global variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:304 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:268 msgid "" -"First we check if ``reloading_gun`` is ``true``. If it is we then go through " -"a series of checks to see if we can reload or not. We use ``can_reload`` as " -"a variable to track whether or not it is possible to reload." +"These variables are exactly the same as the pistol, just with " +"``RELOADING_ANIM_NAME`` changed to the rifle's reloading animation." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:308 -msgid "" -"We go through series of checks for each weapon. For the pistol and the rifle " -"we check if we're in an idle state or not. If we are, then we set " -"``can_reload`` to ``true``." +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:270 +msgid "Now we just need to add ``reload_weapon`` to ``Weapon_Rifle.gd``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:311 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:299 +msgid "This code is exactly the same as the pistol." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:303 msgid "" -"For the knife we do not want to reload, because you cannot reload a knife, " -"so we set ``can_reload`` and ``reloading_gun`` to ``false``. If we are using " -"a weapon that we do not have a ``if`` or ``elif`` check for, we set " -"``can_reload`` and ``reloading_gun`` to ``false``, as we do not want to be " -"able to reload a weapon we are unaware of." +"The last bit we need to do for the weapons is add 'reloading' to the knife. " +"Add the following global variables to ``Weapon_Knife.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:312 +msgid "" +"Since we both cannot reload or refill a knife, we set both constants to " +"``false``. We also define ``RELOADING_ANIM_NAME`` as an empty string, since " +"the knife has no reloading animation." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:315 msgid "" -"Next we check if we have ammo in reserve for the gun in question. We also " -"check to make sure the gun we are trying to reload is not already full of " -"ammo. If the gun does not have ammo in reserve or the gun is already full, " -"we set ``can_reload`` and ``reloading_gun`` to ``false``." +"Now we just need to add ``reloading_weapon``, and thankfully it's really " +"simple:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:319 -msgid "" -"If we've made it through all those checks and we can reload, then we have a " -"few more steps to take." +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:322 +msgid "Since we cannot reload a knife, we just always return ``false``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:321 -msgid "" -"First we assign the ammo we are needing to fill the gun fully to the " -"``ammo_needed`` variable. We just subtract the amount of ammo we currently " -"have in our gun by the amount of ammo in a full magazine." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:324 -msgid "" -"Then we check if have enough ammo in reserves to fill the gun fully. If we " -"do, we subtract the amount of ammo we need to refill our gun from the " -"reserves, and we set the amount of ammo in the gun to full." +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:325 +msgid "Adding reloading to the player" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:327 msgid "" -"If we do not have enough ammo in reserves to fill the gun, we add all of the " -"ammo left in reserves to our gun and then set the ammo in reserves to zero, " -"making it empty." +"Now we just need to add a few things to ``Player.gd``. First we need to " +"define a new global variable:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:330 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:333 msgid "" -"Regardless of how much ammo we've added to the gun, we set our animation to " -"the reloading animation for the current gun." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:332 -msgid "" -"Finally, we set ``reloading_gun`` to false because we have finished " -"reloading the gun." +"``reloading_weapon``: A variable to track whether or not we are currently " +"trying to reload." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:336 -msgid "" -"Go test the project again, and you'll find you can reload your gun when it " -"is not full and when there is ammo left in the ammo reserves." +msgid "Next we need to add another function call to ``_physics_process``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:341 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:338 msgid "" -"Personally, I like the guns to automatically start reloading if we try to " -"fire them when they have no ammo in them, so lets add that! Add the " -"following code to the input code for firing the guns:" +"Add ``process_reloading(delta)`` to ``_physics_process``. Now " +"``_physics_process`` should look something like this:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:369 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:349 msgid "" -"Now whenever the player tries to fire the gun when it's empty, we " -"automatically set ``reloading_gun`` to true, which will reload the gun if " -"possible." +"Now we need to add ``process_reloading``. Add the following function to " +"``Player.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:362 +msgid "First we check to make sure we are trying to reload." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:364 +msgid "" +"If we are, we then get the current weapon. If the current weapon does not " +"equal ``null``, we call its ``reload_weapon`` function." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:366 +msgid "" +"If the current weapon is equal to ``null``, then the current weapon is " +"``UNARMED``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:368 +msgid "" +"Finally, we set ``reloading_weapon`` to ``false``, because regardless of " +"whether we've successfully reloaded, we've tried reloading and no longer " +"need to keep trying." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:373 -msgid "Adding sounds" +msgid "" +"Before we can reload, we need to change a few things in ``process_input``." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:375 msgid "" +"The first thing we need to change is in the code for changing weapons. We " +"need to add a additional check (``if reloading_weapon == false:``) to see if " +"we are reloading:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:386 +msgid "This makes it where we cannot change weapons if we are reloading." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:388 +msgid "" +"Now we need to add the code to trigger a reload when the player pushes the " +"``reload`` action. Add the following code to ``process_input``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:413 +msgid "" +"First we make sure we're not reloading already, nor are we trying to change " +"weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:415 +msgid "Then we check to see if the ``reload`` action has been pressed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:417 +msgid "" +"If we have pressed ``reload``, we then get the current weapon and check to " +"make sure it is not ``null``. Then we check to see if the weapon can reload " +"or not using its ``CAN_RELOAD`` constant." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:420 +msgid "" +"If the weapon can reload, we then get the current animation state, and make " +"a variable for tracking whether we are already reloading or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:422 +msgid "" +"We then go through every weapon to make sure we're not already playing that " +"weapon's reloading animation." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:424 +msgid "" +"If we are not reloading with any weapon, we set ``reloading_weapon`` to " +"``true``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:428 +msgid "" +"One thing I like to add is where the weapon will reload itself if you try to " +"fire it when it's out of ammo." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:430 +msgid "" +"We also need to add a additional if check (``is_reloading_weapon == false:" +"``) so we cannot fire the current weapon while reloading." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:433 +msgid "" +"Let's change our firing code in ``process_input`` so it reloads when trying " +"to fire an empty weapon:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:451 +msgid "" +"Now we check to make sure we're not reloading before we fire out weapon, and " +"when we have ``0`` or less ammo in our weapon we set ``reloading_weapon`` to " +"``true`` if we try to fire." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:454 +msgid "" +"This will make it where we will try to reload when we try to fire a empty " +"weapon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:458 +msgid "" +"With that we can reload our weapons! Give it a try! Now you can fire all of " +"the spare ammo for each weapon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:461 +msgid "Adding sounds" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:463 +msgid "" "Finally, let's add some sounds that play when we are reloading, changing " "guns, and when we are firing them." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:378 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:466 msgid "" "There are no game sounds provided in this tutorial (for legal reasons). " "https://gamesounds.xyz/ is a collection of **\"royalty free or public domain " @@ -37805,314 +39910,273 @@ msgid "" "which can be found in the Sonniss.com GDC 2017 Game Audio Bundle." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:382 -msgid "" -"The video tutorial will briefly show how to edit the audio files for use in " -"the tutorial." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:384 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:470 msgid "" "Open up ``SimpleAudioPlayer.tscn``. It is simply a :ref:`Spatial " -"` with a :ref:'AudioStreamPlayer ' " +"` with a :ref:`AudioStreamPlayer ` " "as it's child." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:386 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:472 msgid "" "The reason this is called a 'simple' audio player is because we are not " "taking performance into account and because the code is designed to provide " -"sound in the simplest way possible. This will likely change in a future part." +"sound in the simplest way possible." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:390 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:475 msgid "" "If you want to use 3D audio, so it sounds like it's coming from a location " -"in 3D space, right click the :ref:'AudioStreamPlayer " -"' and select \"Change type\"." +"in 3D space, right click the :ref:`AudioStreamPlayer " +"` and select \"Change type\"." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:393 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:478 msgid "" -"This will open the node browser. Navigate to :ref:'AudioStreamPlayer3D " -"' and select \"change\". In the source for this " -"tutorial, we will be using :ref:'AudioStreamPlayer " -"', but you can optionally use :" -"ref:'AudioStreamPlayer3D ' if you desire, and the " +"This will open the node browser. Navigate to :ref:`AudioStreamPlayer3D " +"` and select \"change\". In the source for this " +"tutorial, we will be using :ref:`AudioStreamPlayer " +"`, but you can optionally use :ref:" +"`AudioStreamPlayer3D ` if you desire, and the " "code provided below will work regardless of which one you chose." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:398 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:483 msgid "" -"Create a new script and call it \"SimpleAudioPlayer.gd\". Attach it to the :" +"Create a new script and call it ``SimpleAudioPlayer.gd``. Attach it to the :" "ref:`Spatial ` in ``SimpleAudioPlayer.tscn`` and insert the " "following code:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:443 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:534 msgid "" "By setting ``position`` to ``null`` by default in ``play_sound``, we are " -"making it an optional argument, meaning position doesn't necessarily have to " -"be passed in to call the ``play_sound``." +"making it an optional argument, meaning ``position`` doesn't necessarily " +"have to be passed in to call the ``play_sound``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:446 -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1234 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:537 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:236 msgid "Let's go over what's happening here:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:450 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:541 msgid "" -"In ``_ready`` we get the :ref:'AudioStreamPlayer ' " -"and connect it's ``finished`` signal to ourselves. It doesn't matter if " -"it's :ref:'AudioStreamPlayer ' or :" -"ref:'AudioStreamPlayer3D ' node, as they both " -"have the finished signal. To make sure it is not playing any sounds, we call " -"``stop`` on the :ref:'AudioStreamPlayer '." +"In ``_ready`` we get the :ref:`AudioStreamPlayer ` " +"and connect its ``finished`` signal to ourselves. It doesn't matter if it's " +"a :ref:`AudioStreamPlayer ` or :ref:" +"`AudioStreamPlayer3D ` node, as they both have " +"the finished signal. To make sure it is not playing any sounds, we call " +"``stop`` on the :ref:`AudioStreamPlayer `." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:454 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:545 msgid "" "Make sure your sound files are **not** set to loop! If it is set to loop the " "sounds will continue to play infinitely and the script will not work!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:457 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:548 msgid "" "The ``play_sound`` function is what we will be calling from ``Player.gd``. " "We check if the sound is one of the three possible sounds, and if it is we " -"set the audio stream for our :ref:'AudioStreamPlayer " -"' to the correct sound." +"set the audio stream for our :ref:`AudioStreamPlayer " +"` to the correct sound." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:461 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:552 msgid "" "If it is an unknown sound, we print an error message to the console and free " "ourselves." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:463 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:554 msgid "" -"If you are using a :ref:'AudioStreamPlayer3D ', " +"If you are using a :ref:`AudioStreamPlayer3D `, " "remove the ``#`` to set the position of the audio player node so it plays at " "the correct position." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:466 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:557 msgid "" -"Finally, we tell the :ref:'AudioStreamPlayer ' to " +"Finally, we tell the :ref:`AudioStreamPlayer ` to " "play." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:468 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:559 msgid "" -"When the :ref:'AudioStreamPlayer ' is finished " +"When the :ref:`AudioStreamPlayer ` is finished " "playing the sound, it will call ``destroy_self`` because we connected the " -"``finished`` signal in ``_ready``. We stop the :ref:'AudioStreamPlayer " -"' and free ourself to save on resources." +"``finished`` signal in ``_ready``. We stop the :ref:`AudioStreamPlayer " +"` and free ourself to save on resources." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:472 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:563 +msgid "This system is extremely simple and has some major flaws:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:565 msgid "" -"This system is extremely simple and has some major flaws: One flaw is we " -"have to pass in a string value to play a sound. While it is relatively " -"simple to remember the names of the three sounds, it can be increasingly " -"complex when you have more sounds. Ideally we'd place these sounds in some " -"sort of container with exposed variables so we do not have to remember the " -"name(s) of each sound effect we want to play." +"One flaw is we have to pass in a string value to play a sound. While it is " +"relatively simple to remember the names of the three sounds, it can be " +"increasingly complex when you have more sounds. Ideally we'd place these " +"sounds in some sort of container with exposed variables so we do not have to " +"remember the name(s) of each sound effect we want to play." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:478 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:570 msgid "" "Another flaw is we cannot play looping sounds effects, nor background music " "easily with this system. Because we cannot play looping sounds, certain " "effects like footstep sounds are harder to accomplish because we then have " -"to keep track of whether or not there is a sound effect *and* whether or not " +"to keep track of whether or not there is a sound effect and whether or not " "we need to continue playing it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:485 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:575 msgid "" -"With that done, lets open up ``Player.gd`` again. First we need to load the " +"One of the biggest flaws with this system is we can only play sounds from " +"``Player.gd``. Ideally we'd like to be able to play sounds from any script " +"at any time." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:580 +msgid "" +"With that done, let's open up ``Player.gd`` again. First we need to load the " "``SimpleAudioPlayer.tscn``. Place the following code in your global " "variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:492 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:587 msgid "" "Now we just need to instance the simple audio player when we need it, and " -"then call it's ``play_sound`` function and pass the name of the sound we " -"want to play. To make the process simpler, let's create a ``create_sound`` " +"then call its ``play_sound`` function and pass the name of the sound we want " +"to play. To make the process simpler, let's create a ``create_sound`` " "function:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:504 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:599 msgid "Lets walk through what this function does:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:508 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:603 msgid "" -"The first line instances the ``simple_audio_player.tscn`` scene and assigns " +"The first line instances the ``Simple_Audio_Player.tscn`` scene and assigns " "it to a variable, named ``audio_clone``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:511 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:606 msgid "" "The second line gets the scene root, using one large assumption. We first " "get this node's :ref:`SceneTree `, and then access the root " "node, which in this case is the :ref:`Viewport ` this entire " "game is running under. Then we get the first child of the :ref:`Viewport " "`, which in our case happens to be the root node in " -"``Test_Area.tscn`` or ``Test_Level.tscn``. We are making a huge assumption " -"that the first child of the root is the root node that our player is under, " -"which could not always be the case." +"``Test_Area.tscn`` or any of the other provided levels. We are making a huge " +"assumption that the first child of the root is the root node that our player " +"is under, which could not always be the case." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:517 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:612 msgid "" "If this doesn't make sense to you, don't worry too much about it. The second " "line of code only doesn't work reliably if you have multiple scenes loaded " -"as childs to the root node at a time, which will rarely happen for most " +"as children to the root node at a time, which will rarely happen for most " "projects. This is really only potentially a issue depending on how you " "handle scene loading." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:521 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:616 msgid "" "The third line adds our newly created ``SimpleAudioPlayer`` scene to be a " "child of the scene root. This works exactly the same as when we are spawning " "bullets." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:524 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:619 msgid "" "Finally, we call the ``play_sound`` function and pass in the arguments we're " "given. This will call ``SimpleAudioPlayer.gd``'s ``play_sound`` function " "with the passed in arguments." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:529 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:624 msgid "" -"Now all that is left is playing the sounds when we want to. First, let's " -"play the shooting sounds when a bullet is fired. Go to ``fire_bullet`` and " -"add the following:" +"Now all that is left is playing the sounds when we want to. Let's add sound " +"to the pistol first!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:573 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:626 +msgid "Open up ``Weapon_Pistol.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:628 msgid "" -"Now we will play the shooting noise for both the pistol and the rifle when a " -"bullet is created." +"Now, we want to make a noise when we fire the pistol, so add the following " +"to the end of the ``fire_weapon`` function:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:575 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:634 +msgid "Now when we fire our pistol, we'll play the ``pistol_shot`` sound." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:636 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:658 msgid "" -"We are passing in the positions of the ends of the guns using the bullet " -"object's global :ref:`Transform ` and the :ref:`Raycast " -"`'s global :ref:`Transform `. If you are not " -"using a :ref:`AudioStreamPlayer3D ` node, you can " -"optionally leave the positions out and only pass in the name of the sound " -"you want to play." +"To make a sound when we reload, we just need to add the following right " +"under ``player_node.animation_manager.set_animation(RELOADING_ANIM_NAME)`` " +"in the ``reload_weapon`` function:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:580 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:643 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:665 +msgid "Now when we reload we'll play the ``gun_cock`` sound." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:647 +msgid "Now let's add sounds to the rifle. Open up ``Weapon_Rifle.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:650 msgid "" -"Finally, lets play the sound of a gun being cocked when we reload and when " -"we change weapons. Add the following to our reloading logic section of " -"``_physics_process``:" +"To play sounds when the rifle is fired, add the following to the end of the " +"``fire_weapon`` function:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:625 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:656 +msgid "Now when we fire our rifle, we'll play the ``rifle_shot`` sound." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:672 msgid "" -"And add this code to the changing weapons section of ``_physics_process``:" +"Now you have weapons with limited ammo that play sounds when you fire them!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:666 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:674 msgid "" -"Now whatever sound you have assigned to \"Gun_cock\" will play when you " -"reload and when you change to either the pistol or the rifle." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:671 -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1262 -msgid "Final notes" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:675 -msgid "Now you have a fully working single player FPS!" +"At this point we have all of the basics of a FPS working. There's still a " +"few things that would be nice to add, and we're going to add them in the " +"next three parts!" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:677 msgid "" -"You can find the completed project here: :download:`Godot_FPS_Finished.zip " -"`" +"For example, right now we have no way to add ammo to our spares, so we'll " +"eventually run out. Also, we don't really have anything to shoot at outside " +"of the :ref:`RigidBody ` nodes." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:679 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:680 msgid "" -"The finished project source is hosted on Github as well: https://github.com/" -"TwistedTwigleg/Godot_FPS_Tutorial" +"In In :ref:`doc_fps_tutorial_part_four` we'll add some targets to shoot at, " +"along with some health and ammo pick ups! We're also going to add joypad " +"support, so we can play with wired Xbox 360 controllers!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:681 +#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:685 msgid "" -"You can also download all of the ``.blend`` files used here: :download:" -"`Godot_FPS_BlenderFiles.zip `" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:683 -msgid "" -"The finished project source files contain the same exact code, just written " -"in a different order. This is because the finished project source files are " -"what the tutorial is based on." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:686 -msgid "" -"The finished project code was written in the order that features were " -"created, not necessarily in a order that is ideal for learning." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:689 -msgid "" -"Other than that, the source is exactly the same, just with helpful comments " -"explaining what each part does." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:692 -msgid "" -"The skybox is created by **StumpyStrust** and can be found at OpenGameArt." -"org. https://opengameart.org/content/space-skyboxes-0" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:694 -msgid "" -"The font used is **Titillium-Regular**, and is licensed under the SIL Open " -"Font License, Version 1.1." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:696 -msgid "" -"The skybox was convert to a 360 equirectangular image using this tool: " -"https://www.360toolkit.co/convert-cubemap-to-spherical-equirectangular.html" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:698 -msgid "" -"While no sounds are provided, you can find many game ready sounds at https://" -"gamesounds.xyz/" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:700 -msgid "" -"OpenGameArt.org, 360toolkit.co, the creator(s) of Titillium-Regular, and " -"GameSounds.xyz are in no way involved in this tutorial." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_three.rst:704 -msgid "" -"In :ref:`part four ` we will be refactoring/" -"rewriting ``Player.gd`` to a more modular format, as well as adding joypad " -"support!" +"You can download the finished project for this part here: :download:" +"`Godot_FPS_Part_3.zip `" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:4 @@ -38129,11 +40193,11 @@ msgid "" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:13 -msgid "Throughout the course of these tutorials, we will cover how:" +msgid "Throughout the course of this tutorial series, we will cover how:" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:15 -msgid "To make a first person character, with sprinting and a flash light." +msgid "To make a first person character that can move, sprint, and jump." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:16 @@ -38142,107 +40206,170 @@ msgid "" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:17 -msgid "To add a pistol, rifle, and knife to the first person character." +msgid "" +"To add three weapons to the first person character, each using a different " +"way to handle bullet collisions:" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:18 -msgid "To add ammo and reloading to weapons that consume ammo." +msgid "A knife (using an :ref:`Area `)" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:19 -msgid "To add sounds that play when the guns fire." +msgid "A pistol (Bullet scenes)" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:20 +msgid "A rifle (using a :ref:`Raycast `)" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:21 +msgid "To add two different types of grenades to the first person character:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:22 +msgid "A normal grenade" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:23 +msgid "A sticky grenade" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:24 +msgid "" +"To add the ability to grab and throw :ref:`RigidBody ` nodes" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:25 +msgid "To add joypad input for the player" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:26 +msgid "To add ammo and reloading for all weapons that consume ammo." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:27 +msgid "To add ammo and health pick ups" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:28 +msgid "In two sizes: big and small" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:29 +msgid "To add an automatic turret" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:30 +msgid "That can fire using bullet objects or a :ref:`Raycast `" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:31 +msgid "To add targets that break when they've taken enough damage" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:32 +msgid "To add sounds that play when the guns fire." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:33 +msgid "To add a simple main menu:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:34 +msgid "With an options menu for changing how the game runs" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:35 +msgid "With a level select screen" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:36 +msgid "To add a universal pause menu we can access anywhere" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:38 msgid "" "While this tutorial can be completed by beginners, it is highly advised to " "complete :ref:`doc_your_first_game`, if you are new to Godot and/or game " "development **before** going through this tutorial series." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:26 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:43 msgid "" "Remember: Making 3D games is much harder than making 2D games. If you do not " "know how to make 2D games you will likely struggle making 3D games." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:29 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:46 msgid "" "This tutorial assumes you know have experience working with the Godot " "editor, have basic programming experience in GDScript, and have basic " "experience in game development." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:32 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:49 msgid "" -"You can find the start assets for this parts 1 through 3 here: :download:" +"You can find the start assets for this tutorial here: :download:" "`Godot_FPS_Starter.zip `" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:34 -msgid "A video version of this tutorial series is coming soon!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:36 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:51 msgid "" -"The provided starter assets contain a animated 3D model, a bunch of 3D " +"The provided starter assets contain an animated 3D model, a bunch of 3D " "models for making levels, and a few scenes already configured for this " "tutorial." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:39 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:54 msgid "" -"All assets provided are created by me (TwistedTwigleg) unless otherwise " -"noted, and are released under the ``MIT`` license." +"All assets provided (unless otherwise noted) were originally created by " +"TwistedTwigleg, with changes/additions by the Godot community. All original " +"assets provided for this tutorial are released under the ``MIT`` license." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:42 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:59 msgid "" "The skybox is created by **StumpyStrust** on OpenGameArt. The skybox used is " "licensed under ``CC0``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:45 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:64 msgid "" -"The font used is **Titillium-Regular**, and is licensed under the ``SIL Open " -"Font License, Version 1.1``." +"You can find the finished project for each part at the bottom of each part's " +"page" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:47 -msgid "" -"You can find the finished project for parts 1 through 3 at the bottom of :" -"ref:`doc_fps_tutorial_part_three`." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:53 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:69 msgid "" "In this part we will be making a first person player that can move around " "the environment." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:58 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:74 msgid "" -"By the end of this part you will have a working first person character with " -"a mouse based camera that can walk, jump, and sprint around the game " -"environment in any direction" +"By the end of this part you will have a working first person character who " +"can move around the game environment, look around with a mouse based first " +"person camera, that can jump into the air, turn on and off a flash light, " +"and sprint." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:63 -msgid "Getting everything setup" +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:78 +msgid "Getting everything ready" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:64 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:79 msgid "Launch Godot and open up the project included in the starter assets." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:66 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:81 msgid "" "While these assets are not necessarily required to use the scripts provided " "in this tutorial, they will make the tutorial much easier to follow as there " "are several pre-setup scenes we will be using throughout the tutorial series." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:70 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:85 msgid "" "First, go open the project settings and go to the \"Input Map\" tab. You'll " "find several actions have already been defined. We will be using these " @@ -38250,89 +40377,76 @@ msgid "" "if you want." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:74 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:91 +msgid "Let's take a second to see what we have in the starter assets." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:93 msgid "" -"While we still have the project settings open, quickly go check if MSAA " -"(MultiSample Anti-Aliasing) is turned off. We want to make sure MSAA is off " -"because otherwise we will get strange red lines between the tiles in our " -"level later." +"Included in the starter assets are several scenes. For example, in `res://` " +"we have 14 scenes, most of which we will be visiting as we go through this " +"tutorial series." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:78 -msgid "" -"The reason we get those red lines is because we are using lowpoly models " -"with low resolution textures. MSAA tries to reduce jagged edges between " -"models and because we are using lowpoly and low resolution textures in this " -"project, we need to turn it off to avoid texture bleeding." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:83 -msgid "A bonus with turning off MSAA is we get a more 'retro' looking result." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:87 -msgid "Lets take a second to see what we have in the starter assets." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:89 -msgid "" -"Included in the starter assets are five scenes: ``BulletScene.tscn``, " -"``Player.tscn``, ``SimpleAudioPlayer.tscn``, ``TestingArea.tscn``, and " -"``TestLevel.tscn``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:92 -msgid "" -"We will visit all of these scenes later, but for now open up ``Player.tscn``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:94 -msgid "" -"There are a bunch of scenes and a few textures in the ``Assets`` folder. You " -"can look at these if you want, but we will not be directly using them in " -"this tutorial." +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:96 +msgid "For now let's open up ``Player.tscn``." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:98 +msgid "" +"There are a bunch of scenes and a few textures in the ``Assets`` folder. You " +"can look at these if you want, but we will not be exploring through " +"``Assets`` in this tutorial series. ``Assets`` contains all of the models " +"used for each of the levels, as well as some textures and materials." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:103 msgid "Making the FPS movement logic" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:100 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:105 msgid "" -"Once you have ``Player.tscn`` open, let's take a quick look at how it is " -"setup" +"Once you have ``Player.tscn`` open, let's take a quick look at how it is set " +"up" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:104 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:109 msgid "" -"First, notice how the player's collision shapes are setup. Using a vertical " +"First, notice how the player's collision shapes are set up. Using a vertical " "pointing capsule as the collision shape for the player is fairly common in " "most first person games." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:107 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:112 msgid "" "We are adding a small square to the 'feet' of the player so the player does " "not feel like they are balancing on a single point." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:110 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:115 +msgid "" +"We do want the 'feet' slightly higher than the bottom of the capsule so we " +"can roll over slight edges. Where to place the 'feet' is dependent on your " +"levels and how you want your player to feel." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:118 msgid "" "Many times player will notice how the collision shape being circular when " "they walk to an edge and slide off. We are adding the small square at the " "bottom of the capsule to reduce sliding on, and around, edges." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:114 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:122 msgid "" "Another thing to notice is how many nodes are children of " -"``Rotation_helper``. This is because ``Rotation_helper`` contains all of the " +"``Rotation_Helper``. This is because ``Rotation_Helper`` contains all of the " "nodes we want to rotate on the ``X`` axis (up and down). The reason behind " -"this is so we rotate ``Player`` on the ``Y`` axis, and ``Rotation_helper`` " -"on the ``X`` axis." +"this is so we can rotate ``Player`` on the ``Y`` axis, and " +"``Rotation_helper`` on the ``X`` axis." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:119 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:127 msgid "" "If we did not use ``Rotation_helper`` then we'd likely have cases where we " "are rotating both the ``X`` and ``Y`` axes at the same time. This can lead " @@ -38340,221 +40454,283 @@ msgid "" "cases." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:125 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:131 +msgid "See :ref:`using transforms ` for more information" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:135 msgid "Attach a new script to the ``Player`` node and call it ``Player.gd``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:127 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:137 msgid "" -"Lets program our player by adding the ability to move around, look around " +"Let's program our player by adding the ability to move around, look around " "with the mouse, and jump. Add the following code to ``Player.gd``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:221 -msgid "This is a lot of code, so let's break it down from top to bottom:" +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:242 +msgid "This is a lot of code, so let's break it down function by function:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:225 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:244 +msgid "" +"While copy and pasting code is ill advised, as you can learn a lot from " +"manually typing the code in, you can copy and paste the code from this page " +"directly into the script editor." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:247 +msgid "" +"If you do this, all of the code copied will be using spaces instead of tabs." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:249 +msgid "" +"To convert the spaces to tabs in the script editor, click the \"edit\" menu " +"and select \"Convert Indent To Tabs\". This will convert all of the spaces " +"into tabs. You can select \"Convert Indent To Spaces\" to convert t back " +"into spaces." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:254 msgid "" "First, we define some global variables to dictate how our player will move " "about the world." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:227 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:256 msgid "" -"Throughout this tutorial, *variables defined outside functions will be " -"referred to as \"global variables\"*. This is because we can access any of " +"Throughout this tutorial, **variables defined outside functions will be " +"referred to as \"global variables\"**. This is because we can access any of " "these variables from any place in the script. We can \"globally\" access " "them, hence the name." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:232 -msgid "Lets go through each of the global variables:" +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:261 +msgid "Let's go through each of the global variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:234 -msgid "``norm_grav``: How strong gravity pulls us down while we are walking." +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:263 +msgid "``GRAV``: How strong gravity pulls us down." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:235 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:264 msgid "``vel``: Our :ref:`KinematicBody `'s velocity." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:236 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:265 msgid "" "``MAX_SPEED``: The fastest speed we can reach. Once we hit this speed, we " "will not go any faster." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:237 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:266 msgid "``JUMP_SPEED``: How high we can jump." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:238 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:267 msgid "" "``ACCEL``: How fast we accelerate. The higher the value, the faster we get " "to max speed." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:239 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:268 msgid "" "``DEACCEL``: How fast we are going to decelerate. The higher the value, the " "faster we will come to a complete stop." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:240 -msgid "``MAX_SLOPE_ANGLE``: The steepest angle we can climb." +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:269 +msgid "" +"``MAX_SLOPE_ANGLE``: The steepest angle our :ref:`KinematicBody " +"` will consider as a 'floor'." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:241 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:270 msgid "``camera``: The :ref:`Camera ` node." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:242 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:271 msgid "" "``rotation_helper``: A :ref:`Spatial ` node holding " "everything we want to rotate on the X axis (up and down)." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:243 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:272 msgid "" "``MOUSE_SENSITIVITY``: How sensitive the mouse is. I find a value of " "``0.05`` works well for my mouse, but you may need to change it based on how " "sensitive your mouse is." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:244 -msgid "" -"``flashlight``: A :ref:`Spotlight ` node that will act as " -"our player's flashlight." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:246 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:274 msgid "" "You can tweak many of these variables to get different results. For example, " -"by lowering ``normal_gravity`` and/or increasing ``JUMP_SPEED`` you can get " -"a more 'floaty' feeling character. Feel free to experiment!" +"by lowering ``GRAVITY`` and/or increasing ``JUMP_SPEED`` you can get a more " +"'floaty' feeling character. Feel free to experiment!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:252 -msgid "Now lets look at the ``_ready`` function:" +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:278 +msgid "" +"You may have noticed that ``MOUSE_SENSITIVITY`` is written in all caps like " +"the other constants, but is ``MOUSE_SENSITIVITY`` is not a constant." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:254 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:280 +msgid "" +"The reason behind this is we want to treat it like a constant variable (a " +"variable that cannot change) throughout our script, but we want to be able " +"to change the value later when we add customizable settings. So, in an " +"effort to remind ourselves to treat it like a constant, it's named in all " +"caps." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:285 +msgid "Now let's look at the ``_ready`` function:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:287 msgid "" "First we get the ``camera`` and ``rotation_helper`` nodes and store them " -"into their variables. Then we need to set the mouse mode to captured." +"into their variables." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:257 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:289 +msgid "" +"Then we need to set the mouse mode to captured so the mouse cannot leave the " +"game window." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:291 msgid "" "This will hide the mouse and keep it at the center of the screen. We do this " "for two reasons: The first reason being we do not want to the player to see " -"their mouse cursor as they play. The second reason is because we do not want " -"the cursor to leave the game window. If the cursor leaves the game window " -"there could be instances where the player clicks outside the window, and " -"then the game would lose focus. To assure neither of these issues happen, we " -"capture the mouse cursor." +"their mouse cursor as they play." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:263 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:294 +msgid "" +"The second reason is because we do not want the cursor to leave the game " +"window. If the cursor leaves the game window there could be instances where " +"the player clicks outside the window, and then the game would lose focus. To " +"assure neither of these issues happen, we capture the mouse cursor." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:298 msgid "" "see :ref:`Input documentation ` for the various mouse modes. We " "will only be using ``MOUSE_MODE_CAPTURED`` and ``MOUSE_MODE_VISIBLE`` in " "this tutorial series." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:266 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:303 +msgid "Next let's take a look at ``_physics_process``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:305 msgid "" -"We need to use ``_input`` so we can rotate the player and camera when there " -"is mouse motion." +"All we're doing in ``_physics_process`` is calling two functions: " +"``process_input`` and ``process_movement``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:271 -msgid "Next is ``_physics_process``:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:273 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:307 msgid "" -"We define a directional vector (``dir``) for storing the direction the " -"player intends to move." +"``process_input`` will be where we store all of the code relating to player " +"input. We want to call it first before anything else so we have fresh player " +"input to work with." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:275 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:310 +msgid "" +"``process_movement`` is where we'll send all of the date necessary to the :" +"ref:`KinematicBody ` so it can move through the game " +"world." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:315 +msgid "Let's look is ``process_movement`` next:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:317 +msgid "First we set ``dir`` to an empty :ref:`Vector3 `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:319 +msgid "" +"``dir`` will be used for storing the direction the player intends to move " +"towards. Because we do not want the player's previous input to effect the " +"player beyond a single ``process_movement`` call, we reset ``dir``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:322 msgid "" "Next we get the camera's global transform and store it as well, into the " "``cam_xform`` variable." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:277 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:324 msgid "" -"Now we check for directional input. If we find that the player is moving, we " -"get the ``camera``'s directional vector in the direction we are wanting to " -"move towards and add (or subtract) it to ``dir``." +"The reason we need the camera's global transform is so we can use it's " +"directional vectors. Many have found directional vectors confusing, so let's " +"take a second to explain how they work:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:280 -msgid "" -"Many have found directional vectors confusing, so lets take a second to " -"explain how they work:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:284 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:329 msgid "" "World space can be defined as: The space in which all objects are placed in, " "relative to a constant origin point. Every object, no matter if it is 2D or " "3D, has a position in world space." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:287 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:332 msgid "" "To put it another way: world space is the space in a universe where every " "object's position, rotation, and scale can be measured by a known, fixed " "point called the origin." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:290 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:335 msgid "" "In Godot, the origin is at position ``(0, 0, 0)`` with a rotation of ``(0, " "0, 0)`` and a scale of ``(1, 1, 1)``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:292 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:337 msgid "" "When you open up the Godot editor and select a :ref:`Spatial " "` based node, a gizmo pops up. Each of the arrows points " "using world space directions by default." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:295 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:340 msgid "" "If you want to move using the world space directional vectors, you'd do " "something like this:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:308 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:353 msgid "" "Notice how we do not need to do any calculations to get world space " "directional vectors. We can just define a few :ref:`Vector3 ` " "variables and input the values pointing in each direction." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:311 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:356 msgid "Here is what world space looks like in 2D:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:313 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:358 msgid "" "The following images are just examples. Each arrow/rectangle represents a " "directional vector" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:317 -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:360 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:362 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:405 msgid "And here is what it looks like for 3D:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:321 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:366 msgid "" "Notice how in both examples, the rotation of the node does not change the " "directional arrows. This is because world space is a constant. No matter how " @@ -38562,13 +40738,13 @@ msgid "" "the same direction*." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:325 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:370 msgid "" "Local space is different, because it takes the rotation of the object into " "account." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:327 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:372 msgid "" "Local space can be defined as follows: The space in which a object's " "position is the origin of the universe. Because the position of the origin " @@ -38576,44 +40752,44 @@ msgid "" "with the position of the origin." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:332 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:377 msgid "" "This stack overflow question has a much better explanation of world space " "and local space." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:334 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:379 msgid "" "https://gamedev.stackexchange.com/questions/65783/what-are-world-space-and-" "eye-space-in-game-development (Local space and eye space are essentially the " "same thing in this context)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:337 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:382 msgid "" "To get a :ref:`Spatial ` node's local space, we need to get " "its :ref:`Transform `, so then we can get the :ref:`Basis " "` from the :ref:`Transform `." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:340 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:385 msgid "" "Each :ref:`Basis ` has three vectors: ``X``, ``Y``, and ``Z``. " "Each of those vectors point towards each of the local space vectors coming " "from that object." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:343 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:388 msgid "" "To use the a :ref:`Spatial ` node's local directional " "vectors, we use this code:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:356 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:401 msgid "Here is what local space looks like in 2D:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:364 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:409 msgid "" "Here is what the :ref:`Spatial ` gizmo shows when you are " "using local space mode. Notice how the arrows follow the rotation of the " @@ -38621,14 +40797,14 @@ msgid "" "space." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:368 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:413 msgid "" "You can change between local and world space modes by pressing the little " "cube button when you have a :ref:`Spatial ` based node " "selected." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:373 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:418 msgid "" "Local vectors are confusing even for more experienced game developers, so do " "not worry if this all doesn't make a lot of sense. The key thing to remember " @@ -38637,26 +40813,61 @@ msgid "" "give direction from the world's point of view." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:379 -msgid "Back to ``_physics_process``:" +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:424 +msgid "Okay, back to ``process_input``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:381 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:426 msgid "" -"When the player pressed any of the directional movement actions, we get the " -"local vector pointing in that direction and add it to ``dir``." +"Next we make a new variable called ``input_movement_vector`` and assign it " +"to an empty :ref:`Vector2 `. We will use this to make a " +"virtual axis of sorts so map the player's input to movement." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:384 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:429 msgid "" -"Because the camera is rotated by ``-180`` degrees, we have to flip the " -"directional vectors. Normally forward would be the positive Z axis, so using " +"This may seem overkill for just the keyboard, but this will make sense later " +"when we add joypad input." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:431 +msgid "" +"Based on which directional movement action is pressed, we add or remove from " +"``input_movement_vector``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:433 +msgid "" +"After we've checked each of the directional movement actions, we normalize " +"``input_movement_vector``. This makes it where ``input_movement_vector``'s " +"values are within a ``1`` radius unit circle." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:436 +msgid "" +"Next we add the camera's local ``Z`` vector times ``input_movement_vector." +"y`` to ``dir``. This where when we pressed forward or backwards we add the " +"camera's local ``Z`` axis, so we move forward in relation to the camera." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:439 +msgid "" +"Because the camera is rotated by ``-180`` degrees, we have to flip the ``Z`` " +"directional vector. Normally forward would be the positive Z axis, so using " "``basis.z.normalized()`` would work, but we are using ``-basis.z." "normalized()`` because our camera's Z axis faces backwards in relation to " "the rest of the player." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:389 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:444 +msgid "" +"We do the same thing for the camera's local ``X`` vector, and instead of " +"using ``input_movement_vector.y`` we instead use ``input_movement_vector." +"x``. This makes it where when we press left or right, we move left/right in " +"relation to the camera." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:447 msgid "" "Next we check if the player is on the floor using :ref:`KinematicBody " "`'s ``is_on_floor`` function. If it is, then we check " @@ -38664,128 +40875,174 @@ msgid "" "then we set our ``Y`` velocity to ``JUMP_SPEED``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:393 -msgid "" -"Next we check if the flash light action was just pressed. If it was, we then " -"check if the flash light is visible, or hidden. If it is visible, we hide " -"it. If it is hidden, we make it visible." +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:451 +msgid "Because we're setting the Y velocity, we will jump into the air." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:396 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:453 msgid "" -"Next we assure that our movement vector does not have any movement on the " -"``Y`` axis, and then we normalize it. We set a variable to our normal " -"gravity and apply that gravity to our velocity." +"Then we check for the ``ui_cancel`` action. This is so we can free/capture " +"the mouse cursor when the ``escape`` button is pressed. We do this because " +"otherwise we'd have no way to free the cursor, meaning it would be stuck " +"until you terminate the runtime." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:399 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:457 +msgid "" +"To free/capture the cursor, we check to see if the mouse is visible (freed) " +"or not. If it is, then we capture it, and if it's not we make it visible " +"(free it)." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:459 +msgid "" +"That's all we're doing right now for ``process_input``. We'll come back " +"several times to this function as we add more complexities to our player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:463 +msgid "Now let's look at ``process_movement``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:465 +msgid "" +"First we assure that ``dir`` does not have any movement on the ``Y`` axis by " +"setting it's ``Y`` value to zero." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:467 +msgid "" +"Next we normalize ``dir`` to assure we're within a ``1`` radius unit circle. " +"This makes it where we're moving at a constant speed regardless of whether " +"we've moving straight, or moving diagonal. If we did not normalize, we would " +"move faster on the diagonal than when we're going straight." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:470 +msgid "" +"Next we add gravity to our player by adding ``GRAVITY * delta`` to our ``Y`` " +"velocity." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:472 msgid "" "After that we assign our velocity to a new variable (called ``hvel``) and " -"remove any movement on the ``Y`` axis. Next we set a new variable " -"(``target``) to our direction vector. Then we multiply that by our max speed " -"so we know how far we will can move in the direction provided by ``dir``." +"remove any movement on the ``Y`` axis." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:403 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:474 msgid "" -"After that we make a new variable for our acceleration, named ``accel``. We " -"then take the dot product of ``hvel`` to see if we are moving according to " -"``hvel``. Remember, ``hvel`` does not have any ``Y`` velocity, meaning we " -"are only checking if we are moving forwards, backwards, left, or right. If " -"we are moving, then we set ``accel`` to our ``ACCEL`` constant so we " -"accelerate, otherwise we set ``accel` to our ``DEACCEL`` constant so we " -"decelerate." +"Next we set a new variable (``target``) to our direction vector. Then we " +"multiply that by our max speed so we know how far we will can move in the " +"direction provided by ``dir``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:409 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:477 msgid "" -"Finally, we interpolate our horizontal velocity, set our ``X`` and ``Z`` " -"velocity to the interpolated horizontal velocity, and then call " +"After that we make a new variable for our acceleration, named ``accel``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:479 +msgid "" +"We then take the dot product of ``hvel`` to see if we are moving according " +"to ``hvel``. Remember, ``hvel`` does not have any ``Y`` velocity, meaning we " +"are only checking if we are moving forwards, backwards, left, or right." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:483 +msgid "" +"If we are moving according to ``hvel``, then we set ``accel`` to our " +"``ACCEL`` constant so we accelerate, otherwise we set ``accel` to our " +"``DEACCEL`` constant so we decelerate." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:486 +msgid "" +"Then we interpolate our horizontal velocity, set our ``X`` and ``Z`` " +"velocity to the interpolated horizontal velocity, and call " "``move_and_slide`` to let the :ref:`KinematicBody ` " "handle moving through the physics world." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:412 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:489 msgid "" -"All of the code in ``_physics_process`` is almost exactly the same as the " -"movement code from the Kinematic Character demo! The only thing that is " -"different is how we use the directional vectors, and the flash light!" +"All of the code in ``process_movement`` is exactly the same as the movement " +"code from the Kinematic Character demo!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:415 -msgid "" -"You can optionally add some code to capture and free the mouse cursor when " -"\"ui_cancel\" is pressed. While entirely optional, it is highly recommended " -"for debugging purposes." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:420 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:493 msgid "" "The final function we have is the ``_input`` function, and thankfully it's " "fairly short:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:422 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:495 msgid "" "First we make sure that the event we are dealing with is a :ref:" "`InputEventMouseMotion ` event. We also want to " "check if the cursor is captured, as we do not want to rotate if it is not." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:425 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:498 msgid "" "See :ref:`Mouse and input coordinates ` for " "a list of possible input events." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:428 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:501 msgid "" "If the event is indeed a mouse motion event and the cursor is captured, we " -"rotate based on the mouse motion provided by :ref:`InputEventMouseMotion " -"`." +"rotate based on the relative mouse motion provided by :ref:" +"`InputEventMouseMotion `." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:431 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:504 msgid "" "First we rotate the ``rotation_helper`` node on the ``X`` axis, using the " "relative mouse motion's ``Y`` value, provided by :ref:`InputEventMouseMotion " "`." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:434 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:507 msgid "" "Then we rotate the entire :ref:`KinematicBody ` on the " "``Y`` axis by the relative mouse motion's ``X`` value." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:436 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:509 msgid "" "Godot converts relative mouse motion into a :ref:`Vector2 ` " "where mouse movement going up and down is ``1`` and ``-1`` respectively. " "Right and Left movement is ``1`` and ``-1`` respectively." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:440 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:513 msgid "" "Because of how we are rotating the player, we multiply the relative mouse " "motion's ``X`` value by ``-1`` so mouse motion going left and right rotates " "the player left and right in the same direction." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:444 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:517 msgid "" "Finally, we clamp the ``rotation_helper``'s ``X`` rotation to be between " "``-70`` and ``70`` degrees so we cannot rotate ourselves upside down." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:449 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:520 msgid "" -"To test the code open up the scene named ``Testing_Area.tscn`` if it's not " +"see :ref:`using transforms ` for more information on " +"rotating transforms." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:524 +msgid "" +"To test the code open up the scene named ``Testing_Area.tscn``, if it's not " "already opened up. We will be using this scene as we go through the " "tutorial, so be sure to keep it open in one of your scene tabs." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:452 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:527 msgid "" "Go ahead and test your code either by pressing ``F4`` with ``Testing_Area." "tscn`` as the open tab, by pressing the play button in the top right corner, " @@ -38793,89 +41050,143 @@ msgid "" "air, and look around using the mouse." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:457 -msgid "Giving the player the option to sprint" +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:533 +msgid "Giving the player a flash light and the option to sprint" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:459 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:535 msgid "" -"Before we get to making the weapons work, there is one more thing we should " -"add. Many FPS games have an option to sprint, and we can easily add " -"sprinting to our player, so let's do that!" +"Before we get to making the weapons work, there is a couple more things we " +"should add." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:463 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:537 +msgid "" +"Many FPS games have an option to sprint and a flash light. We can easily add " +"these to our player, so let's do that!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:540 msgid "First we need a few more global variables in our player script:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:471 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:550 msgid "" -"All of these variables work exactly the same as the non sprinting variables " -"with similar names. The only that's different is ``is_sprinting``, which is " -"a boolean to track whether the player is currently sprinting." +"All of the sprinting variables work exactly the same as the non sprinting " +"variables with similar names." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:475 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:553 msgid "" -"Now we just need to change some of the code in our ``_physics_process`` " -"function so we can add the ability to sprint." +"``is_sprinting`` is a boolean to track whether the player is currently " +"sprinting, and ``flashlight`` is a variable we will be using to hold our " +"flash light node." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:478 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:556 msgid "" -"The first thing we need to do is add the following code, preferably by the " -"other input related code:" +"Now we just need to add a few lines of code, starting in ``_ready``. Add the " +"following to ``_ready``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:488 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:562 msgid "" -"This will set ``is_sprinting`` to true when we are holding down the " +"This gets our flash light node and assigns it to the ``flashlight`` variable." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:566 +msgid "" +"Now we need to change some of the code in ``process_input``. Add the " +"following somewhere in ``process_input``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:587 +msgid "Let's go over the additions:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:589 +msgid "" +"We set ``is_sprinting`` to true when we are holding down the " "``movement_sprint`` action, and false when the ``movement_sprint`` action is " -"released." +"released. In ``process_movement`` we'll add the code that makes the player " +"faster when they sprint. Here in ``process_input`` we're just going to " +"change the ``is_sprinting`` variable." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:491 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:593 msgid "" -"Next we need to set our max speed to the higher speed if we are sprinting, " -"and we also need to change our acceleration to the new acceleration:" +"We do something similar freeing/capturing the cursor for handling the flash " +"light. We first check to see if the ``flashlight`` action was just pressed. " +"If it was, we then check to see if ``flashlight`` is visible in the scene " +"tree. If it is, then we hide it, and if it's not we show it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:514 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:598 msgid "" -"Now you should be able to sprint if you press the shift button! Go give it a " -"whirl! You can change the sprint related global variables to make the player " -"faster when sprinting!" +"Now we just need to change a couple things in ``process_movement``. First, " +"replace ``target *= MAX_SPEED`` with the following:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:517 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:607 +msgid "" +"Now instead of always multiplying ``target`` by ``MAX_SPEED``, we first " +"check to see if we are sprinting or not. If we are sprinting, we instead " +"multiply ``target`` by ``MAX_SPRINT_SPEED``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:610 +msgid "" +"Now all that's left is changing the accleration when sprinting. Change " +"``accel = ACCEL`` to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:620 +msgid "" +"Now when we are sprinting we'll use ``SPRINT_ACCEL`` instead of ``ACCEL``, " +"which will accelerate us faster." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:624 +msgid "" +"You should now be able to sprint if you press the ``shift`` button, and can " +"toggle the flash light on and off by pressing the ``F`` button!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:626 +msgid "" +"Go give it a whirl! You can change the sprint related global variables to " +"make the player faster or slower when sprinting!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:633 msgid "" "Phew! That was a lot of work. Now you have a fully working first person " "character!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:519 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:635 msgid "" "In :ref:`doc_fps_tutorial_part_two` we will add some guns to our player " "character." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:521 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:637 msgid "" -"At this point we've recreated the Kinematic character demo with sprinting!" +"At this point we've recreated the Kinematic character demo from first person " +"perspective with sprinting and a flash light!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:523 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:639 msgid "" "Currently the player script would be at an ideal state for making all sorts " "of first person games. For example: Horror games, platformer games, " "adventure games, and more!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:526 +#: ../../docs/tutorials/3d/fps_tutorial/part_one.rst:644 msgid "" -"If you ever get lost, be sure to read over the code again! You can also " -"download the finished project at the bottom of :ref:" -"`doc_fps_tutorial_part_three`." +"You can download the finished project for this part here: :download:" +"`Godot_FPS_Part_1.zip `" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:4 @@ -38884,1323 +41195,268 @@ msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:9 msgid "" -"In this part we will be refactoring ``Player.gd`` to use a more modular " -"format, add support for joypads, and add the ability to change weapons with " -"the scroll wheel." +"In this part we will be adding health pick ups, ammo pick ups, targets we " +"can destroy, add support for joypads, and add the ability to change weapons " +"with the scroll wheel." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:13 msgid "" -"While this part may not be the most interesting, it is very important. " -"Having a clean and modular code base allows us to build more complex " -"behaviour in the future." +"You are assumed to have finished :ref:`doc_fps_tutorial_part_three` before " +"moving on to this part of the tutorial." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:16 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:15 msgid "" -"You are assumed to have finished :ref:`part three " -"` before moving on to this part of the tutorial." +"The finished project from :ref:`doc_fps_tutorial_part_three` will be the " +"starting project for part 4" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:18 -msgid "" -"You can find the completed code for part three here: https://github.com/" -"TwistedTwigleg/Godot_FPS_Tutorial/tree/part_3" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:22 -msgid "" -"Just click the green \"Clone or download\" button and choose \"Download Zip" -"\" to get the finished project for part 3." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:28 -msgid "A quick note" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:30 -msgid "" -"Before we dig into refactoring the code, let's quickly talk about *why* we " -"want to refactor the code." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:32 -msgid "First, what is refactoring? According to wikipedia:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:34 -msgid "" -"**\"Code refactoring is the process of restructuring existing computer code—" -"changing the factoring—without changing its external behaviour.\"**" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:36 -msgid "" -"Basically, refactoring is taking code we've already written, and rewriting/" -"restructuring it without changing what it does." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:38 -msgid "" -"Second, why refactor? There are plenty of reasons why you may want to " -"refactor your code base, but for this tutorial there is really only three " -"major reasons:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:41 -msgid "" -"1: By refactoring the code base we can take out certain elements from the " -"various functions in ``player.gd`` and separate them into their own " -"functions/scripts. ``_physics_process`` benefits greatly from this, because " -"while it does work right now, it is very confusing to navigate." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:44 -msgid "" -"2: With some careful refactoring, we can take out most of the gun logic from " -"``Player.gd`` and put them into their own scripts. This is key because it " -"easily allows us to make/edit weapons and their behaviours without having to " -"change much in ``Player.gd``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:47 -msgid "" -"3: Currently performance in ``Player.gd`` is okay, but with some work we can " -"make it even better! Performance was not a primary concern for the first " -"three parts of this tutorial series, and while it still is not a major " -"concern, we ideally want to write code with good performance when possible." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:50 -msgid "All of these reasons are why we are going to refactor ``Player.gd``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:52 -msgid "" -"What we plan on doing in this part is taking our very linear ``Player.gd`` " -"script and make it more modular and extendible. This will allow us to more " -"easily add features later, as well as make it easier to work with in later " -"parts." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:55 -msgid "" -"Even though part 4 is dedicated to refactoring ``Player.gd``, it is likely " -"we will need to do more refactoring in later parts as we continue to add " -"features!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:59 -msgid "Breaking it down" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:61 -msgid "" -"Current a majority of the code in ``Player.gd`` is located in " -"``_physics_process``. Right now ``_physics_process`` is a huge function with " -"several works parts. With some refactoring, we can break " -"``_physics_process`` into several smaller functions." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:64 -msgid "" -"Ideally we want to make these smaller functions focused on doing a small set " -"of tasks. This makes it much easier to know where we need to add code to " -"when we are working on new features." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:67 -msgid "" -"Another benefit of using smaller functions is they are generally easier to " -"debug!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:70 -msgid "Breaking down input processing" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:72 -msgid "" -"First, lets make a function for handling all of the :ref:`Input " -"` related code. This allows us to more clearly see all of our " -"player input." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:75 -msgid "Create new function called `process_input` and add the following code:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:193 -msgid "" -"You may have noticed that all of the code so far is exactly the same as the :" -"ref:`Input ` relate code already written in " -"``_physics_process``, but is now all placed in one function." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:196 -msgid "There are a few changes though:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:198 -msgid "" -"Because we are now calling our input code outside of ``_physics_process`` we " -"need to change ``dir`` from a local variable to a global variable. Add ``var " -"dir = Vector3()`` with the rest of the global variables, ideally nearby the " -"movement code for organization." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:201 -msgid "Do not forget to change ``dir`` to a global variable!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:203 -msgid "" -"Another change is we're not directly effecting ``dir`` any more. Before we " -"were changing ``dir`` when a movement action was pressed. Now we are " -"changing a new local variable, ``input_movement_vector``, instead. This will " -"later allow us to have more than one form of directional input. By " -"multiplying ``input_movement_vector`` by the camera's directional vectors, " -"we get the same result as when we were effecting ``dir`` directly." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:207 -msgid "" -"Notice how we are normalizing ``input_movement_vector`` as well. This is " -"important because later when we add additional forms of directional input, " -"we do not want to move faster if two forms of input are moving at the same " -"time. For example, we do not want to move faster if we are pressing the " -"``UP`` key on the keyboard and also are pushing forward on a controller. If " -"we did not normalize, then we'd move twice as fast! By normalizing, we make " -"everyone move at the same speed, regardless of how many input devices they " -"are using." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:213 -msgid "Breaking down ``KinematicBody`` movement" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:215 -msgid "" -"Next we want to move all of the code relating to moving using the :ref:" -"`KinematicBody ` into its own function. This allows us " -"to more clearly see what code we are sending :ref:`KinematicBody " -"` and what it does." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:218 -msgid "" -"Create a new function and call it ``process_movement``. Lets add the " -"following code:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:253 -msgid "" -"Thankfully nothing is has changed here, all we've done is moved the code out " -"of ``_physics_process``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:255 -msgid "" -"If you are using Godot ``master`` branch (or Godot 3.1), you will need to " -"change ``vel = move_and_slide(vel,Vector3(0,1,0), 0.05, 4, " -"deg2rad(MAX_SLOPE_ANGLE))`` to ``vel = move_and_slide(vel,Vector3(0,1,0), " -"true, 0.05, 4, deg2rad(MAX_SLOPE_ANGLE))``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:258 -msgid "" -"Now when we are ready to have the :ref:`KinematicBody ` " -"process our movement and send us through space, all we need to do is call " -"``process_movement``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:262 -msgid "Changing the weapon code structure" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:264 -msgid "" -"So far, we have not really changed the structure of the code, we've just " -"shuffled it around, so lets change that." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:266 -msgid "" -"One of the major things we ideally want to change is how the weapon code is " -"handled. Currently all of the weapon realted code is all in ``Player.gd``, " -"everything from how much ammo a weapon carries, to firing bullets. While " -"this has the advantage of having all of your code in one place, it would be " -"much nicer if we make a weapon interface so we can create/change weapons " -"easily without having to scroll through ``Player.gd`` to look for the bit of " -"code we want to add/change." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:270 -msgid "" -"Open up ``Player.tscn`` and navigate to the ``Gun_fire_points`` node. Lets " -"make the pistol first. Select ``Pistol_point`` and attach a node and call it " -"``Weapon_Pistol.gd``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:273 -msgid "" -"Our weapon scripts are going to do four things: They're going to handle " -"*firing*, *reloading*, *equipping*, and *unequipping*." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:275 -msgid "Add the following code to ``Weapon_Pistol.gd``:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:366 -msgid "Lets go over what is happening in this script:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:370 -msgid "First lets look at the constants and go over what each will do:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:372 -msgid "``ammo_in_weapon``: How much ammo is *currently* in this weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:373 -msgid "" -"``spare_ammo``: How much spare ammo we have in reserve for this weapon. " -"``spare_ammo + ammo_in_weapon = total ammo for this weapon``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:374 -msgid "" -"``AMMO_IN_MAG``: The amount ammo needed to fill the weapon. To put it " -"another way, the amount of ammo in each magazine." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:375 -msgid "``DAMAGE``: The amount of damage a single bullet does." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:376 -msgid "" -"``CAN_RELOAD``: A boolean for tracking whether this weapon has the ability " -"to reload." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:377 -msgid "" -"``RELOADING_ANIM_NAME``: The name of the reloading animation for this weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:378 -msgid "``IDLE_ANIM_NAME``: The name of the idle animation for this weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:379 -msgid "``FIRE_ANIM_NAME``: The name of the firing animation for this weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:380 -msgid "" -"``is_weapon_enabled``: A boolean for tracking whether or not this weapon is " -"the currently used/enabled weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:381 -msgid "" -"``bullet_scene``: The bullet scene we created in part 2 of this tutorial." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:382 -msgid "``player_node``: The player node and script (``Player.gd``)." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:386 -msgid "Notice how we do not do anything in ``_ready``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:388 -msgid "" -"We could try and grab the player node here, but it makes a messy " -"``get_node`` call, and because we already have to aim these points in " -"``Player.gd`` anyway, we will just pass the player node then." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:391 -msgid "" -"This is just a design choice. Depending on your project, it may be better to " -"use ``get_node`` in the weapon scripts." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:396 -msgid "Lets look at ``fire_weapon``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:398 -msgid "" -"First we make a clone of the bullet scene and add it as a child of the scene " -"root. Next we set its global transform to ``self.global_transform``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:401 -msgid "" -"before we were using a ``get_node`` call to get here because we were calling " -"this from ``Player.gd``. Now that we are firing from the fire point itself, " -"we do not need to use ``get_node`` any more." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:405 -msgid "" -"Then we set its scale. As before, the bullet object is too small by default, " -"so we scale it up so it's easier to see." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:407 -msgid "" -"Next we set its damage. This is new, but nothing crazy. To make this work, " -"we just need to go into ``Bullet_script.gd`` and change ``const " -"BULLET_DAMAGE`` to ``var BULLET_DAMAGE``. The reason behind changing " -"``BULLET_DAMAGE`` from a constant to a normal variable is because we may " -"reuse the bullet object later (for a different weapon)" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:411 -msgid "" -"Do not forgot to change ``const BULLET_DAMAGE`` to ``var BULLET_DAMAGE`` in " -"``Bullet_script.gd``!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:413 -msgid "" -"Then we remove one from the ammo in our weapon and play a sound (if we have " -"sounds)." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:415 -msgid "" -"With the exception of how we are no longer using ``get_node``, everything in " -"``fire_weapon`` is the same as the code as ``Player.gd``'s ``fire_bullet`` " -"function." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:420 -msgid "In ``reload_weapon`` we are doing things a little differently." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:422 -msgid "" -"First we define a variable to track whether or not we can reload. We then do " -"a couple checks. The first check is checking whether or not we are in this " -"weapon's idle animation. We do not want to reload while we are playing any " -"other animation, so this check ensures that does not happen." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:426 -msgid "" -"The next thing we check is whether or not we have any ammo in reserve and/or " -"if our weapon is full. We cannot reload with no spare ammo, and we do not " -"want the player to be able to reload if the weapon is already full." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:429 -msgid "" -"In some games you can reload while full. Many times in these cases you lose " -"whatever ammo was in the weapon when you reload. For this tutorial though, " -"we will only allow the player to reload if they do not have a full weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:432 -msgid "Then we check ``can_reload`` to see if it is true." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:434 -msgid "If it is, we then calculate how much ammo we need to fill the weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:436 -msgid "" -"If we have enough ammo in spares to fill the weapon, we remove the ammo we " -"are taking from spares and set ``ammo_in_weapon`` to however much ammo is in " -"a full weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:438 -msgid "" -"If we do not have enough ammo in spares, we instead add all of the ammo left " -"in spares and then set our spare ammo to zero." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:440 -msgid "" -"We then play the reloading animation and play a sound. We return ``true`` to " -"signal we have successfully reloaded." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:442 -msgid "" -"If we cannot reload because ``reload_weapon`` is ``false``, we return " -"``false`` to signal we did not successfully reload." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:446 -msgid "" -"For ``equip_weapon`` we first check if the player is in the pistol's idle " -"state." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:448 -msgid "" -"If we are in the pistol's idle state we've successfully equipped the pistol. " -"We set ``is_weapon_enabled`` to ``true`` because we are now using this " -"weapon, and return ``true``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:451 -msgid "" -"We need ``is_weapon_enabled`` so we do not keep trying to equip/unequip the " -"weapons over and over again. If we relied only on using the ``equip_weapon``/" -"``unequip_weapon`` functions, we could possibility get cases where we are " -"stuck in a loop where we are equipping/unequipping the same weapon over and " -"over again." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:455 -msgid "" -"Next we check if we are in the idle unarmed state, a state where we can " -"transition to our equip animation. If we are, then we change the animation " -"to ``Pistol_equip`` and play a sound. Finally, we return ``false``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:458 -msgid "" -"The reason behind returning ``false`` unless we are in our idle animation is " -"because we will be calling this function more than once, checking to see if " -"we have successfully equipped the pistol." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:463 -msgid "" -"``unequip_weapon`` is extremely similar to ``equip_weapon``, but the checks " -"are in reverse." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:465 -msgid "" -"We just check if we are in our idle state. If we are, and we are not already " -"unequipping we set our animation to ``Pistol_unequip``. Then we check if we " -"are in the idle animation. If we are, we set ``is_weapon_enabled`` to " -"``false`` because we are no longer using this weapon, and return ``true``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:468 -msgid "Finally, if we did not return ``true``, we return false." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:470 -msgid "" -"As with ``equip_weapon``, we want to return false by default because we will " -"be calling this function until it returns true." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:474 -msgid "Now we just need to do the same thing for the knife and the rifle." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:476 -msgid "" -"There is only one minor difference with the knife and the rifle. We still " -"define a reload function for the knife, but instead of doing anything we " -"automatically return false." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:479 -msgid "" -"Select ``Knife_point``, created a new script called ``Weapon_Knife.gd``, and " -"add the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:536 -msgid "There are only a few things to note here." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:538 -msgid "" -"The first is we still are defining ``ammo_in_weapon``, ``spare_ammo`` and " -"``AMMO_IN_MAG``. The reason behind this is so our code has a consistent " -"interface. We may later need to access these variables in all weapons, so we " -"are adding them for the knife as a way assure all weapons have these " -"variables." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:541 -msgid "" -"The second thing of note is in ``reload_weapon``. Because we cannot reload a " -"knife (or at least, not this one), we just always return ``false``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:543 -msgid "" -"The last thing to note is how ``fire_weapon``'s code is exactly the same as " -"the code from ``Player.gd``. The firing code for all three weapons, the " -"pistol, rifle, and knife, are exactly the same as the code in ``Player.gd``. " -"The only differences is how we are accessing the spawn point nodes and their " -"children." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:549 -msgid "" -"Finally, select ``Rifle_point``, create a new script called ``Weapon_Rifle." -"gd``, and add the following code:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:637 -msgid "" -"Thankfully the code for the rifle is exactly the same as the pistol, with " -"``fire_weapon`` changed to use the rifle's firing code. Other than that, " -"everything is exactly the same, just adjusted for the rifle." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:641 -msgid "Finishing refactoring ``Player.gd``" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:643 -msgid "" -"Now we are ready to use our newly refactored weapons in ``Player.gd``. " -"First, we need to change some of the global variables. Find all of the " -"constants relating to the weapons, delete them, and add the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:656 -msgid "Lets go over each of these new global variables:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:658 -msgid "``current_weapon_name``: The name of the weapon currently in use." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:659 -msgid "" -"``weapons``: A dictionary holding all of the weapon nodes, allowing us to " -"access them by name instead of using ``get_node``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:660 -msgid "" -"``weapon_number_to_name``: A dictionary holding all of the weapons and which " -"number they represent." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:661 -msgid "" -"``weapon_name_to_number``: A dictionary holding all of the weapons numbers " -"and which names they represent. Combined with ``weapon_number_to_name``, we " -"can change from number to name and back." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:662 -msgid "" -"``changing_weapon``: A boolean to track whether we are trying to change " -"weapons or not." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:663 -msgid "" -"``changing_weapon_name``: The name of the weapon we are trying to change to." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:664 -msgid "" -"``reloading_weapon``: A boolean to track whether we are reloading or not." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:666 -msgid "We need to change ``_ready`` to the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:701 -msgid "Lets quickly go over the new stuff." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:703 -msgid "" -"Notice how most of the code is exactly the same as before. The only code " -"that's changed is how we are handling the gun aim points, so let's look at " -"those changes." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:706 -msgid "" -"First, we get all of the weapon nodes using ``get_node`` and assign them to " -"the ``weapons`` dictionary." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:708 -msgid "" -"Then we loop through all of the weapons in the ``weapons`` dictionary. For " -"each weapon node, we get the value assigned to that key." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:710 -msgid "" -"When we are using ``for X in Y`` where ``Y`` is a dictionary, ``X`` is " -"assigned to the each **key** in the dictionary, not the value. To get the " -"value, we have to retrieve it using ``Y[X]``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:713 -msgid "" -"If the weapon node is not ``null``, we set it's ``player_node`` variable to " -"``self``, and we make the point look at the gun aim position." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:715 -msgid "" -"The reason we check for ``null`` is because our ``UNARMED`` weapon is " -"``null``. This is just a design choice, not a requirement for FPS games. You " -"could define a \"weapon\" for the UNARMED state, but in this series we are " -"just going to use ``null``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:718 -msgid "" -"Next we flip the aim point by ``180`` degrees so it doesn't fire backwards." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:720 -msgid "" -"The reason behind rotating the gun aim point is explained in :ref:`part 2 " -"`" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:722 -msgid "" -"Finally, we set ``current_weapon_name`` and ``changing_weapon_name`` to " -"``UNARMED`` so our starting weapon is ``UNARMED``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:726 -msgid "" -"Now we need to change ``_physics_process``. Delete everything in " -"``_physics_process`` and add the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:738 -msgid "" -"You may have noticed how we have a commented out function, " -"``process_view_input``. We will be using this later! For now just leave it " -"commented out!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:741 -msgid "" -"Now we are calling each of our modular functions in order. Notice how we are " -"still missing ``process_changing_weapons``, ``process_reloading``, and " -"``process_UI``. Before we add those functions, lets quickly return to " -"``process_input``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:746 -msgid "Finishing ``process_input``" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:748 -msgid "" -"First, lets change ``process_input`` so our weapon related code works with " -"the new weapon system." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:750 -msgid "" -"First, delete all of the weapon related code in `process_input`. This is the " -"includes: Changing weapons, Reloading, and Firing." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:753 -msgid "Now at the bottom of ``process_input``, add the following code:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:821 -msgid "Lets go through what each of these sections are doing." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:825 -msgid "Lets look at the weapon changing section first." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:827 -msgid "" -"The first thing we do is get the current weapon number and assign it to " -"``weapon_change_number``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:829 -msgid "" -"Next we check each of the four number keys and we assign " -"``weapon_change_number`` to their value if they are pressed." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:831 -msgid "" -"Most keyboards go in the order of ``1234567890``, so we when we set " -"``weapon_change_number``, we offset the value by ``-1`` so the first key " -"(``1``) is actually ``0``, which is our first weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:834 -msgid "" -"Then we check if two new actions are pressed: ``shift_weapon_positive`` and " -"``shift_weapon_negative``. We will add these actions once we've finished " -"going over ``process_input``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:837 -msgid "" -"Next we clamp ``weapon_change_number`` so it cannot be higher or lower than " -"the amount of weapons we have." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:839 -msgid "" -"We are making a small assumption here: We are assuming our weapons are " -"defined in a linear pattern, where we do not have any jumps in number." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:841 -msgid "" -"Another thing to note is we are getting the maximum value using " -"``weapon_to_number.size()-1``. We remove ``1`` because ``size`` returns the " -"number of elements in the dictionary, starting from ``1``, while GDScript " -"accesses values starting from ``0``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:844 -msgid "" -"We do not want to suddenly change weapons while already changing weapons or " -"reload, so we check to make sure both variables are ``false``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:846 -msgid "" -"Then we convert ``weapon_change_number`` to a weapon name using " -"``weapon_number_to_name`` and check to make sure we not trying to change to " -"the weapon we are already using. If we are indeed changing weapons, we set " -"``changing_weapon_name`` to the name of the weapon at ``weapon_change_name`` " -"using ``weapon_number_to_name``. Finally, we set ``changing_weapon`` to true " -"so we can process the actual weapon changing logic in " -"``process_changing_weapons``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:852 -msgid "" -"For reloading we first check to make sure we are not already reload, or " -"changing weapons." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:854 -msgid "" -"Then we check to see if the reloading action has been pressed. Next we get " -"the current weapon and assign it to ``current_weapon``. If the current " -"weapon is not ``null`` we then make sure this weapon can reload using the " -"weapon's ``CAN_RELOAD`` constant." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:858 -msgid "We check for ``null`` because we do not want to reload ``UNARMED``!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:860 -msgid "" -"Next we check get the current animation state from our animation manager, " -"and we set ``is_reloading`` to ``false``. The reason we need " -"``is_reloading`` is because we need to go through each weapon and make sure " -"we are not in it's reloading state already, because we do not want to allow " -"the player to (potentially) reload if they are already in a reloading " -"animation." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:864 -msgid "" -"We then go through each weapon in our ``weapons`` dictionary. We then get " -"the weapon node, assign it to ``weapon_node`` and check to make sure it is " -"not ``null``. If it is not ``null``, we then make sure it's " -"``RELOADING_ANIM_NAME`` constant to see if it is equal to the animation we " -"are currently in. If it is, we set ``is_reloading`` to ``true``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:868 -msgid "" -"If ``is_reloading`` is still ``false``, we then set ``reloading_weapon`` to " -"true so we can process the reloading weapon logic in ``process_reloading``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:872 -msgid "Finally, we have the firing section." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:874 -msgid "" -"The first thing we do is check to see if the ``fire`` action has been " -"pressed. If it has, we then make sure we are not reloading or changing " -"weapons." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:876 -msgid "" -"Next we get the current weapon and assign it to ``current_weapon``. We then " -"check to make sure it is not equal to ``null``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:878 -msgid "" -"If the current weapon is not equal to ``null``, we then make sure the weapon " -"actually has ammo. If it does, we then check to see if we are in the " -"weapon's idle state. If we are indeed in the weapon's idle state, we set our " -"animation to the weapon's fire animation." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:881 -msgid "" -"If the current weapon does not have any ammo, we set ``reloading_weapon`` to " -"true." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:884 -msgid "Adding our new input map actions" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:886 -msgid "" -"As mentioned above, we've defined a couple new input actions: " -"``shift_weapon_positive`` and ``shift_weapon_negative``. Currently these " -"input actions do not exist in our project, so let's add them!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:891 -msgid "" -"Open up your project settings and go to the ``Input Map`` tab. In the " -"``Action`` text field, type ``shift_weapon_positive`` and press enter or " -"press the button on the side that reads ``Add``. Next write " -"``shift_weapon_negative`` and press enter or press the ``Add`` button." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:894 -msgid "" -"Scroll down to the bottom of the list and click the little plus sign next to " -"one of the newly created actions." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:898 -msgid "" -"You can assign whatever key you want to either of these actions. The " -"finished project has the ``Equal`` and ``Kp Add`` keys assigned to " -"``shift_weapon_positive``. ``shift_weapon_negative`` has ``Minus`` and ``Kp " -"Subtract`` keys assigned in the finished project." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:902 -msgid "" -"Once you've assigned whatever keys you want to both actions, close the " -"project settings and save." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:905 -msgid "Adding ``process_changing_weapons``" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:907 -msgid "" -"Lets make the weapon changing logic next. Open up ``Player.gd`` and add the " -"following function:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:943 -msgid "Lets go over what's happening here." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:945 -msgid "First we check to make sure ``changing_weapon`` is ``true``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:947 -msgid "" -"Next we make a new variable, ``weapon_unequipped``, and set it to ``false``. " -"We will use ``weapon_unequipped`` to check whether or not the current weapon " -"is unequipped. We then get the current weapon and assign it to " -"``current_weapon``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:950 -msgid "" -"If the current weapon is ``null``, if we are ``UNARMED``, we can conclude " -"the weapon has been successfully unequipped and set ``weapon_unequipped`` to " -"``true``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:952 -msgid "" -"If the weapon is not ``null``, we check if the weapon is enabled. If the " -"weapon is enabled, we call it's ``unequip_weapon`` function. If it is not " -"enabled, we set ``weapon_unequipped`` to ``true``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:954 -msgid "" -"Next we check if ``weapon_unequipped`` is ``true`` or not. Remember, " -"``weapon_unequipped`` will only be true if the current weapon's " -"``is_weapon_enabled`` variable is ``false`` (or the weapon is ``null``)." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:957 -msgid "" -"If the current weapon is successfully unequipped, we then make a variable, " -"``weapon_equipped``. ``weapon_equipped`` will serve the same function as " -"``weapon_unequipped``, but instead of tracking if we've successfully " -"unequipped the current weapon, we instead are tracking to see if the weapon " -"we are wanting to change to has been successfully equipped." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:960 -msgid "" -"We then get the weapon we want to change to and assign it to " -"``weapon_to_equip``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:962 -msgid "" -"Next we check to see if ``weapon_to_equip`` is ``null``. If it is, we set " -"``weapon_equipped`` to ``true`` because ``UNARMED`` does not need any " -"additional processing." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:964 -msgid "" -"If ``weapon_to_equip`` is not null, we then check to see if the weapon is " -"not enabled by checking it's ``is_weapon_enabled`` variable. If it is not " -"enabled, we call ``equip_weapon`` on the weapon we are wanting to equip." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:967 -msgid "" -"If the weapon we are wanting to equip is enabled, we set ``weapon_equipped`` " -"to true." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:969 -msgid "" -"Finally, we check to see if ``weapon_equipped`` is ``true``. If it is, we " -"set ``changing_weapon`` to ``false``, set ``current_weapon_name`` to the " -"weapon we have changed to (``changing_weapon_name``), and we set " -"``changing_weapon_name`` to a empty string." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:973 -msgid "Adding ``process_reloading``" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:975 -msgid "" -"Let's finish up our new modular weapon system and add ``process_reloading``. " -"Make a new function called ``process_reloading`` and add the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:987 -msgid "Let's go over what's this function does." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:989 -msgid "" -"First we check to make sure we are wanting to reload. If we are, we then get " -"the current weapon and assign it to ``current_weapon``. If " -"``current_weapon`` is not equal to ``null``, we call it's ``reload_weapon`` " -"function." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:992 -msgid "" -"Finally, we set ``reloading_weapon`` to ``false`` because regardless of " -"whether we've successfully reloaded, we have tried and no longer need to " -"process weapon reloading." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:996 -msgid "Changing ``fire_bullet``" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:998 -msgid "" -"Next we need to change ``fire_bullet`` because we are no longer actually " -"firing the bullets in ``Player.gd``. Change ``fire_bullet`` to the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1007 -msgid "" -"Now in ``fire_bullet`` we make sure we are not changing weapons, and if we " -"are not we call the current weapon's ``fire_weapon`` function." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1011 -msgid "Adding ``process_UI``" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1014 -msgid "" -"Because we've changed how weapons work, we need to change how we update the " -"UI. Make a new function called ``process_UI`` and add the following:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1028 -msgid "" -"Nothing much has changed from the code that was in ``_physics_process``, " -"we've mainly just moved the UI processing code to its own function." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1031 -msgid "" -"The only major change is how we get the amount counts in the current weapon." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1035 -msgid "" -"Now we have successfully refactored ``Player.gd`` to use a more modular " -"approach and the weapons now are (mainly) processed in their own scripts! Go " -"give the game a test. If everything is written correctly you should be able " -"to run around and shoot things just like before." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1038 -msgid "" -"Now that we've refactored ``Player.gd``, lets add something new: Let's allow " -"our plays to play using a joypad!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1041 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:20 msgid "Adding joypad input" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1043 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:22 msgid "" "In Godot any game controller is referred to as a joypad. This includes: " "Console controllers, Joysticks (like for flight simulators), Wheels (like " "for driving simulators), VR Controllers, and more." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1046 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:25 msgid "" "First we need to change a few things in our project's input map. Open up the " "project settings and select the ``Input Map`` tab." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1048 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:27 msgid "" "Now we need to add some joypad buttons to our various actions. Click the " "plus icon and select ``Joy Button``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1052 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:31 msgid "" "Feel free to use whatever button layout you want. Make sure that the device " "selected is set to ``0``. In the finished project, we will be using the " "following:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1054 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:33 msgid "movement_sprint: ``Device 0, Button 4 (L, L1)``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1055 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:34 msgid "fire: ``Device 0, Button 0 (PS Cross, XBox A, Nintendo B)``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1056 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:35 msgid "reload: ``Device 0, Button 0 (PS Square, XBox X, Nintendo Y)``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1057 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:36 msgid "flashlight: ``Device 0, Button 12 (D-Pad Up)``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1058 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:37 msgid "shift_weapon_positive: ``Device 0, Button 15 (D-Pad Right)``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1059 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:38 msgid "shift_weapon_negative: ``Device 0, Button 14 (D-Pad Right)``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1061 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:39 +msgid "fire_grenade: ``Device 0, Button 1 (PS Circle, XBox B, Nintendo A).``" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:41 +msgid "These are already set up for you if you downloaded the starter assets" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:43 msgid "Once you are happy with the input, close the project settings and save." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1065 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:47 msgid "Now let's open up ``Player.gd`` and add joypad input." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1067 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:49 msgid "" "First, we need to define a few new global variables. Add the following " "global variables to ``Player.gd``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1075 -msgid "Lets go over what each of these do:" +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:57 +msgid "Let's go over what each of these do:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1077 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:59 msgid "" "``JOYPAD_SENSITIVITY``: This is how fast our joypad joysticks will move our " "camera." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1078 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:60 msgid "" "``JOYPAD_DEADZONE``: The dead zone for the joypad. You may need to adjust " "depending on your joypad." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1080 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:62 msgid "" "Many joypads jitter around a certain point. To counter this, we ignore any " "movement in a with a radius of JOYPAD_DEADZONE. If we did not ignore said " "movement, the camera will jitter." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1083 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:65 +msgid "" +"Also, we are defining ``JOYPAD_SENSITIVITY`` as a variable instead of a " +"constant because we'll later be changing it." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:67 msgid "Now we are ready to start handling joypad input!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1087 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:71 msgid "" "In ``process_input`` add the following code, just before " "``input_movement_vector = input_movement_vector.normalized()``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1102 -msgid "Lets go over what we're doing." +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:94 +msgid "Let's go over what we're doing." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1104 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:96 msgid "First we check to see if there is a connected joypad." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1106 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:98 msgid "" -"If there is a joypad connected, we then get it's left stick axes for right/" -"left and up/down." +"If there is a joypad connected, we then get its left stick axes for right/" +"left and up/down. Because a wired Xbox 360 controller has different joystick " +"axis mapping based on OS, we use different axes based on the OS." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1108 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:102 msgid "" -"This tutorial assumes you are using a XBox 360 wired controller on Windows. " -"The axes needed may be different on different operating systems and/or " -"controllers." +"This tutorial assumes you are using a XBox 360 wired controller. Also, I do " +"not (currently) have access to a Mac computer, so the joystick axes may need " +"changing. If they do, please open a GitHub issue on the Godot documentation " +"repository!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1111 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:106 msgid "" -"Next we check to see if the joypad vector is within the ``JOYPAD_DEADZONE`` " -"radius. If the ``x`` or ``y`` coordinates are within the ``JOYPAD_DEADZONE`` " -"radius, we set it to zero." +"Next we check to see if the joypad vector length is within the " +"``JOYPAD_DEADZONE`` radius. If it is, we set ``joypad_vec`` to an empty " +"Vector2. If it is not, we use a scaled Radial Dead zone for precise dead " +"zone calculating." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1114 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:109 +msgid "" +"You can find a great article explaining all about how to handle joypad/" +"controller dead zones here: https://www.third-helix.com/2013/04/12/doing-" +"thumbstick-dead-zones-right.html" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:112 +msgid "" +"We're using a translated version of the scaled radial dead zone code " +"provided in that article. The article is a great read, and I highly suggest " +"giving it a look!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:115 msgid "Finally, we add ``joypad_vec`` to ``input_movement_vector``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1116 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:117 msgid "" "Remember how we normalize ``input_movement_vector``? This is why! If we did " "not normalize ``input_movement_vector`` players could move faster if they " "are pushing in the same direction with both their keyboard and their joypad!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1121 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:122 msgid "" -"Remember that commented out function in ``_physics_process``? Lets add it! " -"Remove the ``#`` in ``_physics_process`` and make a new function called " -"``process_view_input``. Add the following to ``process_view_input``:" +"Make a new function called ``process_view_input`` and add the following:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1157 -msgid "Let's go over what's happening:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1159 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:164 msgid "" "First we check the mouse mode. If the mouse mode is not " "``MOUSE_MODE_CAPTURED``, we want to return, which will skip the code below." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1161 -msgid "" -"The reason we are checking to see if the mouse mode is captured or not is " -"because we may want to add a pause menu later. If we do, we do not want " -"players to move around while the game is paused if they are using a joypad!" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1164 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:166 msgid "" "Next we define a new :ref:`Vector2 ` called ``joypad_vec``. " -"This will hold the right joystick position if there is one, and if there is " -"not one it will default to ``(0, 0)``, which will do nothing." +"This will hold the right joystick position. Based on the OS, we set its " +"values so it is mapped to the proper axes for the right joystick." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1167 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:169 msgid "" -"We then check to see if we have a joypad connected. If we do, we then assign " -"``joypad_vec`` to the proper axes values." +"As stated above, I do not (currently) has access to a Mac computer, so the " +"joystick axes may need changing. If they do, please open a GitHub issue on " +"the Godot documentation repository!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1169 -msgid "" -"Depending on our OS, you may need to change the axis order. The axis values " -"proved are confirmed to work on Linux and Windows 10 using a XBox 360 wired " -"controller." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1172 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:172 msgid "" "We then account for the joypad's dead zone, just like in ``process_input``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1174 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:174 msgid "" -"Regardless of whether or not there is a joypad connected, we rotate " -"``rotation_helper`` and ourselves using ``joypad_vec``. If we do not have a " -"joypad connected, ``joypad_vec`` will be equal to zero, which will do " -"nothing." +"Then we rotate ``rotation_helper`` and our KinematicBody using " +"``joypad_vec``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1177 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:176 msgid "" "Notice how the code that handles rotating ourselves and ``rotation_helper`` " "is exactly the same as the code in ``_input``. All we've done is change the " "values to use ``joypad_vec`` and ``JOYPAD_SENSITIVITY``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1180 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:179 msgid "" "Due to few mouse related bugs on Windows, we cannot put mouse rotation in " -"``process_view`` as well. The tutorial will be updated once the bugs are " -"fixed!" +"``process_view`` as well. Once these bugs are fixed, this will likely be " +"updated to place the mouse rotation here as well." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1182 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:182 msgid "Finally, we clamp the camera's rotation so we cannot look upside down." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1186 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:186 msgid "" -"If everything is setup correctly, you can now play around using a joypad!" +"The last thing you need to do is add ``process_view_input`` to " +"``_physics_process``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1188 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:188 +msgid "" +"Once ``process_view_input`` is added to ``_physics_process``, you should be " +"able to play using a joypad!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:190 msgid "" "I decided not to use the joypad triggers for firing because we'd then have " "to do some more axis managing, and because I prefer to use a shoulder button " "to fire." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1190 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:192 msgid "" "If you want to use the triggers for firing, you will need to change how " "firing works in ``process_input``. You need to get the proper axis value for " @@ -40209,46 +41465,43 @@ msgid "" "was pressed." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1194 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:196 msgid "Adding mouse scroll wheel input" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1196 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:198 msgid "" -"Let's add one more feature before we close this part off. Let's add the " -"ability to change weapons using the scroll wheel on the mouse." +"Let's add one input related feature before we start working on the pick ups " +"and target. Let's add the ability to change weapons using the scroll wheel " +"on the mouse." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1198 -msgid "Open up ``Player.gd`` and add the following global variables:" +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:207 +msgid "Let's go over what each of these new variables will be doing:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1205 -msgid "Lets go over what each of these new variables will be doing:" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1207 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:209 msgid "``mouse_scroll_value``: The value of the mouse scroll wheel." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1208 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:210 msgid "" "``MOUSE_SENSITIVITY_SCROLL_WHEEL``: How much a single scroll action " "increases mouse_scroll_value" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1212 -msgid "Now lets add the following to ``_input``:" +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:214 +msgid "Now let's add the following to ``_input``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1236 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:238 msgid "" "First we check if the event is a ``InputEventMouseButton`` event and that " "our mouse mode is ``MOUSE_MODE_CAPTURED``. Then we check to see if the " "button index is either a ``BUTTON_WHEEL_UP`` or ``BUTTON_WHEEL_DOWN`` index." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1239 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:241 msgid "" "If the event's index is indeed a button wheel index, we then check to see if " "it is a ``BUTTON_WHEEL_UP`` or ``BUTTON_WHEEL_DOWN`` index. Based on whether " @@ -40256,26 +41509,26 @@ msgid "" "``mouse_scroll_value``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1242 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:244 msgid "" "Next we clamp mouse scroll value to assure it is inside the range of our " "weapons." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1244 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:246 msgid "" "We then check to see if we are changing weapons or reloading. If we are " "doing neither, we round ``mouse_scroll_value`` and cast it to a ``int``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1246 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:248 msgid "" "We are casting ``mouse_scroll_value`` to a ``int`` so we can use it as a key " "in our dictionary. If we left it as a float, we would get an error when we " "try to run the project." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1249 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:251 msgid "" "Next we check to see if the weapon name at ``round_mouse_scroll_value`` is " "not equal to the current weapon name using ``weapon_number_to_name``. If the " @@ -40285,7 +41538,7 @@ msgid "" "``round_mouse_scroll_value``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1253 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:255 msgid "" "The reason we are setting ``mouse_scroll_value`` to the rounded scroll value " "is because we do not want the player to keep their mouse scroll wheel just " @@ -40294,90 +41547,672 @@ msgid "" "assure that each weapon takes exactly the same amount of scrolling to change." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1259 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:261 +msgid "" +"One more thing we need to change is in ``process_input``. In the code for " +"changing weapons, add the following right after the line ``changing_weapon = " +"true``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:267 +msgid "" +"Now our scroll value we be changed with the keyboard input. If we did not " +"change this, our scroll value will be out of sync. If the scroll wheel is " +"out of sync, scrolling forwards or backwards would not transition to the " +"next/last weapon, but rather the next/last weapon the scroll wheel changed " +"to." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:272 msgid "Now you can change weapons using the scroll wheel! Go give it a whirl!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1264 -msgid "" -"Now ``Player.gd`` is laid out much better, is easier to extend, we've added " -"joypad input, and now the player can change weapons with the scroll wheel!" +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:275 +msgid "Adding the health pick ups" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1266 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:277 msgid "" -"You can find the finished project for part 4 here: https://github.com/" -"TwistedTwigleg/Godot_FPS_Tutorial/tree/part_4" +"Now that our player has health and ammo, we ideally need a way to replenish " +"those resources." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1268 -msgid "" -"The completed project has helpful comments every step of the way for almost " -"every line of code!" +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:279 +msgid "Open up ``Health_Pickup.tscn``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1270 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:281 msgid "" -"(Remember, you can download the completed project as a ZIP file if you want)" +"Expand ``Holder`` if it's not already expanded. Notice how we have two " +"Spatial nodes, one called ``Health_Kit`` and another called " +"``Health_Kit_Small``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1274 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:283 msgid "" -"If you want to see what is coming next, and what could be coming in the " -"future, check out this issue on the repository: https://github.com/" -"TwistedTwigleg/Godot_FPS_Tutorial/issues/6" +"This is because we're actually going to be making two sizes of health pick " +"ups, one small and one large/normal. ``Health_Kit`` and ``Health_Kit_Small`` " +"just have a single :ref:`MeshInstance ` as their " +"children." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1278 -msgid "How to make ``Test_Level.tscn`` look cool!" +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:286 +msgid "" +"Next expand ``Health_Pickup_Trigger``. This is an :ref:`Area ` " +"node we're going to use to check if the player has walked close enough to " +"pick up the health kit. If you expand it you'll find two collision shapes, " +"one for each size. We will be using a different collision shape size based " +"on the size of the health pick up, so the smaller health pick up has a " +"trigger collision shape closer to it's size." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1280 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:290 msgid "" -"One quick thing! As noted by **MagicLord** from the Godot forums, you can " -"make ``Test_Level.tscn`` look really cool with a little tweaking!" +"The last thing to note is how we have a :ref:`AnimationPlayer " +"` node so the health kit spins around slowly and bobs " +"up and down." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1282 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:292 msgid "" -"If you change the roughness values down in the Spatial materials for the " -"provided starter assets, you get this:" +"Select ``Health_Pickup`` and add a new script called ``Health_Pickup.gd``. " +"Add the following:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1286 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:351 msgid "" -"Huge thanks to **MagicLord** for sharing! (Credit for the picture goes to " -"**MagicLord** as well!)" +"Let's go over what this script is doing, starting with its global variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1288 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:353 msgid "" -"All you have to do is lower the roughness (I found a value of ``0.1`` looks " -"nice) in ``LevelAssets_SpatialMaterial.tres`` and " -"``LevelAssets_Transparent_SpatialMaterial.tres``, which you can find at " -"``assets/Level_assets``." +"``kit_size``: The size of the health pick up. Notice how we're using a " +"``setget`` function to tell if it's changed." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1291 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:354 msgid "" -"Remember, you have to hit the save button or your changes to " -"``LevelAssets_SpatialMaterial.tres`` and/or " -"``LevelAssets_Transparent_SpatialMaterial.tres`` will not be saved! The save " -"icon looks like a little floppy disk!" +"``HEALTH_AMMOUNTS``: The amount of health each pick up in each size contains." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1294 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:355 msgid "" -"You can also turn on SSR (Screen Space Reflections) and/or use :ref:" -"`reflection probes ` as well! Turning up the metallic " -"value a little can also give a more realistic look." +"``RESPAWN_TIME``: The amount of time, in seconds, it takes for the health " +"pick up to respawn" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:1297 +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:356 msgid "" -"In a later part we will likely change ``Test_Level.tscn`` a bit so the sky " -"texture does not leak through the tiles before setting the material " -"roughness down in the finished project." +"``respawn_timer``: A variable used to track how long the health pick up has " +"been waiting to respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:357 +msgid "" +"``is_ready``: A variable to track whether the ``_ready`` function has been " +"called or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:359 +msgid "" +"We're using ``is_ready`` because ``setget`` functions are called before " +"``_ready``, we need to ignore the first kit_size_change call, because we " +"cannot access child nodes until ``_ready`` is called. If we did not ignore " +"the first ``setget`` call, we would get several errors in the debugger." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:363 +msgid "" +"Also, notice how we're using a exported variable. This is so we can change " +"the size of the health pick up in the editor, for each pick up. This makes " +"it where we do not have to make two scenes for the two sizes, since we can " +"easily change sizes in the editor using the exported variable." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:366 +msgid "" +"See :ref:`doc_GDScript` and scroll down to the Exports section for a list of " +"of export hints you can use." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:370 +msgid "Let's look at ``_ready``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:372 +msgid "" +"First we connect the ``body_entered`` signal from our " +"``Health_Pickup_Trigger`` to the ``trigger_body_entered`` function. This " +"makes is where any body that enters the :ref:`Area ` triggers " +"the ``trigger_body_entered`` function." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:375 +msgid "" +"Next we set ``is_ready`` to ``true`` so we can use our ``setget`` function." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:377 +msgid "" +"Then we hide all of the possible kits and their collision shapes using " +"``kit_size_change_values``. The first argument is the size of the kit, while " +"the second argument is whether to enable or disable the collision shape and " +"mesh at that size." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:380 +msgid "" +"Then we make only the kit size we selected visible, calling " +"``kit_size_change_values`` and passing in ``kit_size`` and ``true``, so the " +"size at ``kit_size`` is enabled." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:384 +msgid "Next let's look at ``kit_size_changed``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:386 +msgid "The first thing we do is check to see if ``is_ready`` is ``true``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:388 +msgid "" +"If ``is_ready`` is ``true``, we then make whatever kit is currently assigned " +"to ``kit_size`` disabled using ``kit_size_change_values``, passing in " +"``kit_size`` and ``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:390 +msgid "" +"Then we assign ``kit_size`` to the new value passed in, ``value``. Then we " +"call ``kit_size_change_values`` passing in ``kit_size`` again, but this time " +"with the second argument as ``true`` so we enable it. Because we changed " +"``kit_size`` to the passed in value, this will make whatever kit size we " +"passed in visible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:393 +msgid "" +"If ``is_ready`` is not ``true``, we simply assign ``kit_size`` to the passed " +"in ``value``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:397 +msgid "Now let's look at ``kit_size_change_values``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:399 +msgid "" +"The first thing we do is check to see which size we're using. Based on which " +"size we're wanting to enable/disable, we want to get different nodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:401 +msgid "" +"We get the collision shape for the node corresponding to ``size`` and " +"disable it based on the ``enabled`` passed in argument/variable." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:403 +msgid "" +"Why are we using ``!enable`` instead of ``enable``? This is so when we say " +"we want to enable the node, we can pass in ``true``, but since :ref:" +"`CollisionShape ` uses disabled instead of enabled, we " +"need to flip it. By flipping it, we can enable the collision shape and make " +"the mesh visible when ``true`` is passed in." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:407 +msgid "" +"We then get the correct :ref:`Spatial ` node holding the mesh " +"and set its visibility to ``enable``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:409 +msgid "" +"This function may be a little confusing, try to think of it like this: We're " +"enabling/disabling the proper nodes for ``size`` using ``enabled``. This is " +"so we cannot pick up health for a size that is not visible, and so only the " +"mesh for the proper size will be visible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:414 +msgid "Finally, let's look at ``trigger_body_entered``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:416 +msgid "" +"The first thing we do is see whether or not the body that just entered has a " +"method/function called ``add_health``. If it does, we then call " +"``add_health`` and pass in the health provided by the current kit size." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:419 +msgid "" +"Then we set ``respawn_timer`` to ``RESPAWN_TIME`` so we have to wait before " +"we can get health again. Finally, call ``kit_size_change_values``, passing " +"in ``kit_size`` and ``false`` so the kit at ``kit_size`` is invisible until " +"we've waited long enough to respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:424 +msgid "" +"The last thing we need to do before we can use this health pick up is add a " +"few things to our player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:426 +msgid "Open up ``Player.gd`` and add the following global variable:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:432 +msgid "``MAX_HEALTH``: The maximum amount of health a player can have." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:434 +msgid "" +"Now we need to add the ``add_health`` function to our player. Add the " +"following to ``Player.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:442 +msgid "Let's quickly go over what this does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:444 +msgid "" +"We first add ``additional_health`` to our current health. We then clamp the " +"health so that it cannot exceed a value higher than ``MAX_HEALTH``, nor a " +"value lower than ``0``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:449 +msgid "" +"With that done, now we can collect health! Go place a few ``Health_Pickup`` " +"scenes around and give it a try. You can change the size of the health pick " +"up in the editor when a ``Health_Pickup`` instanced scene is selected, from " +"a convenient drop down." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:453 +msgid "Adding the ammo pick ups" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:455 +msgid "" +"While adding health is good and all, we can't really reap the rewards from " +"it since nothing can (currently) damage us. Let's add some ammo pick ups " +"next!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:458 +msgid "" +"Open up ``Ammo_Pickup.tscn``. Notice how it's structured exactly the same as " +"``Health_Pickup.tscn``, just with the meshes and trigger collision shapes " +"changed slightly to adjust for the difference in mesh sizes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:461 +msgid "" +"Select ``Ammo_Pickup`` and add a new script called ``Ammo_Pickup.gd``. Add " +"the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:522 +msgid "" +"You may have noticed this code looks almost exactly the same as the health " +"pick up. That's because it largely is the same! Only a few things have been " +"changed, and that's what we're going to go over." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:525 +msgid "" +"First, notice how we have ``AMMO_AMOUNTS`` instead of ``HEALTH_AMMOUNTS``. " +"``AMMO_AMOUNTS`` will be how many ammo clips/magazines we add to the current " +"weapon. (Unlike ``HEALTH_AMMOUNTS`` which was how many health points, we " +"instead just add an entire clip for the current weapon, instead of the raw " +"ammo amount)" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:528 +msgid "" +"The only other thing to notice is in ``trigger_body_entered`` we're checking " +"and calling a function called ``add_ammo``, not ``add_health``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:530 +msgid "" +"Other than those two small changes, everything else is exactly the same as " +"the health pickup!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:534 +msgid "" +"All we need to do make the ammo pick ups work is add a new function to our " +"player. Open ``Player.gd`` and add the following function:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:545 +msgid "" +"The first thing we check is to see whether we're using ``UNARMED`` or not. " +"Because ``UNARMED`` does not have a node/script, we want to make sure we're " +"not using ``UNARMED`` before trying to get the node/script attached to " +"``current_weapon_name``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:548 +msgid "" +"Next we check to see if the current weapon can be refilled. If the current " +"weapon can, we add a full clip/magazine worth of ammo to the weapon by " +"multiplying the current weapon's ``AMMO_IN_MAG`` variable times however much " +"ammo clips we're adding (``additional_ammo``)." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:553 +msgid "" +"With that done, you should now be able to get additional ammo! Go place some " +"ammo pick ups in one/both/all of the scenes and give it a try!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:555 +msgid "" +"Notice how we're not limiting the amount of ammo you can carry. To limit the " +"amount of ammo each weapon can carry, you just need to add a additional " +"variable to each weapon's script, and then clamp the weapon's ``spare_ammo`` " +"variable after adding ammo in ``add_ammo``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:559 +msgid "Adding breakable targets" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:561 +msgid "Before we end this part, let's add some targets." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:563 +msgid "" +"Open up ``Target.tscn`` and take a look at the scenes in the scene tree." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:565 +msgid "" +"First, notice how we're not using a :ref:`RigidBody ` node, " +"but rather a :ref:`StaticBody ` node instead. The reason " +"behind this is our non-broken targets will not be moving anywhere, using a :" +"ref:`RigidBody ` would be more hassle then its worth, since " +"all it has to do is stay still." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:569 +msgid "" +"We also save a tiny bit of performance using a :ref:`StaticBody " +"` over a :ref:`RigidBody `" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:571 +msgid "" +"The other thing to note is we have a node called ``Broken_Target_Holder``. " +"This node is going to hold a spawned/instanced scene called ``Broken_Target." +"tscn``. Open up ``Broken_Target.tscn``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:574 +msgid "" +"Notice how the target is broken up into five pieces, each a :ref:`RigidBody " +"` node. We're going to spawn/instance this scene when the " +"target takes too much damage and needs to be destroyed. Then we're going to " +"hide the non-broken target, so it looks like the target shattered rather " +"than a shattered target was spawned/instanced." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:578 +msgid "" +"While you still have ``Broken_Target.tscn`` open, attach " +"``RigidBody_hit_test.gd`` to all of the :ref:`RigidBody ` " +"nodes. This will make it where we can shoot at the broken pieces and they " +"will react to the bullets." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:581 +msgid "" +"Alright, now switch back to ``Target.tscn``, select the ``Target`` :ref:" +"`StaticBody ` node and created a new script called " +"``Target.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:583 +msgid "Add the following code to ``Target.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:641 +msgid "" +"Let's go over what this script does, starting with the global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:643 +msgid "" +"``TARGET_HEALTH``: The amount of damage needed to break a fully healed " +"target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:644 +msgid "``current_health``: The amount of health this target currently has." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:645 +msgid "" +"``broken_target_holder``: A variable to hold the ``Broken_Target_Holder`` " +"node so we can use it easily." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:646 +msgid "" +"``target_collision_shape``: A variable to hold the :ref:`CollisionShape " +"` for the non-broken target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:647 +msgid "" +"``TARGET_RESPAWN_TIME``: The length of time, in seconds, it takes for a " +"target to respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:648 +msgid "" +"``target_respawn_timer``: A variable to track how long a target has been " +"broken." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:649 +msgid "" +"``destroyed_target``: A :ref:`PackedScene ` to hold the " +"broken target scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:651 +msgid "" +"Notice how we're using an exported variable (a :ref:`PackedScene " +"`) to get the broken target scene instead of using " +"``preload``. By using an exported variable, we can chose the scene from the " +"editor, and when/if we need to use a different scene, it's as easy as " +"selecting a different scene in the editor, we don't need to go to the code " +"to change the scene we're using." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:657 +msgid "Let's look at ``_ready``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:659 +msgid "" +"The first thing we do is get the broken target holder and assign it to " +"``broken_target_holder``. Notice how we're using ``get_parent().get_node()`` " +"here, instead of ``$``. If you want to use ``$``, then you'd need to change " +"``get_parent().get_node()`` to ``$\"../Broken_Target_Holder\"``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:662 +msgid "" +"At the time of when this was written, I did not realize you can use ``$\"../" +"NodeName\"`` to get the parent nodes using ``$``, which is why " +"``get_parent().get_node()`` is used instead." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:665 +msgid "" +"Next we get the collision shape and assign it to ``target_collision_shape``. " +"The reason we need to collision shape is because even when the mesh is " +"invisible, the collision shape will still exist in the physics world. This " +"makes it where the player can interact with a non-broken target even though " +"it's invisible, which is not what we want. To get around this, we will " +"disable/enable the collision shape as we make the mesh visible/invisible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:671 +msgid "Next let's look at ``_physics_process``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:673 +msgid "" +"We're only going to be using ``_physics_process`` for respawning, and so the " +"first thing we do is check to see if ``target_respawn_timer`` is more than " +"``0``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:675 +msgid "If it is, we then remove ``delta`` from it." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:677 +msgid "" +"Then we check to see if ``target_respawn_timer`` is ``0`` or less. The " +"reason behind this is since we just removed ``delta`` from " +"``target_respawn_timer``, if it's ``0`` or less then we've just got here, " +"effectively allowing us to do whatever we need to do when the timer is " +"finished." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:680 +msgid "In this case, we want to respawn our target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:682 +msgid "" +"The first thing we do is remove all children in the broken target holder. We " +"do this by iterating over all of the children in ``broken_target_holder`` " +"and free them." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:684 +msgid "" +"Next we enable our collision shape by setting its ``disabled`` boolean to " +"``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:686 +msgid "Then we make ourselves, and all of our children nodes, visible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:688 +msgid "Finally, we reset ``current_health`` to ``TARGET_HEALTH``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:692 +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:899 +msgid "Finally, let's look at ``bullet_hit``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:694 +msgid "" +"The first the we do is remove however much damage the bullet does from our " +"health." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:696 +msgid "" +"Next we check to see if we're at ``0`` health or lower. If we are, then " +"we've just died and need to spawn a broken target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:698 +msgid "" +"We first instance a new destroyed target scene, and assign it to a new " +"variable, ``clone``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:700 +msgid "Next we add ``clone`` as a child of our broken target holder." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:702 +msgid "" +"For an added bonus, we want to make all of the target pieces explode " +"outwards. Do to this, we iterate over all of the children in ``clone``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:704 +msgid "" +"For each child, we first check to see if it's a :ref:`RigidBody " +"` node. If it is, we then calculate the center position of " +"the target relative to the child node. Then we figure out which direction we " +"are relative to the center. Using those calculated variables, we push the " +"child from the calculated center, in the direction away from the center, " +"using the damage of the bullet as the force." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:708 +msgid "" +"We multiply the damage by ``12`` so it has a more dramatic effect. You can " +"change this to a higher or lower value depending on how explosive you want " +"your targets to shatter." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:711 +msgid "" +"Next we set our respawn timer for our non-broken target. We set it to " +"``TARGET_RESPAWN_TIME``, so it takes ``TARGET_RESPAWN_TIME`` many seconds to " +"respawn." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:713 +msgid "" +"Then we disable the non-broken target's collision shape, and set our " +"visibility to ``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:717 +msgid "" +"Make sure to set the exported ``destroyed_target`` value for ``Target.tscn`` " +"in the editor! Otherwise the targets will not be destroyed and you will get " +"an error!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:720 +msgid "" +"With that done, go place some ``Target.tscn`` instances around in one/both/" +"all of the levels. You should find they explode into five pieces after " +"they've taken enough damage. After a little while, they'll respawn into a " +"whole target again." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:728 +msgid "" +"Now you can use a joypad, change weapons with the mouse's scroll wheel, " +"replenish your health and ammo, and break targets with your weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:730 +msgid "" +"In the next part, :ref:`doc_fps_tutorial_part_five`, we're going to add " +"grenades to our player, give our player the ability to grab and throw " +"objects, and add turrets!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_four.rst:735 +msgid "" +"You can download the finished project for this part here: :download:" +"`Godot_FPS_Part_4.zip `" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:4 @@ -40392,7 +42227,7 @@ msgstr "" msgid "" "By the end of this part, you will have a player that can fire a pistol, " "rifle, and attack using a knife. The player will also now have animations " -"with transitions, and the weapons can interact with objects in the " +"with transitions, and the weapons will interact with objects in the " "environment." msgstr "" @@ -40402,67 +42237,73 @@ msgid "" "moving on to this part of the tutorial." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:22 -msgid "Making a system to handle animations" +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:19 +msgid "" +"The finished project from :ref:`doc_fps_tutorial_part_one` will be the " +"starting project for part 2" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:24 +msgid "Making a system to handle animations" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:26 msgid "" "First we need a way to handle changing animations. Open up ``Player.tscn`` " "and select the :ref:`AnimationPlayer ` Node " -"(``Player`` -> ``Rotation_helper`` -> ``Model`` -> ``AnimationPlayer``)." +"(``Player`` -> ``Rotation_Helper`` -> ``Model`` -> ``Animation_Player``)." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:27 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:29 msgid "" "Create a new script called ``AnimationPlayer_Manager.gd`` and attach that to " "the :ref:`AnimationPlayer `." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:29 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:31 msgid "Add the following code to ``AnimationPlayer_Manager.gd``:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:151 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:153 msgid "Lets go over what this script is doing:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:155 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:157 msgid "Lets start with this script's global variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:157 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:159 msgid "" "``states``: A dictionary for holding our animation states. (Further " "explanation below)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:158 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:160 msgid "" "``animation_speeds``: A dictionary for holding all of the speeds we want to " "play our animations at." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:159 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:161 msgid "" "``current_state``: A variable for holding the name of the animation state we " "are currently in." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:160 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:162 msgid "" "``callback_function``: A variable for holding the callback function. " "(Further explanation below)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:162 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:164 msgid "" "If you are familiar with state machines, then you may have noticed that " "``states`` is structured like a basic state machine. Here is roughly how " "``states`` is set up:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:165 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:167 msgid "" "``states`` is a dictionary with the key being the name of the current state, " "and the value being an array holding all of the states we can transition to. " @@ -40471,63 +42312,57 @@ msgid "" "``Idle_unarmed``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:170 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:172 msgid "" "If we try to transition to a state that is not included in our possible " "transitions states, then we get a warning message and the animation does not " -"change. We will also automatically transition from some states into others, " +"change. We can also automatically transition from some states into others, " "as will be explained further below in ``animation_ended``" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:174 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:176 msgid "" "For the sake of keeping this tutorial simple we are not using a 'proper' " "state machine. If you are interested to know more about state machines, see " "the following articles:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:178 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:180 msgid "" "(Python example) https://dev.to/karn/building-a-simple-state-machine-in-" "python" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:179 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:181 msgid "" "(C# example) https://www.codeproject.com/Articles/489136/" "UnderstandingplusandplusImplementingplusStateplusP" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:180 -msgid "(Wiki article) https://en.wikipedia.org/wiki/Finite-state_machine" -msgstr "" - #: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:182 -msgid "" -"In a future part of this tutorial series we may revise this script to " -"include a proper state machine." +msgid "(Wiki article) https://en.wikipedia.org/wiki/Finite-state_machine" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:184 msgid "" "``animation_speeds`` is how fast each animation will play. Some of the " -"animations are a little slow and in an effort to make everything smooth, we " -"need to play them at faster speeds than some of the others." +"animations are a little slow and in an effort to make everything look " +"smooth, we need to play them at faster speeds." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:188 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:187 msgid "" -"-- note:: Notice that all of the firing animations are faster than their " -"normal speed. Remember this for later!" +"Notice that all of the firing animations are faster than their normal speed. " +"Remember this for later!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:190 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:189 msgid "" "``current_state`` will hold the name of the animation state we are currently " "in." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:192 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:191 msgid "" "Finally, ``callback_function`` will be a :ref:`FuncRef ` " "passed in by our player for spawning bullets at the proper frame of " @@ -40536,19 +42371,28 @@ msgid "" "script, which is how we will use it later." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:198 -msgid "" -"Now lets look at ``_ready``. First we are setting our animation to " -"``Idle_unarmed``, using the ``set_animation`` function, so we for sure start " -"in that animation. Next we connect the ``animation_finished`` signal to this " -"script and assign it to call ``animation_ended``." +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:197 +msgid "Now lets look at ``_ready``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:204 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:199 +msgid "" +"First we are setting our animation to ``Idle_unarmed`` using the " +"``set_animation`` function, so we for sure start in that animation." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:202 +msgid "" +"Next we connect the ``animation_finished`` signal to this script and assign " +"it to call ``animation_ended``. This means whenever an animation is " +"finished, ``animation_ended`` will be called." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:207 msgid "Lets look at ``set_animation`` next." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:206 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:209 msgid "" "``set_animation`` sets the animation to the that of the passed in animation " "state *if* we can transition to it. In other words, if the animation state " @@ -40556,20 +42400,20 @@ msgid "" "then we will change to that animation." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:210 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:213 msgid "" -"First we check if the passed in animation is the same as the animation state " -"we are currently in. If it is, then we write a warning to the console and " -"return ``true``." +"To start we check if the passed in animation is the same as the animation " +"state we are currently in. If they are the same, then we write a warning to " +"the console and return ``true``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:213 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:216 msgid "" "Next we see if :ref:`AnimationPlayer ` has the passed " "in animation using ``has_animation``. If it does not, we return ``false``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:215 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:218 msgid "" "Then we check if ``current_state`` is set or not. If ``current_state`` is " "*not* currently set, we set ``current_state`` to the passed in animation and " @@ -40578,49 +42422,49 @@ msgid "" "``animation_speeds`` and then we return ``true``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:219 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:222 msgid "" "If we have a state in ``current_state``, then we get all of the possible " -"states we can transition to. If the animation name is in the array of " -"possible transitions, then we set ``current_state`` to the passed in " -"animation, tell :ref:`AnimationPlayer ` to play the " -"animation with a blend time of ``-1`` at the speed set in " -"``animation_speeds`` and then we return ``true``." +"states we can transition to. If the animation name is in the list of " +"possible transitions, we set ``current_state`` to the passed in animation, " +"tell :ref:`AnimationPlayer ` to play the animation " +"with a blend time of ``-1`` at the speed set in ``animation_speeds`` and " +"return ``true``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:226 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:229 msgid "Now lets look at ``animation_ended``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:228 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:231 msgid "" "``animation_ended`` is the function that will be called by :ref:" "`AnimationPlayer ` when it's done playing a animation." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:231 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:234 msgid "" "For certain animation states, we may need to transition into another state " "when its finished. To handle this, we check for every possible animation " "state. If we need to, we transition into another state." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:234 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:237 msgid "" "If you are using your own animated models, make sure that none of the " "animations are set to loop. Looping animations do not send the " "``animation_finished`` signal when they reach the end of the animation and " -"are about to loop." +"are about to loop again." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:238 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:241 msgid "" "the transitions in ``animation_ended`` ideally would be part of the data in " "``states``, but in an effort to make the tutorial easier to understand, " "we'll just hard code each state transition in ``animation_ended``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:244 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:247 msgid "" "Finally we have ``animation_callback``. This function will be called by a " "function track in our animations. If we have a :ref:`FuncRef " @@ -40629,39 +42473,39 @@ msgid "" "``callback_function``, we print out a warning to the console." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:248 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:251 msgid "" "Try running ``Testing_Area.tscn`` just to make sure there is no runtime " "issues. If the game runs but nothing seems to have changed, then everything " "is working correctly." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:252 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:255 msgid "Getting the animations ready" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:254 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:257 msgid "" "Now that we have a working animation manager, we need to call it from our " "player script. Before that though, we need to set some animation callback " "tracks in our firing animations." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:257 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:260 msgid "" "Open up ``Player.tscn`` if you don't have it open and navigate to the :ref:" "`AnimationPlayer ` node (``Player`` -> " -"``Rotation_helper`` -> ``Model`` -> ``AnimationPlayer``)." +"``Rotation_Helper`` -> ``Model`` -> ``Animation_Player``)." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:260 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:263 msgid "" "We need to attach a function track to three of our animations: The firing " "animation for the pistol, rifle, and knife. Let's start with the pistol. " "Click the animation drop down list and select \"Pistol_fire\"." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:263 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:266 msgid "" "Now scroll down to the very bottom of the list of animation tracks. The " "final item in the list should read ``Armature/Skeleton:Left_UpperPointer``. " @@ -40669,7 +42513,7 @@ msgid "" "animation window, right next to the loop button and the up arrow." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:269 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:272 msgid "" "This will bring up a window with three choices. We're wanting to add a " "function callback track, so click the option that reads \"Add Call Func Track" @@ -40677,7 +42521,7 @@ msgid "" "ref:`AnimationPlayer ` node, select it, and press OK." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:275 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:278 msgid "" "Now at the bottom of list of animation tracks you will have a green track " "that reads \"AnimationPlayer\". Now we need to add the point where we want " @@ -40685,39 +42529,39 @@ msgid "" "where the muzzle just starts to flash." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:279 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:282 msgid "" "The timeline is the window where all of the points in our animation are " "stored. Each of the little points represents a point of animation data." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:282 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:285 msgid "" "Scrubbing the timeline means moving ourselves through the animation. So when " "we say \"scrub the timeline until you reach a point\", what we mean is move " "through the animation window until you reach the a point on the timeline." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:286 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:289 msgid "" "Also, the muzzle of a gun is the end point where the bullet comes out. The " "muzzle flash is the flash of light that escapes the muzzle when a bullet is " "fired. The muzzle is also sometimes referred to as the barrel of the gun." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:290 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:293 msgid "" "For finer control when scrubbing the timeline, press ``control`` and scroll " "forwards with the mouse wheel to zoom in. Scrolling backwards will zoom out." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:293 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:296 msgid "" "You can also change how the timeline scrubbing snaps by changing the value " "in ``Step (s)`` to a lower/higher value." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:295 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:298 msgid "" "Once you get to a point you like, press the little green plus symbol on the " "far right side of the ``AnimationPlayer`` track. This will place a little " @@ -40725,46 +42569,46 @@ msgid "" "``AnimationPlayer`` track." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:301 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:304 msgid "" "Now we have one more step before we are done with the pistol. Select the " "\"enable editing of individual keys\" button on the far right corner of the " "animation window. It looks like a pencil with a little point beside it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:306 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:309 msgid "" "Once you've click that, a new window will open on the right side. Now click " "the green point on the ``AnimationPlayer`` track. This will bring up the " "information associated with that point in the timeline. In the empty name " -"field, enter \"animation_callback\" and press ``enter``." +"field, enter ``animation_callback`` and press ``enter``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:310 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:313 msgid "" "Now when we are playing this animation the callback function will be " "triggered at that specific point of the animation." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:312 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:315 msgid "" "Be sure to press the \"enable editing of individual keys\" button again to " "turn off the ability to edit individual keys so you cannot change one of the " "transform tracks by accident!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:317 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:320 msgid "Let's repeat the process for the rifle and knife firing animations!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:319 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:322 msgid "" "Because the process is exactly the same as the pistol, the process is going " "to explained in a little less depth. Follow the steps in the above if you " "get lost! It is exactly the same, just on a different animation." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:322 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:325 msgid "" "Go to the \"Rifle_fire\" animation from the animation drop down. Add the " "function callback track once you reach the bottom of the animation track " @@ -40773,7 +42617,7 @@ msgid "" "symbol to add a function callback point at that position on the track." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:326 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:329 msgid "" "Next, click the \"enable editing of individual keys\" button. Select the " "newly created function callback point, put \"animation_callback\" into the " @@ -40782,7 +42626,7 @@ msgid "" "of the transform tracks by accident." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:331 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:334 msgid "" "Now we just need to apply the callback function track to the knife " "animation. Select the \"Knife_fire\" animation and scroll to the bottom of " @@ -40791,7 +42635,7 @@ msgid "" "third of the animation to place the animation callback function point at." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:335 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:338 msgid "" "We will not actually be firing the knife, and the animation really is a " "stabbing animation rather than a firing one. For this tutorial we are just " @@ -40799,7 +42643,7 @@ msgid "" "in a style that is consistent with the other animations." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:339 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:342 msgid "" "From there click the little green plus to add a function callback point at " "the current position. Then click the \"enable editing of individual keys\" " @@ -40810,29 +42654,29 @@ msgid "" "key editing. so we cannot change one of the transform tracks by accident." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:345 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:348 msgid "Be sure to save your work!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:347 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:350 msgid "" "With that done, we are almost ready to start adding the ability to fire to " "our player script! We just need to setup one last scene: The scene for our " "bullet object." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:351 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:354 msgid "Creating the bullet scene" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:353 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:356 msgid "" "There are several ways to handle a gun's bullets in video games. In this " "tutorial series, we will be exploring two of the more common ways: Objects, " "and raycasts." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:358 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:361 msgid "" "One of the two ways is using a bullet object. This will be an object that " "travels through the world and handles its own collision code. This method we " @@ -40840,7 +42684,7 @@ msgid "" "sends itself forward." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:362 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:365 msgid "" "There are several advantages to this method. The first being we do not have " "to store the bullets in our player. We can simply create the bullet and then " @@ -40848,7 +42692,7 @@ msgid "" "the proper signal(s) to the object it collides with, and destroying itself." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:365 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:368 msgid "" "Another advantage is we can have more complex bullet movement. If we want to " "make the bullet fall ever so slightly as time goes on, we can make the " @@ -40858,7 +42702,7 @@ msgid "" "nothing in real life really moves instantly from one point to another." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:369 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:372 msgid "" "One of the huge disadvantages performance. While having each bullet " "calculate their own paths and handle their own collision allows for a lot of " @@ -40868,7 +42712,7 @@ msgid "" "potentially have several hundred bullets." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:373 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:376 msgid "" "Despite the performance hit, many first person shooters include some form of " "object bullets. Rocket launchers are a prime example because in many first " @@ -40877,7 +42721,7 @@ msgid "" "because they generally bounce around the world before exploding." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:377 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:380 msgid "" "While I cannot say for sure this is the case, these games *probably* use " "bullet objects in some form or another: (These are entirely from my " @@ -40885,36 +42729,36 @@ msgid "" "of the following games)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:380 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:383 msgid "" "Halo (Rocket launchers, fragment grenades, sniper rifles, brute shot, and " "more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:381 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:384 msgid "" "Destiny (Rocket launchers, grenades, fusion rifles, sniper rifles, super " "moves, and more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:382 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:385 msgid "" "Call of Duty (Rocket launchers, grenades, ballistic knives, crossbows, and " "more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:383 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:386 msgid "Battlefield (Rocket launchers, grenades, claymores, mortars, and more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:385 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:388 msgid "" "Another disadvantage with bullet objects is networking. Bullet objects have " "to sync the positions (at least) with however many clients are connected to " "the server." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:388 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:391 msgid "" "While we are not implementing any form of networking (as that would be it's " "own entire tutorial series), it is a consideration to keep in mind when " @@ -40922,19 +42766,19 @@ msgid "" "form of networking in the future." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:393 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:396 msgid "" "The other way of handling bullet collisions we will be looking at, is " "raycasting." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:395 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:398 msgid "" "This method is extremely common in guns that have fast moving bullets that " "rarely change trajectory change over time." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:397 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:400 msgid "" "Instead of creating a bullet object and sending it through space, we instead " "send a ray starting from the barrel/muzzle of the gun forwards. We set the " @@ -40942,7 +42786,7 @@ msgid "" "length we can adjust how far the bullet 'travels' through space." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:400 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:403 msgid "" "While I cannot say for sure this is the case, these games *probably* use " "raycasts in some form or another: (These are entirely from my observations. " @@ -40950,36 +42794,36 @@ msgid "" "following games)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:403 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:406 msgid "" "Halo (Assault rifles, DMRs, battle rifles, covenant carbine, spartan laser, " "and more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:404 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:407 msgid "" "Destiny (Auto rifles, pulse rifles, scout rifles, hand cannons, machine " "guns, and more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:405 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:408 msgid "" "Call of Duty (Assault rifles, light machine guns, sub machine guns, pistols, " "and more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:406 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:409 msgid "Battlefield (Assault rifles, SMGs, carbines, pistols, and more)" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:408 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:411 msgid "" "One huge advantage for this method is it's really light on performance. " "Sending a couple hundred rays through space is *way* easier for the computer " "to calculate than sending a couple hundred bullet objects." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:412 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:415 msgid "" "Another advantage is we can instantly know if we've hit something or not " "exactly when we call for it. For networking this is important because we do " @@ -40987,7 +42831,7 @@ msgid "" "send whether or not the raycast hit." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:415 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:418 msgid "" "Raycasting does have some disadvantages though. One major disadvantage is we " "cannot easily cast a ray in anything but a linear line. This means we can " @@ -40997,7 +42841,7 @@ msgid "" "heavier on performance." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:419 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:422 msgid "" "Another disadvantage is we cannot see the bullet. With bullet objects we can " "actually see the bullet travel through space if we attach a mesh to it, but " @@ -41008,13 +42852,13 @@ msgid "" "theoretically the bullets move so fast our eyes could not see it anyway." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:426 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:429 msgid "" "Lets get the bullet object setup. This is what our pistol will create when " "the \"Pistol_fire\" animation callback function is called." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:428 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:431 msgid "" "Open up ``Bullet_Scene.tscn``. The scene contains :ref:`Spatial " "` node called bullet, with a :ref:`MeshInstance " @@ -41022,20 +42866,20 @@ msgid "" "`CollisionShape ` childed to it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:431 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:434 msgid "" "Create a new script called ``Bullet_script.gd`` and attach it to the " "``Bullet`` :ref:`Spatial `." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:433 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:436 msgid "" "We are going to move the entire bullet object at the root (``Bullet``). We " "will be using the :ref:`Area ` to check whether or not we've " "collided with something" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:435 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:438 msgid "" "Why are we using a :ref:`Area ` and not a :ref:`RigidBody " "`? The mean reason we're not using a :ref:`RigidBody " @@ -41045,92 +42889,101 @@ msgid "" "` nodes, including other bullets, will be effected." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:439 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:442 msgid "" "Another reason is simply because it is easier to detect collisions with a :" "ref:`Area `!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:441 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:444 msgid "Here's the script that will control our bullet:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:478 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:480 msgid "Lets go through the script:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:482 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:484 msgid "First we define a few global variables:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:484 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:486 msgid "``BULLET_SPEED``: The speed the bullet travels at." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:485 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:487 msgid "" "``BULLET_DAMAGE``: The damage the bullet will cause to whatever it collides " "with." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:486 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:488 msgid "``KILL_TIMER``: How long the bullet can last without hitting anything." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:487 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:489 msgid "``timer``: A float for tracking how long we've been alive." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:488 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:490 msgid "" "``hit_something``: A boolean for tracking whether or not we've hit something." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:490 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:492 msgid "" "With the exception of ``timer`` and ``hit_something``, all of these " "variables change how the bullet interacts with the world." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:493 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:495 msgid "" "The reason we are using a kill timer is so we do not have a case where we " -"get a bullet traveling forever. By using a kill timer, we can assure that no " -"bullets will just travel forever and consume resources." +"get a bullet travelling forever. By using a kill timer, we can assure that " +"no bullets will just travel forever and consume resources." msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:499 msgid "" -"In ``_ready`` we set the area's ``body_entered`` signal to ourself so that " -"it calls the ``collided`` function. Then we set ``_physics_process`` to " -"``true``." +"As in :ref:`doc_fps_tutorial_part_one`, we have a couple all uppercase " +"global variables. The reason behind this is the same as the reason given in :" +"ref:`doc_fps_tutorial_part_one`: We want to treat these variables like " +"constants, but we want to be able to change them. In this case we will later " +"need to change the damage and speed of these bullets, so we need them to be " +"variables and not constants." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:504 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:506 +msgid "" +"In ``_ready`` we set the area's ``body_entered`` signal to ourself so that " +"it calls the ``collided`` function when a body enters the area." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:511 msgid "" "``_physics_process`` gets the bullet's local ``Z`` axis. If you look in at " "the scene in local mode, you will find that the bullet faces the positive " "local ``Z`` axis." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:507 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:514 msgid "" "Next we translate the entire bullet by that forward direction, multiplying " "in our speed and delta time." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:509 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:516 msgid "" "After that we add delta time to our timer and check if the timer has as long " "or longer than our ``KILL_TIME`` constant. If it has, we use ``queue_free`` " "to free ourselves." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:514 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:521 msgid "In ``collided`` we check if we've hit something yet or not." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:516 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:523 msgid "" "Remember that ``collided`` is only called when a body has entered the :ref:" "`Area ` node. If we have not already collided with something, we " @@ -41139,31 +42992,31 @@ msgid "" "position." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:521 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:527 msgid "" "in ``collided``, the passed in body can be a :ref:`StaticBody " "`, :ref:`RigidBody `, or :ref:" "`KinematicBody `" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:524 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:530 msgid "" -"Then we set ``hit_something`` to ``true`` because regardless of whether or " -"not the body the bullet collided with has the ``bullet_hit`` function/" -"method, it has hit something." +"We set ``hit_something`` to ``true`` because regardless of whether or not " +"the body the bullet collided with has the ``bullet_hit`` function/method, it " +"has hit something and so we need to not hit anything else." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:527 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:533 msgid "Then we free the bullet using ``queue_free``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:529 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:535 msgid "" "You may be wondering why we even have a ``hit_something`` variable if we " "free the bullet using ``queue_free`` as soon as it hits something." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:532 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:538 msgid "" "The reason we need to track whether we've hit something or not is because " "``queue_free`` does not immediately free the node, so the bullet could " @@ -41172,19 +43025,19 @@ msgid "" "hit one object." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:540 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:546 msgid "" "Before we start programming the player again, let's take a quick look at " "``Player.tscn``. Open up ``Player.tscn`` again." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:543 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:549 msgid "" -"Expand ``Rotation_helper`` and notice how it has two nodes: " -"``Gun_fire_points`` and ``Gun_aim_point``." +"Expand ``Rotation_Helper`` and notice how it has two nodes: " +"``Gun_Fire_Points`` and ``Gun_Aim_Point``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:546 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:552 msgid "" "``Gun_aim_point`` is the point that the bullets will be aiming at. Notice " "how it is lined up with the center of the screen and pulled a distance " @@ -41192,26 +43045,26 @@ msgid "" "bullets will for sure collide with as it goes along." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:551 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:557 msgid "" "There is a invisible mesh instance for debugging purposes. The mesh is a " "small sphere that visually shows where the bullets will be aiming at." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:554 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:560 msgid "" -"Open up ``Gun_fire_points`` and you'll find three more :ref:`Spatial " +"Open up ``Gun_Fire_Points`` and you'll find three more :ref:`Spatial " "` nodes, one for each weapon." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:557 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:563 msgid "" -"Open up ``Rifle_point`` and you'll find a :ref:`Raycast ` " -"node. This is where we will be sending the raycasts for our rilfe's bullets. " +"Open up ``Rifle_Point`` and you'll find a :ref:`Raycast ` " +"node. This is where we will be sending the raycasts for our rifle's bullets. " "The length of the raycast will dictate how far our the bullets will travel." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:561 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:567 msgid "" "We are using a :ref:`Raycast ` node to handle the rifle's " "bullet because we want to fire lots of bullets quickly. If we use bullet " @@ -41219,7 +43072,7 @@ msgid "" "machines." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:565 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:571 msgid "" "If you are wondering where the positions of the points came from, they are " "the rough positions of the ends of each weapon. You can see this by going to " @@ -41228,29 +43081,29 @@ msgid "" "the end of each weapon." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:571 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:577 msgid "" -"Open up ``Knife_point`` and you'll find a :ref:`Area ` node. We " +"Open up ``Knife_Point`` and you'll find a :ref:`Area ` node. We " "are using a :ref:`Area ` for the knife because we only care for " "all of the bodies close to us, and because our knife does not fire into " "space. If we were making a throwing knife, we would likely spawn a bullet " "object that looks like a knife." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:576 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:582 msgid "" -"Finally, we have ``Pistol point``. This is the point where we will be " +"Finally, we have ``Pistol_Point``. This is the point where we will be " "creating/instancing our bullet objects. We do not need any additional nodes " "here, as the bullet handles all of its own collision detection." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:580 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:586 msgid "" "Now that we've seen how we will handle our other weapons, and where we will " "spawn the bullets, let's start working on making them work." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:583 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:589 msgid "" "You can also look at the HUD nodes if you want. There is nothing fancy there " "and other than using a single :ref:`Label `, we will not be " @@ -41259,86 +43112,452 @@ msgid "" "nodes." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:587 -msgid "" -"The GUI provided in this tutorial is *very* basic. Maybe in a later part we " -"will revise the GUI, but for now we are going to just use this GUI as it " -"will serve our needs for now." +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:595 +msgid "Creating the first weapon" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:591 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:597 +msgid "Lets write the code for each of our weapons, starting with the pistol." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:599 +msgid "" +"Select ``Pistol_Point`` (``Player`` -> ``Rotation_Helper`` -> " +"``Gun_Fire_Points`` -> ``Pistol_Point``) and create a new script called " +"``Weapon_Pistol.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:601 +msgid "Add the following code to ``Weapon_Pistol.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:652 +msgid "Let's go over how the script works." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:656 +msgid "First we define some global variables we'll need in the script:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:658 +msgid "``DAMAGE``: The amount of damage a single bullet does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:659 +msgid "``IDLE_ANIM_NAME``: The name of the pistol's idle animation." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:660 +msgid "``FIRE_ANIM_NAME``: The name of the pistol's fire animation." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:661 +msgid "" +"``is_weapon_enabled``: A variable for checking whether this weapon is in use/" +"enabled." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:662 +msgid "``bullet_scene``: The bullet scene we worked on earlier." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:663 +msgid "``player_node``: A variable to hold ``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:665 +msgid "" +"The reason we define most of these variables is so we can use them in " +"``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:667 +msgid "" +"All of the weapons we'll make will have all of these variables (minus " +"``bullet_scene``) so we have a consistent interface to interact with in " +"``Player.gd``. By using the same variables/functions in each weapon, we can " +"interact with them without having to know which weapon we are using, which " +"makes our code much more modular because we can add weapons without having " +"to change much of the code in ``Player.gd`` and it will just work." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:672 +msgid "" +"If we could write all of the code in ``Player.gd``, but then ``Player.gd`` " +"will get increasingly harder to manage as we add weapons. By using a modular " +"design with a consistent interface, we can keep ``Player.gd`` nice and neat, " +"while also making it easier to add/remove/modify weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:677 +msgid "In ``_ready`` we simply just pass over it." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:679 +msgid "" +"There is one thing of note though, an assumption we're assuming we'll fill " +"in ``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:681 +msgid "" +"We are going to assume that ``Player.gd`` will pass themselves in before " +"calling any of the functions in ``Weapon_Pistol.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:683 +msgid "" +"While this can lead to situations where the player does not pass themselves " +"in (because we forget), we would have to have a long string of " +"``get_parent`` calls to traverse up the scene tree to retrieve the player. " +"This does not look very pretty (``get_parent().get_parent().get_parent()`` " +"and so on) and it is relatively safe to assume we will remember to pass " +"ourselves to each weapon in ``Player.gd``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:689 +msgid "Next let's look at ``fire_weapon``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:691 +msgid "The first thing we do is instance the bullet scene we made earlier." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:693 +msgid "" +"By instancing the scene, we are creating a new node holding all of the " +"node(s) in the scene we instanced, effectively cloning that scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:695 +msgid "" +"Then we add ``clone`` to the first child node of the root of the scene we " +"are currently in. By doing this we're making it at a child of the root node " +"of the currently loaded scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:697 +msgid "" +"In other words, we are adding ``clone`` as a child of the first node " +"(whatever is at the top of the scene tree) in the currently loaded/opened " +"scene. If the currently loaded/open scene is ``Testing_Area.tscn``, we'd be " +"adding our ``clone`` as a child of ``Testing_Area``, the root node in that " +"scene." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:700 +msgid "" +"As mentioned later below in the section on adding sounds, this method makes " +"a assumption. This will be explained later in the section on adding sounds " +"in :ref:`doc_fps_tutorial_part_three`" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:703 +msgid "" +"Next we set the global transform of the clone to the ``Pistol_Aim_Point``'s " +"global transform. The reason we do this is so the bullet is spawned at the " +"end of the pistol." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:705 +msgid "" +"You can see that ``Pistol_Aim_Point`` is positioned right at the end of the " +"pistol by clicking the :ref:`AnimationPlayer ` and " +"scrolling through ``Pistol_fire``. You'll find the position more or less is " +"at the end of the pistol when it fires." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:708 +msgid "" +"Next we scale it up by a factor of ``4`` because the bullet scene is a " +"little too small by default." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:710 +msgid "" +"Then we set the bullet's damage (``BULLET_DAMAGE``) to the amount of damage " +"a single pistol bullet does (``DAMAGE``)" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:714 +msgid "Now let's look at ``equip_weapon``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:716 +msgid "" +"The first thing we do is check to see if the animation manager is in the " +"pistol's idle animation. If we are in the pistol's idle animation, we set " +"``is_weapon_enabled`` to ``true`` and return ``true`` because we have " +"successfully been equipped." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:720 +msgid "" +"Because we know our pistol's ``equip`` animation automatically transitions " +"to the pistol's idle animation, if we are in the pistol's idle animation we " +"most have finished playing the equip animation." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:723 +msgid "" +"We know these animations will transition because we wrote to the code to " +"make them transition in ``Animation_Manager.gd``" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:725 +msgid "" +"Next we check to see if we are in the ``Idle_unarmed`` animation state. " +"Because all unequipping animations go to this state, and because any weapon " +"can be equipped from this state, we change animations to ``Pistol_equip`` if " +"we are in ``Idle_unarmed``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:728 +msgid "" +"Since we know ``Pistol_equip`` will transition to ``Pistol_idle``, we do not " +"need to do any more additional processing for equipping weapons, but since " +"we were not able to equip the pistol yet, we return ``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:733 +msgid "Finally, let's look at ``unequip_weapon``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:735 +msgid "" +"``unequip_weapon`` is very similar to ``equip_weapon``, but instead we're " +"checking things in reverse." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:737 +msgid "" +"First we check to see if we are in our idle animation. Then check to make " +"sure we are not in the ``Pistol_unequip`` animation. If we are not in the " +"``Pistol_unequip`` animation, we want to play ``pistol_unequip``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:740 +msgid "" +"You may be wondering why we are checking to see if we are the pistol's idle " +"animation, and then making sure we are not unequipping right after. The " +"reason behind the additional check is because we could (in rare cases) call " +"``unequip_weapon`` twice before we've had a chance to process " +"``set_animation``, so we add this additional check to make sure the unequip " +"animation plays." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:744 +msgid "" +"Next we check to see if we are in ``Idle_unarmed``, which is the animation " +"state we will transition into from ``Pistol_unequip``. If we are, then we " +"set ``is_weapon_enabled`` to false since we are no longer using this weapon, " +"and return ``true`` because we have successfully unequipped the pistol." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:747 +msgid "" +"If we are not in ``Idle_unarmed``, we return ``false`` because we have not " +"yet successfully unequipped the pistol." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:750 +msgid "Creating the other two weapons" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:752 +msgid "" +"Now that we all of the code we'll need for the pistol, let's add the code " +"for the rifle and knife next." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:754 +msgid "" +"Select ``Rifle_Point`` (``Player`` -> ``Rotation_Helper`` -> " +"``Gun_Fire_Points`` -> ``Rifle_Point``) and create a new script called " +"``Weapon_Rifle.gd``, then add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:807 +msgid "" +"Most of this is exactly the same as ``Weapon_Pistol.gd``, so we're only " +"going to look at what's changed: ``fire_weapon``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:809 +msgid "" +"The first thing we do is get the :ref:`Raycast ` node, which " +"is a child of ``Rifle_Point``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:811 +msgid "" +"Next we force the raycast to update using ``force_raycast_update``. This " +"will force the raycast to detect collisions when we call it, meaning we get " +"a frame perfect collision check with the 3D physics world." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:814 +msgid "Then we check to see if the raycast collided with something." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:816 +msgid "" +"If the raycast has collided with something, we first get the collision body " +"it collided with. This can be a :ref:`StaticBody `, :ref:" +"`RigidBody `, or a :ref:`KinematicBody " +"`." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:819 +msgid "" +"Next we want to make sure the body we've collided with is not the player, " +"since we (probably) do not want to give the player the ability to shoot " +"themselves in the foot." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:821 +msgid "" +"If the body is not the player, we then check to see if they have a function/" +"method called ``bullet_hit``. If they do, we call it and pass in the amount " +"of damage this bullet does (``DAMAGE``), and the point where the raycast " +"collided with the body." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:826 +msgid "Now all we need to do is write the code for the knife." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:828 +msgid "" +"Select ``Knife_Point`` (``Player`` -> ``Rotation_Helper`` -> " +"``Gun_Fire_Points`` -> ``Knife_Point``) and create a new script called " +"``Weapon_Knife.gd``, then add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:879 +msgid "" +"As with ``Weapon_Rifle.gd``, the only differences are in ``fire_weapon``, so " +"let's look at that:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:881 +msgid "" +"The first thing we do is get the :ref:`Area ` child node of " +"``Knife_Point``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:883 +msgid "" +"Next we want to get all of the collision bodies inside the area using " +"``get_overlapping_bodies``. This will return a list of every body that " +"touches the area." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:886 +msgid "We next want to go through each of those bodies." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:888 +msgid "" +"First we check to make sure the body is not the player, because we do not " +"want to be able to stab ourselves. If the body is the player, we use " +"``continue`` so we jump to looking at the next body in ``bodies``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:891 +msgid "" +"If we have not jumped to the next body, we then check to see if the body has " +"the ``bullet_hit`` function/method. If it does, we call it, passing in the " +"amount of damage a single knife swipe does (``DAMAGE``) and the position of " +"the :ref:`Area `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:894 +msgid "" +"While we could attempt to calculate a rough location for where the knife " +"hit, we do not bother because using the area's position works well enough " +"and the extra time needed to calculate a rough position for each body is not " +"really worth the effort." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:899 msgid "Making the weapons work" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:593 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:901 msgid "Lets start making the weapons work in ``Player.gd``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:595 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:903 msgid "" "First lets start by adding some global variables we'll need for the weapons:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:614 -msgid "Let's go over what these new variables will do:" +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:921 +msgid "Lets go over what these new variables will do:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:616 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:923 msgid "" "``animation_manager``: This will hold the :ref:`AnimationPlayer " "` node and its script, which we wrote previously." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:617 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:924 msgid "" -"``current_gun``: This is the name of the gun we are currently using. It has " -"four possible values: ``UNARMED``, ``KNIFE``, ``PISTOL``, and ``RIFLE``." +"``current_weapon_name``: The name of the weapon we are currently using. It " +"has four possible values: ``UNARMED``, ``KNIFE``, ``PISTOL``, and ``RIFLE``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:618 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:925 +msgid "``weapons``: A dictionary that will hold all of the weapon nodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:926 msgid "" -"``changing_gun``: A boolean to track whether or not we are changing guns/" +"``WEAPON_NUMBER_TO_NAME``: A dictionary allowing us to convert from a " +"weapon's number to its name. We'll use this for changing weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:927 +msgid "" +"``WEAPON_NAME_TO_NUMBER``: A dictionary allowing us to convert from a " +"weapon's name to its number. We'll use this for changing weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:928 +msgid "" +"``changing_weapon``: A boolean to track whether or not we are changing guns/" "weapons." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:619 -msgid "" -"``bullet_scene``: The bullet scene we worked on earlier, ``Bullet_Scene." -"tscn``. We need to load it here so we can create/spawn it when the pistol " -"fires" +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:929 +msgid "``changing_weapon_name``: The name of the weapon we want to change to." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:620 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:930 msgid "" "``health``: How much health our player has. In this part of the tutorial we " "will not really be using it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:621 -msgid "``RIFLE_DAMAGE``: How much damage a single rifle bullet causes." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:622 -msgid "``KNIFE_DAMAGE``: How much damage a single knife stab/swipe causes." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:623 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:931 msgid "" "``UI_status_label``: A label to show how much health we have, and how much " "ammo we have both in our gun and in reserves." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:627 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:935 msgid "" "Next we need to add a few things in ``_ready``. Here's the new ``_ready`` " "function:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:658 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:967 msgid "Let's go over what's changed." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:660 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:969 msgid "" "First we get the :ref:`AnimationPlayer ` node and " "assign it to our animation_manager variable. Then we set the callback " @@ -41347,116 +43566,231 @@ msgid "" "function, but we'll get there soon." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:664 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:973 msgid "" -"Then we get all of the weapon points and call each of their ``look_at``. " -"This will make sure they all are facing the gun aim point, which is in the " -"center of our camera at a certain distance back." +"Next we get all of the weapon nodes and assign them to ``weapons``. This " +"will allow us to access the weapon nodes only with their name (``KNIFE``, " +"``PISTOL``, or ``RIFLE``)." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:667 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:976 msgid "" -"Next we rotate all of those weapon points by ``180`` degrees on their ``Y`` " -"axis. This is because our camera is pointing backwards. If we did not rotate " -"all of these weapon points by ``180`` degrees, all of the weapons would fire " -"backwards at ourselves." +"We then get ``Gun_Aim_Point``'s global position so we can rotate our weapons " +"to aim at it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:670 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:978 +msgid "Then we go through each weapon in ``weapons``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:980 +msgid "" +"We first get the weapon node. If the weapon node is not ``null``, we then " +"set it's ``player_node`` variable to ourself. Then we have it look at " +"``gun_aim_point_pos``, and then rotate it by ``180`` degrees on the ``Y`` " +"axis." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:983 +msgid "" +"We rotate all of those weapon points by ``180`` degrees on their ``Y`` axis " +"because our camera is pointing backwards. If we did not rotate all of these " +"weapon points by ``180`` degrees, all of the weapons would fire backwards." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:986 +msgid "" +"Then we set ``current_weapon_name`` and ``changing_weapon_name`` to " +"``UNARMED``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:988 msgid "Finally, we get the UI :ref:`Label ` from our HUD." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:674 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:992 msgid "" -"Lets add a few things to ``_physics_process`` so we can fire our weapons. " -"Here's the new code:" +"Lets add a new function call to ``_physics_process`` so we can change " +"weapons. Here's the new code:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:812 -msgid "Lets go over it one chunk at a time:" +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1002 +msgid "Now we will call ``process_changing_weapons``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:816 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1006 msgid "" -"First we have an if check to see if ``changing_gun`` is equal to ``false``. " -"If it is, we then check to see if the number keys ``1`` through ``4`` are " -"pressed. If one of the keys are pressed, we set current gun to the name of " -"each weapon assigned to each key and set ``changing_gun`` to ``true``." +"Now lets add all of the player input code for the weapons in " +"``process_input``. Add the following code:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:821 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1046 +msgid "Lets go over the additions, starting with how we're changing weapons." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1048 msgid "" -"Then we check if ``changing_gun`` is ``true``. If it is ``true``, we then go " -"through a series of checks. The first set of checks is checking if we are in " -"a idle animation that is not the weapon/gun we are trying to change to, as " -"then we'd be stuck in a loop." +"First we get the current weapon's number and assign it to " +"``weapon_change_number``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:825 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1050 msgid "" -"Then we check if we are in an unarmed state. If we are and the newly " -"selected 'weapon' is ``UNARMED``, then we set ``changing_gun`` to ``false``." +"Then we check to see if any of the number keys (keys 1-4) are pressed. If " +"they are, we set ``weapon_change_number`` to the value mapped at that key." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:828 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1053 msgid "" -"If we are trying to change to any of the other weapons, we first check if we " -"are in the desired weapon's idle state. If we are, then we've successfully " -"changed weapons and set ``changing_gun`` to false." +"The reason key 1 is mapped to ``0`` is because the first element in a list " +"is mapped to zero, not one. Most list/array accessors in most programming " +"languages start at ``0`` instead of ``1``. See https://en.wikipedia.org/wiki/" +"Zero-based_numbering for more information." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:832 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1056 msgid "" -"If we are not in the desired weapon's idle state, we then check if we are in " -"the idle unarmed state. This is because all unequip animations transition to " -"idle unarmed, and because we can transition to any equip animation from idle " -"unarmed." +"Next we check to see if ``shift_weapon_positive`` or " +"``shift_weapon_negative`` is pressed. If one of them are, we add/subtract " +"``1`` from ``weapon_change_number``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:836 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1059 msgid "" -"If we are in the idle unarmed state, we set the animation to the equip " -"animation for the desired weapon. Once the equip animation is finished, it " -"will change to the idle state for that weapon, which will pass the ``if`` " -"check above." +"Because we may have shifted ``weapon_change_number`` outside of the number " +"of weapons we have, we clamp it so it cannot exceed the maximum number of " +"weapons we have and has to be ``0`` or more." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:842 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1062 msgid "" -"For firing the weapons we first check if the ``fire`` action is pressed or " -"not. If the fire action is pressed, we then check which weapon we are using." +"Then we check to make sure we are not already changing weapons. If we are " +"not, we then check to see if the weapon we want to change to is a new weapon " +"and not the one we are currently using. If the weapon we're wanting to " +"change to is a new weapon, we then set ``changing_weapon_name`` to the " +"weapon at ``weapon_change_number`` and set ``changing_weapon`` to true." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:845 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1066 msgid "" -"If we are in a weapon's idle state, we then call set the animation to the " -"weapon's fire animation." +"For firing the weapon we first check to see if the ``fire`` action is " +"pressed. Then we check to make sure we are not changing weapons. Next we get " +"the weapon node for the current weapon." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:849 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1070 +msgid "" +"If the current weapon node does not equal null, and we are in it's " +"``IDLE_ANIM_NAME`` state, we set our animation to the current weapon's " +"``FIRE_ANIM_NAME``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1075 +msgid "Lets add ``process_changing_weapons`` next." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1077 +msgid "Add the following code:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1113 +msgid "Lets go over what's happening here:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1115 +msgid "" +"The first thing we do is make sure we've recived input to change weapons. We " +"do this by making sure ``changing_weapons`` is ``true``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1117 +msgid "" +"Next we define a variable (``weapon_unequipped``) so we can check whether " +"the current weapon has been successfully unequipped or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1119 +msgid "Then we get the current weapon from ``weapons``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1121 +msgid "" +"If the current weapon is not ``null``, then we have need to check to see if " +"the weapon is enabled or not. If the weapon is enabled, we call it's " +"``unequip_weapon`` function so it will start the unequip animation. If the " +"weapon is not enabled, we set ``weapon_unequippped`` to ``true``, because we " +"the weapon has successfully been unequipped." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1124 +msgid "" +"If the current weapon is ``null``, then we can simply set " +"``weapon_unequipped`` to ``true``. The reason we do this check is because " +"there is no weapon script/node for ``UNARMED``, but there is also no " +"animations for ``UNARMED``, so we can just start equipping the weapon we " +"want to change to." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1127 +msgid "" +"If we have successfully unequipped the current weapon (``weapon_unequipped " +"== true``), we need to equip the new weapon." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1129 +msgid "" +"First we define a new variable (``weapon_equipped``) for tracking whether we " +"have successfully equipped the new weapon or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1131 +msgid "" +"Then we get the weapon we want to change to. If the weapon we want to change " +"to is not ``null``, we then check to see whether or not it's enabled. If it " +"is not enabled, we call it's ``equip_weapon`` function so it starts to equip " +"the weapon. If the weapon is enabled, we set ``weapon_equipped`` to ``true``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1134 +msgid "" +"If the weapon we want to change to is ``null``, we simply set " +"``weapon_equipped`` to ``true`` because we do not have any node/script for " +"``UNARMED``, nor do we have any animations." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1136 +msgid "" +"Finally, we check to see if we have successfully equipped the new weapon. If " +"we have, we set ``changing_weapon`` to false because we are no longer " +"changing weapons. We also set ``current_weapon_name`` to " +"``changing_weapon_name``, since the current weapon has changed, and then we " +"set ``changing_weapon_name`` to a empty string." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1141 msgid "" "Now, we just need to add one more function to the player, and then the " -"player is ready to start shooting!" +"player is ready to start the weapons!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:851 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1143 msgid "" "We just need to add ``fire_bullet``, which will be called when by the :ref:" "`AnimationPlayer ` at those points we set earlier in " "the :ref:`AnimationPlayer ` function track:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:890 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1155 msgid "Lets go over what this function is doing:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:894 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1157 msgid "" "First we check if we are changing weapons or not. If we are changing " "weapons, we do not want shoot so we just ``return``." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:896 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1159 msgid "" "Calling ``return`` stops the rest of the function from being called. In this " "case, we are not returning a variable because we are only interested in not " @@ -41464,117 +43798,45 @@ msgid "" "variable either when we call this function." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:900 -msgid "Next we check which weapon we are using." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:902 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1163 msgid "" -"If we are using a pistol, we first create a ``Bullet_Scene.tscn`` instance " -"and assign it to a variable named ``clone``. Then we get the root node in " -"the :ref:`SceneTree `, which happens to be a :ref:`Viewport " -"`. We then get the first child of the :ref:`Viewport " -"` and assign it to the ``scene_root`` variable." +"Then we just tell the current weapon we are using to fire by calling its " +"``fire_weapon`` function." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:906 -msgid "" -"We then add our newly instanced/created bullet as a child of ``scene_root``." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:908 -msgid "" -"As mentioned later below in the section on adding sounds, this method makes " -"a assumption. This will be explained later in the section on adding sounds " -"in :ref:`doc_fps_tutorial_part_three`" -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:911 -msgid "" -"Next we set the global :ref:`Transform ` of the bullet to " -"that of the pistol bullet spawn point we talked about earlier." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:914 -msgid "" -"Finally, we set the scale a little bigger because the bullet normally is too " -"small to see." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:918 -msgid "" -"For the rifle, we first get the :ref:`Raycast ` node and " -"assign it to a variable called ``ray``. Then we call :ref:`Raycast " -"`'s ``force_raycast_update`` function." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:921 -msgid "" -"``force_raycast_update`` sends the :ref:`Raycast ` out and " -"collects the collision data as soon as we call it, meaning we get frame " -"perfect collision data and we do not need to worry about performance issues " -"by having the :ref:`Raycast ` enabled all the time." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:925 -msgid "" -"Next we check if the :ref:`Raycast ` collided with anything. " -"If it has, we then get the collision body it collided with. If the body has " -"the ``bullet_hit`` method/function, we then call it and pass in " -"``RIFLE_DAMAGE`` and the position where the :ref:`Raycast ` " -"collided." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:929 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1165 msgid "" "Remember how we mentioned the speed of the animations for firing was faster " "than the other animations? By changing the firing animation speeds, you can " "change how fast the weapon fires bullets!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:935 -msgid "" -"For the knife we first get the :ref:`Area ` node and assign it " -"to a variable named ``area``. Then we get all of the collision bodies inside " -"the :ref:`Area `. We loop through each one and check if they " -"have the ``bullet_hit`` method/function. If they do, we call it and pass in " -"``KNIFE_DAMAGE`` and the global position of :ref:`Area `." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:940 -msgid "" -"While we could attempt to calculate a rough location for where the knife " -"hit, we do not bother because using the area's position works well enough " -"and the extra time needed to calculate a rough position for each body is not " -"really worth the effort." -msgstr "" - -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:947 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1171 msgid "" "Before we are ready to test our new weapons, we still have just a little bit " "of work to do." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:950 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1174 msgid "Creating some test subjects" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:952 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1176 msgid "" "Create a new script by going to the scripting window, clicking \"file\", and " -"selecting new. Name this script \"RigidBody_hit_test\" and make sure it " +"selecting new. Name this script ``RigidBody_hit_test`` and make sure it " "extends :ref:`RigidBody `." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:955 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1179 msgid "Now we just need to add this code:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:971 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1195 msgid "Lets go over how ``bullet_hit`` works:" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:973 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1197 msgid "" "First we get the direction from the bullet pointing towards our global :ref:" "`Transform `. We do this by subtracting the bullet's hit " @@ -41583,7 +43845,7 @@ msgid "" "direction the bullet collided into the :ref:`RigidBody ` at." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:978 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1202 msgid "" "We then normalize it so we do not get crazy results from collisions on the " "extremes of the collision shape attached to the :ref:`RigidBody " @@ -41592,7 +43854,7 @@ msgid "" "reaction than those closer to the center." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:983 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1207 msgid "" "Finally, we apply an impulse at the passed in bullet collision position. " "With the force being the directional vector times the damage the bullet is " @@ -41600,48 +43862,1285 @@ msgid "" "move in response to the bullet colliding into it." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:989 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1213 msgid "" "Now we just need to attach this script to all of the :ref:`RigidBody " "` nodes we want to effect." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:991 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1215 msgid "" "Open up ``Testing_Area.tscn`` and select all of the cubes parented to the " "``Cubes`` node." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:993 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1217 msgid "" "If you select the top cube, and then hold down ``shift`` and select the last " "cube, Godot will select all of the cubes in between!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:996 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1220 msgid "" "Once you have all of the cubes selected, scroll down in the inspector until " "you get to the the \"scripts\" section. Click the drop down and select \"Load" "\". Open your newly created ``RigidBody_hit_test.gd`` script." msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:999 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1228 msgid "" -"With that done, go give your guns a whirl! You should now be able to fire as " -"many bullets as you want on the cubes and they will move in response to the " -"bullets colliding into them." +"That was a lot of code! But now with all that done you can go give your " +"weapons a test!" msgstr "" -#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1002 +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1230 msgid "" -"In :ref:`doc_fps_tutorial_part_three`, we will add ammo to the guns, as well " -"as some sounds!" +"You should now be able to fire as many bullets as you want on the cubes and " +"they will move in response to the bullets colliding into them." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1233 +msgid "" +"In :ref:`doc_fps_tutorial_part_three`, we will add ammo to the weapons, as " +"well as some sounds!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_two.rst:1237 +msgid "" +"You can download the finished project for this part here: :download:" +"`Godot_FPS_Part_2.zip `" msgstr "" #: ../../docs/tutorials/3d/fps_tutorial/index.rst:2 msgid "FPS tutorial" msgstr "" +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:4 +msgid "Part 5" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:9 +msgid "" +"In this part we're going to add grenades to our player, give our player the " +"ability to grab and throw objects, and add turrets!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:13 +msgid "" +"You are assumed to have finished :ref:`doc_fps_tutorial_part_four` before " +"moving on to this part of the tutorial." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:15 +msgid "" +"The finished project from :ref:`doc_fps_tutorial_part_four` will be the " +"starting project for part 5" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:20 +msgid "Adding grenades" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:22 +msgid "" +"First, let's give our player some grenades to play with. Open up ``Grenade." +"tscn``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:24 +msgid "" +"There's a few things to note here, the first and foremost being that our " +"grenades are going to use :ref:`RigidBody ` nodes. We're " +"going to use :ref:`RigidBody ` nodes for our grenades so " +"they bounce around the world in a somewhat realistic manner." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:27 +msgid "" +"The second thing to note is ``Blast_Area``. This is a :ref:`Area " +"` node that will represent the blast radius of our grenade." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:29 +msgid "" +"Finally, the last thing to note is ``Explosion``. This is the :ref:" +"`Particles ` node that will emit an explosion effect when " +"the grenades explodes. One thing to note here is that we have ``One shot`` " +"enabled. This is so we emit all of our particles at once. We're also " +"emitting in world coordinates instead of local coordinates, so we have " +"``Local Coords`` unchecked as well." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:33 +msgid "" +"If you want you can see how the particles are set up by looking through it's " +"``Process Material`` and ``Draw Passes``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:35 +msgid "" +"Let's write the code needed for our grenade. Select ``Grenade`` and make a " +"new script called ``Grenade.gd``. Add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:91 +msgid "Let's go over what's happening, starting with the global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:93 +msgid "" +"``GRENADE_DAMAGE``: The amount of damage the grenade causes when it explodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:94 +msgid "" +"``GRENADE_TIME``: The amount of time the grenade takes (in seconds) to " +"explode once it's created/thrown." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:95 +msgid "" +"``grenade_timer``: A variable for tracking how long the grenade has been " +"created/thrown." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:96 +msgid "" +"``EXPLOSION_WAIT_TIME``: The amount of time needed (in seconds) to wait " +"before we destroy the grenade scene after the explosion" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:97 +msgid "" +"``explosion_wait_timer``: A variable for tracking how much time has passed " +"since the grenade exploded." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:98 +msgid "" +"``rigid_shape``: The :ref:`CollisionShape ` for the " +"grenade's :ref:`RigidBody `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:99 +msgid "" +"``grenade_mesh``: The :ref:`MeshInstance ` for the " +"grenade." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:100 +msgid "" +"``blast_area``: The blast :ref:`Area ` used to damage things " +"when the grenade explodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:101 +msgid "" +"``explosion_particles``: The :ref:`Particles ` that play " +"when the grenade explodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:103 +msgid "" +"Notice how ``EXPLOSION_WAIT_TIME`` is a rather strange number (``0.48``). " +"This is because we want ``EXPLOSION_WAIT_TIME`` to be the length of time the " +"particles are emitting, so when the particles are done we destroy/free the " +"grenade. We calculate ``EXPLOSION_WAIT_TIME`` by taking the particle's life " +"time and dividing it by the particle's speed scale. This gets us the exact " +"time the explosion particles will last." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:109 +msgid "Now let's turn our attention to ``_ready``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:111 +msgid "" +"First we get all of the nodes we'll need and assign them to the proper " +"global variables." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:113 +msgid "" +"We need to get the :ref:`CollisionShape ` and :ref:" +"`MeshInstance ` because similarly to the target in :ref:" +"`doc_fps_tutorial_part_four`, we will be hiding the grenade's mesh and " +"disabling the collision shape when the grenade explodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:116 +msgid "" +"The reason we need to get the blast :ref:`Area ` is so we can " +"damage everything inside it when it explodes. We'll be using code similar to " +"the knife weapon in our player. We need the :ref:`Particles " +"` so we can emit them when we explode." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:119 +msgid "" +"After we get all of the nodes and assign them to their global variables, we " +"then make sure the explosion particles are not emitting, and that they are " +"set to emit in one shot." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:124 +msgid "Now let's look at ``_process``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:126 +msgid "" +"First we check to see if the ``grenade_timer`` is less than " +"``GRENADE_TIMER``. If it is, we add ``delta`` and return. This is so we have " +"to wait ``GRENADE_TIME`` seconds, allowing our :ref:`RigidBody " +"` to move around." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:129 +msgid "" +"If ``grenade_timer`` is at ``GRENADE_TIMER`` or higher, we then need to " +"check if we just waited long enough and need to explode. We do this by " +"checking to see if ``explosion_wait_timer`` is equal to ``0`` or less. Since " +"we will be adding ``delta`` to ``explosion_wait_timer`` right after, " +"whatever code under the check will only be called once, right when we've " +"waited long enough and need to explode." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:133 +msgid "" +"If we've waited long enough to explode, we first tell the " +"``explosion_particles`` to emit. Then we make ``grenade_mesh`` invisible, " +"and disable ``rigid_shape``, effectively hiding our grenade." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:136 +msgid "" +"We then set the :ref:`RigidBody `'s mode to ``MODE_STATIC`` " +"so the grenade does not move." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:138 +msgid "" +"Then we get all of the bodies in ``blast_area``, check to see if they have " +"the ``bullet_hit`` method/function, and if they do we call it and pass in " +"``GRENADE_DAMAGE`` and the grenade's position." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:141 +msgid "" +"We then check to see if ``explosion_wait_timer`` is less than " +"``EXPLOSION_WAIT_TIME``. If it is, we add ``delta`` to " +"``explosion_wait_time``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:143 +msgid "" +"Next we check to see if ``explosion_wait_timer`` is more than or equal to " +"``EXPLOSTION_WAIT_TIME``. Because we just added ``delta``, this will only be " +"called once. If ``explosion_wait_timer`` is more or equal to " +"``EXPLOSION_WAIT_TIME``, we've waited long enough to let the :ref:`Particles " +"` play and can free/destroy ourselves." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:148 +msgid "" +"Let's quickly get the sticky grenade set up too. Open up ``Sticky_Grenade." +"tscn``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:150 +msgid "" +"``Sticky_Grenade.tscn`` is almost identical to ``Grenade.tscn``, with one " +"small addition. We now have a second :ref:`Area `, called " +"``Sticky_Area``. We'll be using ``Stick_Area`` to detect when we've collided " +"with the environment and need to stick to something." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:154 +msgid "" +"Select ``Sticky_Grenade`` and make a new script called ``Sticky_Grenade." +"gd``. Add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:244 +msgid "" +"The code above is almost identical to the code for ``Grenade.gd``, so let's " +"just go over what's changed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:246 +msgid "First, we have a few more global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:248 +msgid "" +"``attached``: A variable for tracking whether or not we've attached to a :" +"ref:`PhysicsBody `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:249 +msgid "" +"``attach_point``: A variable to hold a :ref:`Spatial ` that " +"will be at the position we collided at." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:250 +msgid "" +"``player_body``: The player's :ref:`KinematicBody `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:252 +msgid "" +"These additions are so we can stick to any :ref:`PhysicsBody " +"` we happen to hit. We also now need the player's :ref:" +"`KinematicBody ` so we don't stick to the player that " +"threw this grenade." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:257 +msgid "" +"Now let's look at the small change in ``_ready``. In ``_ready`` we've added " +"a line of code so when any body enters ``Stick_Area``, the " +"``collided_with_body`` function is called." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:262 +msgid "Next let's take a look at ``collided_with_body``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:264 +msgid "" +"First we make sure we're not colliding with ourself. Because our :ref:`Area " +"` does not know it's attached to the grenade's :ref:`RigidBody " +"`, we need to make sure we're not going to stick to " +"ourself. If we have collided with ourself, we just ignore it by returning." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:267 +msgid "" +"We then check to see if we have something assigned to ``player_body``, and " +"if the body we collided with is the player that threw this grenade. If the " +"body we've collided with is indeed ``player_body``, we just ignore it by " +"returning." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:270 +msgid "Next we check if we are attached already or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:272 +msgid "" +"If we are not attached, we then set ``attached`` to true so we know we've " +"attached to something." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:274 +msgid "" +"We then make a new :ref:`Spatial ` node, and make it a child " +"of the body we collided with. We then set the :ref:`Spatial " +"`'s position to our current position." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:277 +msgid "" +"Because we've added the :ref:`Spatial ` as a child of the " +"body we've collided with, it will follow along with said body. We can then " +"use this :ref:`Spatial ` to set our position, so we're always " +"at the same position relative to the body we collided with." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:280 +msgid "" +"We then disable ``rigid_shape`` so we're not constantly moving whatever body " +"we've collided with. Finally, we set our mode to ``MODE_STATIC`` so the " +"grenade does not move." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:284 +msgid "Finally, lets go over the few changes in ``_process``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:286 +msgid "" +"Now we're checking to see if we are attached right at the top of " +"``_process``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:288 +msgid "" +"If we are attached, we then make sure the attached point is not equal to " +"``null``. If the attached point is not equal to ``null``, we set our global " +"position (using our global :ref:`Transform `'s origin) to " +"the global position of the :ref:`Spatial ` assigned to " +"``attach_point`` (using its global :ref:`Transform `'s " +"origin)." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:292 +msgid "" +"The only other change is now before we free/destroy the grenade, we check to " +"see if we have an attached point. If we do, we also call ``queue_free`` on " +"it, so it's also freed/destroyed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:296 +msgid "Adding grenades to the player" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:298 +msgid "" +"Now we need to add some code to ``Player.gd`` so we can use our grenades." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:300 +msgid "" +"First, open up ``Player.tscn`` and expand the node tree until you get to " +"``Rotation_Helper``. Notice how in ``Rotation_Helper`` we have a node called " +"``Grenade_Toss_Pos``. This is where we will be spawning the grenades." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:303 +msgid "" +"Also notice how it's slightly rotated on the ``X`` axis, so it's not " +"pointing straight, but rather slightly up. By changing the rotation of " +"``Grenade_Toss_Pos``, you can change the angle the grenades are tossed at." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:306 +msgid "" +"Okay, now lets start making the grenades work with our player. Add the " +"following global variables to ``Player.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:316 +msgid "" +"``grenade_amounts``: The amount of grenades we are currently carrying for " +"each type of grenade." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:317 +msgid "" +"``current_grenade``: The name of the grenade type we're currently using." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:318 +msgid "``grenade_scene``: The grenade scene we worked on earlier." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:319 +msgid "" +"``sticky_grenade_scene``: The sticky grenade scene we worked on earlier." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:320 +msgid "``GRENADE_THROW_FORCE``: The force at which we throw the grenade at." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:322 +msgid "" +"Most of these variables are very similar to how we have out weapons set up." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:324 +msgid "" +"While it's possible to make a more modular grenade system, I found it was " +"not worth the additional complexity for just two grenades. If you were going " +"to make a more complex FPS with more grenades, you'd likely want to make a " +"system for grenades similar to how we have the weapons set up." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:329 +msgid "" +"Now we need to add some code in ``_process_input`` Add the following to " +"``_process_input``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:361 +msgid "" +"First, we check to see if the ``change_grenade`` action has just been " +"pressed. If it has, we then check to see which grenade we are currently " +"using. Based on the name of the grenade we're currently using, we change " +"``current_grenade`` to the opposite grenade name." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:364 +msgid "" +"Next we check to see if the ``fire_grenade`` action has just been pressed. " +"If it has, we then check to see if we have more than ``0`` grenades for the " +"current grenade we have selected." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:367 +msgid "" +"If we have more than ``0`` grenades, we then remove one from the grenade " +"amounts for the current grenade. Then, based on the grenade we're currently " +"using we instance the proper grenade scene and assign it to " +"``grenade_clone``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:370 +msgid "" +"Next we add ``grenade_clone`` as a child of the node at the root, and set " +"its global :ref:`Transform ` to ``Grenade_Toss_Pos``'s " +"global :ref:`Transform `. Finally, we apply an impulse to " +"the grenade so that it is launched forward, relative to the ``Z`` " +"directional vector of ``grenade_clone``'s." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:376 +msgid "" +"Now we can use both types of grenades, but there's a few things we should " +"probably add before we move on to adding the other things." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:378 +msgid "" +"We still need a way to see how many grenades we have left, and we should " +"probably have a way to get more grenades when we pick up ammo." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:380 +msgid "" +"First, let's change some of the code in ``Player.gd`` so we can see how many " +"grenades we have left. Change ``process_UI`` to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:396 +msgid "Now we'll show how many grenades we have left in our UI." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:398 +msgid "" +"While we're still in ``Player.gd``, let's add a function to add grenades. " +"Add the following function to ``Player.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:406 +msgid "" +"Now we can add a grenade using ``add_grenade``, and it will automatically be " +"clamped to a maximum of ``4`` grenades." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:408 +msgid "" +"You can change the ``4`` to a constant if you want. You'd just need to make " +"a new global constant, something like ``MAX_GRENADES``, and then change the " +"clamp from ``clamp(grenade_amounts[current_grenade], 0, 4)`` to " +"``clamp(grenade_amounts[current_grenade], 0, MAX_GRENADES)``" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:411 +msgid "" +"If you do not want to limit how many grenades you can carry, just remove the " +"line that clamps the grenades altogether!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:413 +msgid "" +"Now we have a function to add grenades, let's open up ``AmmoPickup.gd`` and " +"use it!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:415 +msgid "" +"Open up ``AmmoPickup.gd`` and go to the ``trigger_body_entered`` function. " +"Change it to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:430 +msgid "" +"Now we're also checking to see if the body has the ``add_grenade`` function. " +"If it does, we call it just like we call ``add_ammo``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:432 +msgid "" +"You may have noticed we're using a new constant we haven't defined yet, " +"``GRENADE_AMOUNTS``. Let's add it! Add the following global variable to " +"``AmmoPickup.gd`` with the other global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:439 +msgid "" +"``GRENADE_AMOUNTS``: The amount of grenades each pick up in each size " +"contains." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:441 +msgid "" +"Notice how the second element in ``GRENADE_AMOUNTS`` is ``0``. This is so " +"the small ammo pick up does not give our player any additional grenades." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:446 +msgid "Now you should be able to throw grenades now! Go give it a try!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:450 +msgid "Adding the ability to grab and throw RigidBody nodes to the player" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:452 +msgid "" +"Next let's give our player the ability to pick up and throw :ref:`RigidBody " +"` nodes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:463 +msgid "" +"``grabbed_object``: A variable to hold the grabbed :ref:`RigidBody " +"` node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:464 +msgid "``OBJECT_THROW_FORCE``: The force we throw the grabbed object at." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:465 +msgid "" +"``OBJECT_GRAB_DISTANCE``: The distance away from the camera we hold the " +"grabbed object at." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:466 +msgid "" +"``OBJECT_GRAB_RAY_DISTANCE``: The distance the :ref:`Raycast " +"` goes. This is our grab distance." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:468 +msgid "" +"With that done, all we need to do is add some code to ``process_input``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:508 +msgid "" +"First we check to see if the action pressed is the ``fire`` action, and that " +"we are using the ``UNARMED`` weapon. This is because we only want to be able " +"to pick up and throw objects when we're not using any weapons. This is just " +"a design choice, but I feel it gives ``UNARMED`` a use." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:512 +msgid "Next we check to see whether or not ``grabbed_object`` is ``null``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:516 +msgid "" +"If ``grabbed_object`` is ``null``, we want to see if we can pick up a :ref:" +"`RigidBody `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:518 +msgid "" +"We first get the direct space state from the current :ref:`World " +"`. This is so we can cast a ray entirely from code, instead of " +"having to use a :ref:`Raycast ` node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:521 +msgid "" +"see :ref:`Ray-casting ` for more information on raycasting " +"in Godot." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:523 +msgid "" +"Then we get the center of the screen by dividing the current :ref:`Viewport " +"` size in half. We then get the ray's origin point and end " +"point using ``project_ray_origin`` and ``project_ray_normal`` from the " +"camera. If you want to know more about how these functions work, see :ref:" +"`Ray-casting `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:526 +msgid "" +"Next we send our ray into the space state and see if we get a result. We add " +"ourselves and the knife's :ref:`Area ` as two exceptions so we " +"cannot carry ourselves or the knife's collision area." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:529 +msgid "" +"Then we check to see if we got a result back. If we have, we then see if the " +"collider the ray collided with is a :ref:`RigidBody `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:531 +msgid "" +"If the ray collided with a :ref:`RigidBody `, we set " +"``grabbed_object`` to the collider the ray collided with. We then set the " +"mode on the :ref:`RigidBody ` we collided with to " +"``MODE_STATIC`` so it's not moved." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:534 +msgid "" +"Finally, we set its collision layer and collision mask to ``0``. This will " +"make it have no collision layer or mask, which will means it will not be " +"able to collide with anything." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:538 +msgid "" +"If ``grabbed_object`` is not ``null``, then we need to throw the :ref:" +"`RigidBody ` we're holding." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:540 +msgid "" +"We first set the :ref:`RigidBody ` we holding mode to " +"``MODE_RIGID``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:542 +msgid "" +"This is making a rather large assumption that the all rigid bodies will be " +"using ``MODE_RIGID``. While that is the case for this tutorial series, that " +"may not be the case in other projects." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:545 +msgid "" +"If you have :ref:`RigidBody `'s with different modes, you " +"may need to store the mode of the :ref:`RigidBody ` you " +"have picked up into a global variable so you can change it back to the mode " +"it was in before you picked it up." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:548 +msgid "" +"Then we apply an impulse to send it flying forward. We send it flying in the " +"direction the camera is facing, at ``OBJECT_THROW_FORCE`` force." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:550 +msgid "" +"We then set the grabbed :ref:`RigidBody `'s collision layer " +"and mask to ``1``, so it can collide with anything on layer ``1`` again." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:552 +msgid "" +"This is, once again, making a rather large assumption that all rigid bodies " +"will be only on collision layer ``1``, and all collision masks will be on " +"layer ``1``. If you are using this script in other projects, you may need to " +"store the collision layer/mask of the :ref:`RigidBody ` " +"before you change them to ``0``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:555 +msgid "" +"Finally, we set ``grabbed_object`` to ``null`` since we have successfully " +"thrown the held object." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:559 +msgid "" +"The last thing we do is check to see whether or not ``grabbed_object`` is " +"equal to ``null``, outside of the grabbing/throwing code." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:561 +msgid "" +"While technically not input related, it's easy enough to place the code " +"moving the grabbed object here because it's only two lines, and then all of " +"the grabbing/throwing code is in one place" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:564 +msgid "" +"If we are holding an object, we set its global position to the camera's " +"position plus ``OBJECT_GRAB_DISTANCE`` in the direction the camera is facing." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:568 +msgid "" +"Before we test this, we need to change something in ``_physics_process``. " +"While we're holding an object, we really don't want to be able to change " +"weapons or reload, so change ``_physics_process`` to the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:585 +msgid "Now we cannot change weapons or reload while holding an object." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:587 +msgid "" +"Now you can grab and throw RigidBody nodes while in a ``UNARMED`` state! Go " +"give it a try!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:590 +msgid "Adding a turret" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:592 +msgid "Next, let's make a turret to shoot our player!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:594 +msgid "" +"Open up ``Turret.tscn``. Expand ``Turret`` if it's not already expanded." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:596 +msgid "" +"Notice how our turret is broken up into several parts. We have a ``Base``, " +"``Head``, ``Vision_Area``, and a ``Smoke`` :ref:`Particles " +"`." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:598 +msgid "" +"Open up ``Base`` and you'll find it's just a :ref:`StaticBody " +"` and a mesh. Open up ``Head`` and you'll find there's " +"several meshes, a :ref:`StaticBody ` and a :ref:`Raycast " +"` node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:601 +msgid "" +"One thing to note with the ``Head`` is that the raycast will be where our " +"bullets will fire from if we are using raycasting. We also have two meshes " +"called ``Flash`` and ``Flash_2``. These will be the muzzle flash that " +"briefly shows when the turret fires." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:604 +msgid "" +"``Vision_Area`` is a :ref:`Area ` we'll use as the turret's " +"ability to see. When something enters ``Vision_Area``, we'll assume the " +"turret can see it." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:606 +msgid "" +"``Smoke`` is a :ref:`Particles ` node that will play when " +"the turret is destroyed and repairing." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:610 +msgid "" +"Now that we've looked at how the scene is set up, lets start writting the " +"code for the turret. Select ``Turret`` and create a new script called " +"``Turret.gd``. Add the following to ``Turret.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:776 +msgid "" +"This is quite a bit of code, so let's break it down function by function. " +"Let's first look at the global variables:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:778 +msgid "" +"``use_raycast``: A exported boolean so we can change whether the turret uses " +"objects or raycasting for bullets." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:779 +msgid "" +"``TURRET_DAMAGE_BULLET``: The amount of damage a single bullet scene does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:780 +msgid "" +"``TURRET_DAMAGE_RAYCAST``: The amount of damage a single :ref:`Raycast " +"` bullet does." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:781 +msgid "" +"``FLASH_TIME``: The amount of time (in seconds) the muzzle flash meshes are " +"visible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:782 +msgid "" +"``flash_timer``: A variable for tracking how long the muzzle flash meshes " +"have been visible." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:783 +msgid "``FIRE_TIME``: The amount of time (in seconds) needed to fire a bullet." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:784 +msgid "" +"``fire_timer``: A variable for tracking how much time has passed since the " +"turret last fired." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:785 +msgid "``node_turret_head``: A variable to hold the ``Head`` node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:786 +msgid "" +"``node_raycast``: A variable to hold the :ref:`Raycast ` node " +"attached to the turret's head." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:787 +msgid "" +"``node_flash_one``: A variable to hold the first muzzle flash :ref:" +"`MeshInstance `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:788 +msgid "" +"``node_flash_two``: A variable to hold the second muzzle flash :ref:" +"`MeshInstance `." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:789 +msgid "``ammo_in_turret``: The amount of ammo currently in the turret." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:790 +msgid "``AMMO_IN_FULL_TURRET``: The amount of ammo in a full turret." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:791 +msgid "``AMMO_RELOAD_TIME``: The amount of time it takes the turret to reload." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:792 +msgid "" +"``ammo_reload_timer``: A variable for tracking how long the turret has been " +"reloading." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:793 +msgid "``current_target``: The turret's current target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:794 +msgid "" +"``is_active``: A variable for tracking whether the turret is able to fire at " +"the target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:795 +msgid "" +"``PLAYER_HEIGHT``: The amount of height we're adding to the target so we're " +"not shooting at its feet." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:796 +msgid "``smoke_particles``: A variable to hold the smoke particles node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:797 +msgid "``turret_health``: The amount of health the turret currently has." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:798 +msgid "``MAX_TURRET_HEALTH``: The amount of health a fully healed turret has." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:799 +msgid "" +"``DESTROYED_TIME``: The amount of time (in seconds) it takes for a destroyed " +"turret to repair itself." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:800 +msgid "" +"``destroyed_timer``: A variable for tracking the amount of time a turret has " +"been destroyed." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:801 +msgid "" +"``bullet_scene``: The bullet scene the turret fires (same scene as the " +"player's pistol)" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:803 +msgid "Phew, that's quite a few global variables!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:807 +msgid "Let's go through ``_ready`` next." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:809 +msgid "" +"First we get the vision area and connect the ``body_entered`` and " +"``body_exited`` signals to ``body_entered_vision`` and " +"``body_exited_vision`` respectively." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:811 +msgid "" +"We then get all of the nodes and assign them to their respective variables." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:813 +msgid "" +"Next add some exceptions to the :ref:`Raycast ` so the turret " +"cannot hurt itself." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:815 +msgid "" +"Then we make both flash meshes invisible to start, since we're not going to " +"be firing during ``_ready``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:817 +msgid "" +"We then get the smoke particles node and assign it to the " +"``smoke_particles`` node. We also set ``emitting`` to ``false`` to assure " +"it's not emitting until the turret is broken." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:820 +msgid "" +"Finally, we set the turret's health to ``MAX_TURRET_HEALTH`` so it starts at " +"full health." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:824 +msgid "Now let's go through ``_physics_process``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:826 +msgid "" +"First we check to see if the turret is active. If the turret is active we " +"want to process the firing code." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:828 +msgid "" +"Next we check to see if ``flash_timer`` is more than zero, meaning the flash " +"meshes are visible, we want to remove delta from ``flash_timer``. If " +"``flash_timer`` gets to zero or less after we've subtracted ``delta``, we " +"want to hide both of the flash meshes." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:832 +msgid "" +"Next we check to see if we have a target or not. If we have a target, we " +"make the turret head look at it, adding ``PLAYER_HEIGHT`` so we're not " +"aiming at the player's feet." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:835 +msgid "" +"We then check to see if the turret's health is more than zero. If it is, we " +"then check to see if there is ammo in the turret." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:837 +msgid "" +"If there is ammo in the turret, we then check to see if ``fire_timer`` is " +"more than zero. If ``fire_timer`` is more than zero, we cannot fire and need " +"to remove ``delta`` from ``fire_timer``. If ``fire_timer`` is equal to or " +"less than zero, we want to fire a bullet, so we call the ``fire_bullet`` " +"function." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:840 +msgid "" +"If there is not any ammo in the turret, we check to see if " +"``ammo_reload_timer`` is more than zero. If ``ammo_reload_timer`` is more " +"than zero, we subtract ``delta`` from ``ammo_reload_timer``. If " +"``ammo_reload_timer`` is equal to or less than zero, we set " +"``ammo_in_turret`` to ``AMMO_IN_FULL_TURRET`` because we've waited long " +"enough to refill the turret." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:844 +msgid "" +"Next we check to see if the turret's health is less than or equal to ``0``, " +"outside of whether we're active or not. If the turret's health is zero or " +"less, we then check to see if ``destroyed_timer`` is more than zero. If " +"destroyed timer is more than zero, we just subtract ``delta`` from " +"``destroyed_timer``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:847 +msgid "" +"If ``destyored_timer`` is less than or equal to zero, we set " +"``turret_health`` to ``MAX_TURRET_HEALTH`` and stop emitting smoke particles " +"by setting ``smoke_particles.emitting`` to ``false``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:852 +msgid "Next let's go through ``fire_bullet``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:854 +msgid "First we check to see whether we're using a raycast or not." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:856 +msgid "" +"The code for the using a raycast is almost entirely the same as the code in " +"the rifle from :ref:`doc_fps_tutorial_part_two`, so I'm only going to go " +"over it briefly." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:859 +msgid "" +"We first make the raycast look at the target, assuring we'll hit the target. " +"We then force the raycast to update so we get a frame perfect collision " +"check. We then check if the raycast collided with anything. If the raycast " +"has collided with something, we then check to see if the collided body has " +"the ``bullet_hit`` function. If it does, we call it and pass in the damage a " +"single raycast bullet does. We then remove ``1`` from ``ammo_in_turret``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:864 +msgid "" +"If we are not using a raycast, we spawn a bullet object instead. This code " +"is almost entirely the same as the code in the pistol from :ref:" +"`doc_fps_tutorial_part_two`, so like with the raycast code, I'm only going " +"to go over it briefly." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:867 +msgid "" +"We first make a bullet clone and assign it to ``clone``. We then add that as " +"a child of the root node. We set it's global transform to the barrel end, " +"scale it up since it's too small, and set it's damage and speed using the " +"turret's constant global variables. We then remove ``1`` from " +"``ammo_in_turret``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:871 +msgid "" +"Then, regardless of which bullet method we used, we make both of the muzzle " +"flash meshes visible. We set ``flash_timer`` and ``fire_timer`` to to " +"``FLASH_TIME`` and ``FIRE_TIME`` respectively. We then check to see if we " +"used the last bullet in the turret. If we have used the last bullet, we set " +"``ammo_reload_timer`` to ``AMMO_RELOAD_TIME``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:877 +msgid "" +"Let's look at ``body_entered_vision`` next, and thankfully it's rather short." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:879 +msgid "" +"We first check to see if we currently have a target by checking to see if " +"``current_target`` is equal to ``null``. If we do not have a target, we then " +"check to see if the body that just entered the vision :ref:`Area " +"` is a :ref:`KinematicBody `" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:882 +msgid "" +"..note:: We're assuming the turret only should fire at :ref:`KinematicBody " +"` nodes, since that's what our player(s) are using." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:884 +msgid "" +"If the body that just the vision :ref:`Area ` is a :ref:" +"`KinematicBody `, we set ``current_target`` to the " +"body, and set ``is_active`` to ``true``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:889 +msgid "Now let's look at ``body_exited_vision``." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:891 +msgid "" +"First we check to see if we have a target. If we have a target, we then " +"check to see if the body that has just left our vision area is our target." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:894 +msgid "" +"If the body that just left the area is the current target, we set " +"``current_target`` to ``null``, set ``is_active`` to ``false``, and reset " +"all of the variables related to firing the turret, since we no longer have a " +"target to fire at." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:901 +msgid "" +"We first remove however much damage we have received from the turret's " +"health." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:903 +msgid "" +"Then we check to see if we've been destroyed. If we have, we start the smoke " +"particles emitting and set ``destroyed_timer`` to ``DESTROYED_TIME`` so we " +"have to wait to repair the turret." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:908 +msgid "" +"Phew, with all of that done and coded we only have one last thing to do " +"before our turrets are ready for use. Open up ``Turret.tscn`` if it's not " +"already open and select one of the :ref:`StaticBody ` " +"nodes from either ``Body`` or ``Head``. Create a new script called " +"``TurretBodies.gd`` and attach it to whichever :ref:`StaticBody " +"` you have selected." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:912 +msgid "Add the following code to ``TurretBodies.gd``:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:927 +msgid "" +"All this code does is call ``bullet_hit`` on whatever node " +"``path_to_turret_root`` leads to. Go back to the editor and assign the :ref:" +"`NodePath ` to the ``Turret`` node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:930 +msgid "" +"Now select the other :ref:`StaticBody ` node (either in " +"``Body`` or ``Head``) and assign ``TurretBodies.gd`` to it. Once the script " +"is attached, assign the :ref:`NodePath ` to the ``Turret`` " +"node." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:935 +msgid "" +"The last thing we need to do is add a way for the player to be hurt. Since " +"all of our bullets use the ``bullet_hit`` function, we just need to add that " +"to our player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:937 +msgid "Open ``Player.gd`` and add the following:" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:944 +msgid "" +"With all that done, you should have fully operational turrets! Go place a " +"few in one/both/all of the scenes and give them a try!" +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:951 +msgid "" +"Now you the player can pick up :ref:`RigidBody ` nodes and " +"throw grenades. We now also have turrets to fire at our player." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:953 +msgid "" +"In :ref:`doc_fps_tutorial_part_six`, we're going to add a main menu and " +"pause menu, add a respawn system for the player, and change/move the sound " +"system so we can use it from any script." +msgstr "" + +#: ../../docs/tutorials/3d/fps_tutorial/part_five.rst:958 +msgid "" +"You can download the finished project for this part here: :download:" +"`Godot_FPS_Part_5.zip `" +msgstr "" + #: ../../docs/tutorials/3d/3d_performance_and_limitations.rst:4 msgid "3D performance and limitations" msgstr "" @@ -42853,7 +46352,7 @@ msgstr "" msgid "" "Finally, as the highest layers are created by stretching small blurred " "images, it is possible that some blockyness may be visible. Enabling " -"**Bicubic Upscaling** gets rids of the it, at a minimal performance cost." +"**Bicubic Upscaling** gets rids of it, at a minimal performance cost." msgstr "" #: ../../docs/tutorials/3d/environment_and_post_processing.rst:272 @@ -43783,7 +47282,7 @@ msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:8 msgid "" "Before continuing on, I'd recommend reading some theory, the simplest " -"article I find is this:" +"article I could find is this:" msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:11 @@ -43796,39 +47295,40 @@ msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:16 msgid "" -"Talking in Godot terminology, the task we want to solve here is position our " -"2 angles we talked about above so, that the tip of lowerarm bone is as close " -"to target point, which is set by target Vector3() as possible using only " -"rotations. This task is very calculation-intensive and never resolved by " -"analytical equation solve. So, it is an underconstrained problem, which " -"means there is unlimited number of solutions to the equation." +"Talking in Godot terminology, the task we want to solve here is to position " +"our 2 angles we talked about above so, that the tip of the lowerarm bone is " +"as close to the target point (which is set by the target Vector3()) as " +"possible using only rotations. This task is very calculation-intensive and " +"never resolved by analytical equation solving. So, it is an underconstrained " +"problem, which means there is an unlimited number of solutions to the " +"equation." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:26 msgid "" -"For easy calculation, for this chapter we consider target is also child of " -"Skeleton. If it is not the case for your setup you can always reparent it in " -"your script, as you will save on calculations if you do." +"For easy calculation, in this chapter we consider the target being a child " +"of Skeleton. If this is not the case for your setup you can always reparent " +"it in your script, as you will save on calculations if you do so." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:31 msgid "" -"In the picture you see angles alpha and beta. In this case we don't use " +"In the picture you see the angles alpha and beta. In this case we don't use " "poles and constraints, so we need to add our own. On the picture the angles " -"are 2D angles living in plane which is defined by bone base, bone tip and " +"are 2D angles living in a plane which is defined by bone base, bone tip and " "target." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:36 msgid "" -"The rotation axis is easily calculated using cross-product of bone vector " -"and target vector. The rotation in this case will be always in positive " -"direction. If t is the Transform which we get from get_bone_global_pose() " -"function, the bone vector is" +"The rotation axis is easily calculated using the cross-product of the bone " +"vector and the target vector. The rotation in this case will be always in " +"positive direction. If ``t`` is the Transform which we get from the " +"get_bone_global_pose() function, the bone vector is" msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:45 -msgid "So we have all information here to execute our algorithm." +msgid "So we have all the information we need to execute our algorithm." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:47 @@ -43845,33 +47345,34 @@ msgid "**How to find coordinates of the tip of the bone?**" msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:54 -msgid "**How to find vector from bone base to target?**" +msgid "**How to find the vector from the bone base to the target?**" msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:56 msgid "" "For our goal (tip of the bone moved within area of target), we need to know " "where the tip of our IK bone is. As we don't use a leaf bone as IK bone, we " -"know the coordinate of the bone base is the tip of parent bone. All these " -"calculations are quite dependent on the skeleton's structure. You can use " -"pre-calculated constants as well. You can add an extra bone for the tip of " -"IK and calculate using that." +"know the coordinate of the bone base is the tip of the parent bone. All " +"these calculations are quite dependent on the skeleton's structure. You can " +"use pre-calculated constants as well. You can add an extra bone at the tip " +"of the IK bone and calculate using that." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:66 -msgid "We will just use exported variable for bone length to be easy." +msgid "" +"We will just use an exported variable for the bone length to make it easy." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:74 msgid "" -"Now, we need to apply our transformations from IK bone to the base of chain. " -"So we apply rotation to IK bone then move from our IK bone up to its parent, " -"then apply rotation again, then move to the parent of current bone again, " -"etc. So we need to limit our chain somewhat." +"Now, we need to apply our transformations from the IK bone to the base of " +"the chain. So we apply a rotation to the IK bone then move from our IK bone " +"up to its parent, apply rotation again, then move to the parent of the " +"current bone again, etc. So we need to limit our chain somewhat." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:83 -msgid "For ``_ready()`` function:" +msgid "For the ``_ready()`` function:" msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:92 @@ -43884,29 +47385,29 @@ msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:113 msgid "" -"Executing this script will just pass through bone chain printing bone " +"Executing this script will just pass through the bone chain, printing bone " "transforms." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:143 msgid "" -"Now we need to actually work with target. The target should be placed " -"somewhere accessible. Since \"arm\" is imported scene, we better place " -"target node within our top level scene. But for us to work with target " -"easily its Transform should be on the same level as Skeleton." +"Now we need to actually work with the target. The target should be placed " +"somewhere accessible. Since \"arm\" is an imported scene, we better place " +"the target node within our top level scene. But for us to work with target " +"easily its Transform should be on the same level as the Skeleton." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:148 msgid "" -"To cope with this problem we create \"target\" node under our scene root " -"node and at script run we will reparent it copying global transform, which " -"will achieve wanted effect." +"To cope with this problem we create a \"target\" node under our scene root " +"node and at runtime we will reparent it copying the global transform, which " +"will achieve the desired effect." msgstr "" #: ../../docs/tutorials/3d/inverse_kinematics.rst:152 msgid "" -"Create new Spatial node under root node and rename it to \"target\". Then " -"modify ``_ready()`` function to look like this:" +"Create a new Spatial node under the root node and rename it to \"target\". " +"Then modify the ``_ready()`` function to look like this:" msgstr "" #: ../../docs/tutorials/3d/lights_and_shadows.rst:4 @@ -44123,7 +47624,7 @@ msgstr "" #: ../../docs/tutorials/3d/lights_and_shadows.rst:107 msgid "" "Sometimes, the transition between a split and the next can look bad. To fix " -"this, the **\"Blend Splits\"** option can be turned own, which sacrifices " +"this, the **\"Blend Splits\"** option can be turned on, which sacrifices " "detail in exchange for smoother transitions:" msgstr "" @@ -44142,7 +47643,7 @@ msgid "" msgstr "" #: ../../docs/tutorials/3d/lights_and_shadows.rst:119 -msgid "Finally, the **\"Depth Range\"** has to settings:" +msgid "Finally, the **\"Depth Range\"** has two settings:" msgstr "" #: ../../docs/tutorials/3d/lights_and_shadows.rst:121 @@ -45241,7 +48742,7 @@ msgstr "" #: ../../docs/tutorials/3d/using_multi_mesh_instance.rst:16 msgid "" -"The basic setup requires three nodes. Firstly, the multiMeshInstance node. " +"The basic setup requires three nodes. Firstly, the MultiMeshInstance node. " "Then, two MeshInstance nodes." msgstr "" @@ -45254,7 +48755,7 @@ msgstr "" #: ../../docs/tutorials/3d/using_multi_mesh_instance.rst:20 msgid "" "Another node is used as the source, the mesh that you want to have " -"duplicate. In the tree case, this would be the tree." +"duplicated. In the tree case, this would be the tree." msgstr "" #: ../../docs/tutorials/3d/using_multi_mesh_instance.rst:22 @@ -45264,8 +48765,7 @@ msgid "" msgstr "" #: ../../docs/tutorials/3d/using_multi_mesh_instance.rst:26 -msgid "" -"For simplification purpose, this tutorial would use built-in primitives." +msgid "For simplification purposes, this tutorial uses built-in primitives." msgstr "" #: ../../docs/tutorials/3d/using_multi_mesh_instance.rst:28 @@ -45564,79 +49064,78 @@ msgstr "" msgid "A default basis (unmodified) is akin to:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:106 +#: ../../docs/tutorials/3d/using_transforms.rst:124 msgid "This is also an analog to a 3x3 identity matrix." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:108 +#: ../../docs/tutorials/3d/using_transforms.rst:126 msgid "" "Following the OpenGL convention, ``X`` is the *Right* axis, ``Y`` is the " "*Up* axis and ``Z`` is the *Forward* axis." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:110 +#: ../../docs/tutorials/3d/using_transforms.rst:128 msgid "" "Together with the *basis*, a transform also has an *origin*. This is a " "*Vector3* specifying how far away from the actual origin ``(0, 0, 0)`` this " "transform is. Combining the *basis* with the *origin*, a *transform* " -"efficiently represents a unique translation, rotation, and scale in " -"space. .. image:: img/transforms_camera.png" +"efficiently represents a unique translation, rotation, and scale in space." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:114 +#: ../../docs/tutorials/3d/using_transforms.rst:133 msgid "" "One way to visualize a transform is to look at an object's 3D gizmo while in " "\"local space\" mode." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:118 +#: ../../docs/tutorials/3d/using_transforms.rst:137 msgid "" "The gizmo's arrows show the ``X``, ``Y``, and ``Z`` axes (in red, green, and " "blue respectively) of the basis, while gizmo's center is at the object's " "origin." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:122 +#: ../../docs/tutorials/3d/using_transforms.rst:141 msgid "" "For more information on the mathematics of vectors and transforms, please " "read the :ref:`doc_vector_math` tutorials." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:125 +#: ../../docs/tutorials/3d/using_transforms.rst:144 msgid "Manipulating Transforms" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:127 +#: ../../docs/tutorials/3d/using_transforms.rst:146 msgid "" "Of course, transforms are not as straightforward to manipulate as angles and " "have problems of their own." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:129 +#: ../../docs/tutorials/3d/using_transforms.rst:148 msgid "" "It is possible to rotate a transform, either by multiplying its basis by " "another (this is called accumulation), or by using the rotation methods." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:139 +#: ../../docs/tutorials/3d/using_transforms.rst:165 msgid "A method in Spatial simplifies this:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:148 +#: ../../docs/tutorials/3d/using_transforms.rst:182 msgid "This rotates the node relative to the parent node." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:150 +#: ../../docs/tutorials/3d/using_transforms.rst:184 msgid "" "To rotate relative to object space (the node's own transform) use the " "following:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:160 +#: ../../docs/tutorials/3d/using_transforms.rst:198 msgid "Precision Errors" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:162 +#: ../../docs/tutorials/3d/using_transforms.rst:200 msgid "" "Doing successive operations on transforms will result in a loss of precision " "due to floating-point error. This means the scale of each axis may no longer " @@ -45644,72 +49143,72 @@ msgid "" "other." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:164 +#: ../../docs/tutorials/3d/using_transforms.rst:202 msgid "" "If a transform is rotated every frame, it will eventually start deforming " "over time. This is unavoidable." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:166 +#: ../../docs/tutorials/3d/using_transforms.rst:204 msgid "" "There are two different ways to handle this. The first is to " "*orthonormalize* the transform after some time (maybe once per frame if you " "modify it every frame):" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:172 +#: ../../docs/tutorials/3d/using_transforms.rst:215 msgid "" "This will make all axes have ``1.0`` length again and be ``90`` degrees from " "each other. However, any scale applied to the transform will be lost." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:174 +#: ../../docs/tutorials/3d/using_transforms.rst:217 msgid "" "It is recommended you don't scale nodes that are going to be manipulated. " "Scale their children nodes instead (such as MeshInstance). If you absolutely " "must scale the node, then re-apply it at the end:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:183 +#: ../../docs/tutorials/3d/using_transforms.rst:231 msgid "Obtaining Information" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:185 +#: ../../docs/tutorials/3d/using_transforms.rst:233 msgid "" "You might be thinking at this point: **\"Ok, but how do I get angles from a " "transform?\"**. The answer again is: you don't. You must do your best to " "stop thinking in angles." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:187 +#: ../../docs/tutorials/3d/using_transforms.rst:235 msgid "" "Imagine you need to shoot a bullet in the direction your player is facing. " "Just use the forward axis (commonly ``Z`` or ``-Z``)." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:194 +#: ../../docs/tutorials/3d/using_transforms.rst:248 msgid "" "Is the enemy looking at the player? Use the dot product for this (see the :" "ref:`doc_vector_math` tutorial for an explanation of the dot product):" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:203 +#: ../../docs/tutorials/3d/using_transforms.rst:267 msgid "Strafe left:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:211 +#: ../../docs/tutorials/3d/using_transforms.rst:284 msgid "Jump:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:221 +#: ../../docs/tutorials/3d/using_transforms.rst:304 msgid "All common behaviors and logic can be done with just vectors." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:224 +#: ../../docs/tutorials/3d/using_transforms.rst:307 msgid "Setting Information" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:226 +#: ../../docs/tutorials/3d/using_transforms.rst:309 msgid "" "There are, of course, cases where you want to set information to a " "transform. Imagine a first person controller or orbiting camera. Those are " @@ -45717,28 +49216,28 @@ msgid "" "in a specific order." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:228 +#: ../../docs/tutorials/3d/using_transforms.rst:311 msgid "" "For such cases, keep the angles and rotations *outside* the transform and " "set them every frame. Don't try retrieve them and re-use them because the " "transform is not meant to be used this way." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:230 +#: ../../docs/tutorials/3d/using_transforms.rst:313 msgid "Example of looking around, FPS style:" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:248 +#: ../../docs/tutorials/3d/using_transforms.rst:356 msgid "" "As you can see, in such cases it's even simpler to keep the rotation " "outside, then use the transform as the *final* orientation." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:251 +#: ../../docs/tutorials/3d/using_transforms.rst:359 msgid "Interpolating with Quaternions" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:253 +#: ../../docs/tutorials/3d/using_transforms.rst:361 msgid "" "Interpolating between two transforms can efficiently be done with " "quaternions. More information about how quaternions work can be found in " @@ -45748,11 +49247,11 @@ msgid "" "allow interpolation between them using the closest axis." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:255 +#: ../../docs/tutorials/3d/using_transforms.rst:363 msgid "Converting a rotation to quaternion is straightforward." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:267 +#: ../../docs/tutorials/3d/using_transforms.rst:386 msgid "" "The :ref:`class_Quat` type reference has more information on the datatype " "(it can also do transform accumulation, transform points, etc. though this " @@ -45761,24 +49260,24 @@ msgid "" "may suffer from numerical precision errors." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:269 +#: ../../docs/tutorials/3d/using_transforms.rst:388 msgid "" "Quaternions are very useful when doing camera/path/etc. interpolations, as " "the result will be always correct and smooth." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:272 +#: ../../docs/tutorials/3d/using_transforms.rst:391 msgid "Transforms are your friend" msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:274 +#: ../../docs/tutorials/3d/using_transforms.rst:393 msgid "" "For most beginners, getting used to working with transforms can take some " "time. However, once you get used to them, you will appreciate their " "simplicity and power." msgstr "" -#: ../../docs/tutorials/3d/using_transforms.rst:276 +#: ../../docs/tutorials/3d/using_transforms.rst:395 msgid "" "Don't hesitate to ask for help on this topic in any of Godot's `online " "communities `_ and, once you become " @@ -51984,11 +55483,11 @@ msgid "" "` method exists. Example" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:54 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:69 msgid "Sizing" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:56 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:71 msgid "" "As mentioned before, size is very important to controls. This allows them to " "lay out properly, when set into grids, containers, or anchored. Controls " @@ -51998,61 +55497,61 @@ msgid "" "your custom control is not squished by the other controls in the container." msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:64 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:79 msgid "" "To provide this callback, just override :ref:`Control.get_minimum_size() " "`, for example:" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:73 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:96 msgid "Or alternatively, set it via function:" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:83 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:114 msgid "" "Controls provide a few helpers to make managing input events much easier " "than regular nodes." msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:87 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:118 msgid "Input events" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:89 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:120 msgid "" "There are a few tutorials about input before this one, but it's worth " "mentioning that controls have a special input method that only works when:" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:93 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:124 msgid "The mouse pointer is over the control." msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:94 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:125 msgid "" "The button was pressed over this control (control always captures input " "until button is released)" msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:96 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:127 msgid "" "Control provides keyboard/joypad focus via :ref:`Control.focus_mode " "`." msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:99 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:130 msgid "" "This function is :ref:`Control._gui_input() `. " "Simply override it in your control. No processing needs to be set." msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:111 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:167 msgid "" "For more information about events themselves, check the :ref:" "`doc_inputevent` tutorial." msgstr "" -#: ../../docs/tutorials/gui/custom_gui_controls.rst:117 +#: ../../docs/tutorials/gui/custom_gui_controls.rst:173 msgid "" "Controls also have many useful notifications for which no callback exists, " "but can be checked with the _notification callback:"