Set World To: Difference between revisions
No edit summary |
(Marked this version for translation) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
<!--T:1--> | <!--T:1--> | ||
[[Category:Environment]] | [[Category:Environment]] | ||
<section begin=image/>[[File:Set World To Block.png|alt=The set world to block|thumb]]<section end=image/> | <section begin=image/>[[File:Set World To Block.png|alt=The set world to block|thumb]]<section end=image/><p id="tooltip">Sets the value of a selected world trait. World traits can be created by adding a new trait to the World breed in the breed manager.</p> | ||
<!--T:8--> | |||
To add a new trait to the World breed, go to The World tab and click on the show traits button. Then, select “add custom trait.” | |||
<!--T:7--> | |||
<section begin=name/>'''{{Block|set world [▼] to [_]}}'''<section end=name/> is a [[code block]] part of the [[Environment]] drawer. | <section begin=name/>'''{{Block|set world [▼] to [_]}}'''<section end=name/> is a [[code block]] part of the [[Environment]] drawer. | ||
<!--T:2--> | <!--T:2--> | ||
==Usage== | ==Usage== | ||
{{Block|set world [▼] to [_]}} is used to set [[trait]]s of the [[world]] in a similar way to agents. | |||
<!--T:3--> | <!--T:3--> | ||
==Syntax== | ==Syntax== | ||
[[File:Set World To Nums.png|right|alt=The Create Each Do Block|thumb]] | |||
<!--<code>set world [Dropdown: Trait Selection] to [Socket: Data]</code> --> | <!--<code>set world [Dropdown: Trait Selection] to [Socket: Data]</code> --> | ||
Inputs: | Inputs: | ||
#a world trait from the dropdown menu | #a world trait from the dropdown menu | ||
#a number | #a number | ||
==Example== <!--T:9--> | |||
<!--T:10--> | |||
[[File:set_world_to_example.gif|alt=Set World To example gif|thumb]] | |||
[[File:set_world_to_example.png|alt=Set World To example code|thumb]] | |||
<!--T:11--> | |||
The model above is of plant growth throughout the four seasons. The World trait temperature depends on the season. All of the seasons have different temperature ranges, using the ‘set to’ block to set a random temperature in that range. The plants in the simulation react both to the temperature of The World, and the precipitation that falls during winter and spring. | |||
<!--T:4--> | <!--T:4--> |
Latest revision as of 19:10, 11 August 2023
Sets the value of a selected world trait. World traits can be created by adding a new trait to the World breed in the breed manager.
To add a new trait to the World breed, go to The World tab and click on the show traits button. Then, select “add custom trait.”
set world [▼] to [_]
is a code block part of the Environment drawer.
Usage
set world [▼] to [_]
is used to set traits of the world in a similar way to agents.
Syntax
Inputs:
- a world trait from the dropdown menu
- a number
Example
The model above is of plant growth throughout the four seasons. The World trait temperature depends on the season. All of the seasons have different temperature ranges, using the ‘set to’ block to set a random temperature in that range. The plants in the simulation react both to the temperature of The World, and the precipitation that falls during winter and spring.
Nuances
This block is used to soley modify custom traits of the world. The traits of agents are modified using the set my [▼] to [_]
.