Skip to content

Commit

Permalink
Merge pull request #50 from xavco63/master
Browse files Browse the repository at this point in the history
Update and completion of Logic Node documentation
  • Loading branch information
IzaZed authored Dec 10, 2024
2 parents 7ca8e52 + c8f232e commit a2e28c3
Show file tree
Hide file tree
Showing 17 changed files with 95 additions and 24 deletions.
7 changes: 6 additions & 1 deletion source/manual/logic_nodes/data/list/append.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Append
==============================

Append a value in the end of a given list.

Inputs
++++++++++++++++++++++++++++++

Expand All @@ -28,7 +30,10 @@ Done
*True* if node performs successfully, else *False*.

List
Resulting list.
The given list with the new value attached at the end.

.. note::
Square socket indicates a list.

.. note::
If you give the list [1, 2, 3, 4] and the Integer 5, the output will be the list [1, 2, 3, 4, 5]
2 changes: 1 addition & 1 deletion source/manual/logic_nodes/data/list/duplicate.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Duplicate
==============================

todo
Duplicate a list in order to do changes on it without altering the original list.

Inputs
++++++++++++++++++++++++++++++
Expand Down
11 changes: 7 additions & 4 deletions source/manual/logic_nodes/data/list/extend.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@
Extend
==============================

Will extend one list with another. todo
Extend (concatenate) one list with another.

Inputs
++++++++++++++++++++++++++++++

List 1
List to be extended. todo
List to be extended. This list will be placed first in the output list.

List 2
List to use for extending. todo
List to use for extending. This list will be placed just after *List 1* in the output list.

Outputs
++++++++++++++++++++++++++++++

List
Resulting combined list from *List 1* and *List 2*.
A new list made by concatenating *List 1* and *List 2*.

.. note::
If you give *List 1* [1, 2, 3, 4] and *List 2* [5, 6, 7, 8, 9, 10], the output will be the list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
6 changes: 5 additions & 1 deletion source/manual/logic_nodes/data/list/get_list_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Get List Index
==============================

Retrieve value at specifiend index of the list.
Retrieve value at specified index of the list.

Inputs
++++++++++++++++++++++++++++++
Expand All @@ -25,3 +25,7 @@ Outputs

Value
Resulting value at index from list.

.. note::
The list index start at 0, so for example, in the list [4, 2, 5, 8, 9], if you retrieve the value
at index 4, the node output will be 9.
2 changes: 2 additions & 0 deletions source/manual/logic_nodes/data/list/get_random_list_item.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Get Random List Item
==============================

Randomly pick an item from a given list.

Inputs
++++++++++++++++++++++++++++++

Expand Down
16 changes: 10 additions & 6 deletions source/manual/logic_nodes/data/list/list_from_items.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,27 @@
List From Items
==============================

Create a new list with the given items.

Parameters
++++++++++++++++++++++++++++++

Add Socket
Will add another socket for additional items.
Add another socket for additional items inputs.

Inputs
++++++++++++++++++++++++++++++

Item
First item to add to list.

Item
Second item to add.
Item to add to list. Each press of *Add Socket* will add another *Item* input.
Items will be add to the list from top (index 0) to bottom (index list length-1).

Outputs
++++++++++++++++++++++++++++++

List
Resulting populated list with added items.
New list with the added items.

.. note::
Leaving an *Item* input blank will result in a Null item in your list.
TODO: Add an example with mutiple blank item inputs.
2 changes: 2 additions & 0 deletions source/manual/logic_nodes/data/list/new_list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
New List
==============================

Create a new empty list.

Inputs
++++++++++++++++++++++++++++++

Expand Down
5 changes: 5 additions & 0 deletions source/manual/logic_nodes/data/list/remove_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Remove Index
==============================

Remove the value at a given index on a list.

Inputs
++++++++++++++++++++++++++++++

Expand All @@ -29,3 +31,6 @@ Done

List
Resulting list after removal.

.. note::
The list index start at 0, so for example, in the list [4, 2, 5, 8, 9], the value at index 2 will be 5.
9 changes: 8 additions & 1 deletion source/manual/logic_nodes/data/list/remove_value.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
Remove Value
==============================

Remove the first iteration of a given value in a list.

Inputs
++++++++++++++++++++++++++++++

Condition
Condition to be fulfilled for node to activate.

List
Which list to use.
List to remove the value from.

Type
Which type and value to remove from list.
Expand All @@ -29,3 +31,8 @@ Done

List
Resulting list after value removal.

.. note::
This node will only remove the first iteration in the list,
for example if you give the list [1, 4, 104, 1] and the value integer 1,
the output list will be [4, 104, 1] and not [4, 104] like we can think at first.
6 changes: 6 additions & 0 deletions source/manual/logic_nodes/data/list/set_list_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Set List Index
==============================

Set a value for a given index on a list.

Inputs
++++++++++++++++++++++++++++++

Expand All @@ -32,3 +34,7 @@ Done

List
Resulting list after setting the index.

.. note::
This node cannot be used to add a new value at the end of a list, it will result in
an out of range error. Instead use the *Append* node to do this.
4 changes: 2 additions & 2 deletions source/manual/logic_nodes/input/keyboard/instream.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Pressed
*True* if the node performed successfully, else *False*.

Character
Integer code of the recorded key.
Character represented by the key pressed (String). For example ``'a'`` will be returned for key A.

Keycode
Letter representation of the recorded key.
Integer code of the recorded key (Integer).
2 changes: 1 addition & 1 deletion source/manual/logic_nodes/time/barrier.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Outputs
++++++++++++++++++++++++++++++

Out
`True` if input condition has been `True` for "Time" seconds, else `False`.
`True` if input condition has been `True` for *Time* seconds, else `False`.
13 changes: 11 additions & 2 deletions source/manual/logic_nodes/time/delay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,26 @@
Delay
==============================

Wait a certain time between the reception of *True* and the output of *True*.

Inputs
++++++++++++++++++++++++++++++

Condition
If connected, condition must be fulfilled for node to activate.

Delay
*Delay* value to use.
*Delay* in seconds until the node set it output to *True*.

Outputs
++++++++++++++++++++++++++++++

Out
Resulting delay value to apply.
*True* one frame after the condition input has been fulfilled and the *Delay* has elapsed, else *False*.

.. important::
*Delay* will handle muliple inputs at the same time and will stack them, unlike the *Timer* node.
For example, if you connect a *Keyboard key* node to a *Delay* set to 5 seconds
and press the key a first time and then 2 seconds later you press the key again, *Delay* will
output *True* 5 seconds after the first key press and another one time *True* at 7 seconds,
unlike *Timer*.
7 changes: 6 additions & 1 deletion source/manual/logic_nodes/time/delta_factor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@
Delta Factor
==============================

Return the delta factor, a normalized multiplier based on the ratio between the actual number of FPS and
the target number of FPS (the number of FPS the logic is runnig at).

Outputs
++++++++++++++++++++++++++++++

Factor
*Delta Factor* of . todo
*Delta Factor* between the actual number of FPS and the number of FPS used by the logic (Float). Used to dissociate logic and framerate,
to maintain the same speed for actions managed by logic even with an unlimited number of FPS. For example, used to calculate
the walk speed of a character.
4 changes: 3 additions & 1 deletion source/manual/logic_nodes/time/pulsify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Pulsify
==============================

Returns *True* periodically (pulses) from a continuous input, according to a defined duration and frequency.

Inputs
++++++++++++++++++++++++++++++

Expand All @@ -22,4 +24,4 @@ Outputs
++++++++++++++++++++++++++++++

Out
Resulting . todo
*True* when pulses occur, else *False*.
14 changes: 11 additions & 3 deletions source/manual/logic_nodes/time/time_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@
Time Data
==============================

Return useful data about the time within your game.

Outputs
++++++++++++++++++++++++++++++

Time
todo
The number of seconds elapsed since the game engine was launched (Float).

.. note::
The value returned here is independent of a scene change (time will continue to be counted without resetting the count),
but it will be reset after loading a .blend file because it relaunches the game engine.

Delta (Frametime)
todo
The number of seconds elapsed between the last two frames (Float). Used for calculations requiring absolute temporal precision,
such as progressive transitions, interpolations or mechanics requiring fine temporal management. For example,
if you want to animate an object that has to move exactly 10 units over 5 seconds.

FPS
*Frames Per Second* of the running game.
*Frames Per Second* of the running game (Float).
9 changes: 9 additions & 0 deletions source/manual/logic_nodes/time/timer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
Timer
==============================

Wait a certain time between the reception of *True* and the output of *True*.

Inputs
++++++++++++++++++++++++++++++

Expand All @@ -26,3 +28,10 @@ When Elapsed

.. note::
*Timer* node is tied to the CPU clock, not to game FPS.

.. important::
*Timer* will only handle one input at a time and will not stack them, unlike the *Delay* node.
For example, if you connect a *Keyboard key* node to a *Timer* set to 5 seconds
and press the key a first time and then 2 seconds later you press the key again, *Timer* will only
output *True* 5 seconds after the first key press and not another one time *True* at 7 seconds,
unlike *Delay*.

0 comments on commit a2e28c3

Please sign in to comment.