Create: Difference between revisions
(add tooltip text) |
(Marked this version for translation) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
<translate> | <translate> | ||
<!--T:11--> | <!--T:11--> | ||
[[Category:Agents]] | [[Category:Agents]] | ||
<section begin=image/>[[File:Create Block.png|alt=The create block|thumb]]<section end=image | <section begin=image/>[[File:Create Block.png|alt=The create block|thumb]]<section end=image/><p id="tooltip">Creates the specified number of agents of the selected breed.</p> The created agents have the default shape, color, and size specified in their breed’s ‘Show Traits’ area. They are created in the middle of the terrain, on the ground (x = 0, y = 0, z = 0), with their headings evenly distributed, starting at 0 degrees (e.g. if 4 are created, one will start out facing toward each of the 4 sides of spaceland.) | ||
'''<code>create [_] [▼](s)</code>'''<section end=name/> is a [[Special:MyLanguage/Code Block|code block]] part of the [[Special:MyLanguage/Agent|agents]] drawer. | <!--T:22--> | ||
{{#vardefine:create|<code>create [_] [▼](s)</code>}}<section begin=name/>'''<code>create [_] [▼](s)</code>'''<section end=name/> is a [[Special:MyLanguage/Code Block|code block]] part of the [[Special:MyLanguage/Agent|agents]] drawer. | |||
==Usage== <!--T:12--> | ==Usage== <!--T:12--> | ||
Line 19: | Line 17: | ||
<!--T:15--> | <!--T:15--> | ||
[[File:Create Nums Es.png|right|alt=The Create Each Do Block|thumb]] | |||
<!-- <code> create [Textbox: Number] [Dropdown: Type of Agent](s) </code> --> | <!-- <code> create [Textbox: Number] [Dropdown: Type of Agent](s) </code> --> | ||
Inputs in this block: | Inputs in this block: | ||
#a number in the socket | #a number in the socket | ||
#a breed from the dropdown menu | #a breed from the dropdown menu | ||
==Example== <!--T:23--> | |||
<!--T:24--> | |||
[[File:delete_everyone_example.gif|right|alt=Create Example gif|thumb]] | |||
[[File:create_example.png|right|alt=Create Example code|thumb]] | |||
<!--T:25--> | |||
When the setup button is pushed, The World first deletes all the agents, then uses the create block to to create 100 Turtles. Because the Turtles’ defaults have not been changed, they appear as white cubes of size 1. The Turtles also have the default location of (x= 0, y = 0, z = 0) when created, but then The World uses the scatter everyone block, which scatters the Turtles that now exist. | |||
==Nuances== <!--T:16--> | ==Nuances== <!--T:16--> |
Latest revision as of 15:30, 16 August 2023
Creates the specified number of agents of the selected breed.
The created agents have the default shape, color, and size specified in their breed’s ‘Show Traits’ area. They are created in the middle of the terrain, on the ground (x = 0, y = 0, z = 0), with their headings evenly distributed, starting at 0 degrees (e.g. if 4 are created, one will start out facing toward each of the 4 sides of spaceland.)
create [_] [▼](s)
is a code block part of the agents drawer.
Usage
create [_] [▼](s)
is used to populate Spaceland with agents.
Syntax
Inputs in this block:
- a number in the socket
- a breed from the dropdown menu
Example
When the setup button is pushed, The World first deletes all the agents, then uses the create block to to create 100 Turtles. Because the Turtles’ defaults have not been changed, they appear as white cubes of size 1. The Turtles also have the default location of (x= 0, y = 0, z = 0) when created, but then The World uses the scatter everyone block, which scatters the Turtles that now exist.
Nuances
An important difference between create [_] [▼](s)
and create [_] [▼](s) each do
is that create [_] [▼](s) each do
allows a section of code to run individually for each agent that is created. create [_] [▼](s)
only creates agents with the default traits in the center of Spaceland.
create [_] [▼](s) each do
can be useful for randomizing traits and scattering agents without effecting others.