Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
plantlife_modpack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
plantlife_modpack
Commits
3c9fcf3b
Commit
3c9fcf3b
authored
12 years ago
by
Vanessa Ezekowitz
Browse files
Options
Downloads
Patches
Plain Diff
Updated API.txt to accoutn for the latest updates
parent
e8ade417
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
API.txt
+16
-10
16 additions, 10 deletions
API.txt
with
16 additions
and
10 deletions
API.txt
+
16
−
10
View file @
3c9fcf3b
...
...
@@ -114,16 +114,18 @@ checking is disabled. Same holds true for the nneighbors bit above that.
-----
To register a plant to be spawned at mapgen time rather than via an ABM, call
this function:
this function with two parameters: a table with the biome information, and
a string or table describing what to execute if the engine finds a suitable
node (see below):
plantslib:register_generate_plant(biome)
plantslib:register_generate_plant(biome
, function_or_treedef
)
Where "biome" is a table containing about a dozen variables:
biome = {
surface = "string", -- [*] what nodes to spawn on.
avoid =
{table}, -- [*] what nodes to avoid when spawning.
radius = num,
-- [*] how much distance to leave between
avoid
_nodes
=
{table}, -- [*] what nodes to avoid when spawning.
avoid_
radius = num, -- [*] how much distance to leave between
the object to be added and the objects
to be avoided.
seed_diff = num, -- perlin seed-diff value. Defaults to 0,
...
...
@@ -155,18 +157,22 @@ biome = {
allowable temperature).
temp_max = num, -- maximum perlin temperature value (coldest
allowable temperature).
exec_funct = "string", -- [**] name of the function to use to
actually build the object if the code
decides it is time to do so.
}
[*] These entries are required for the spawn code to work. Everything else
is optional. Unless explicitly stated, all unused/unsupplied parameters
default to nil and will not affect the results of the code.
[**] A string indicating the name of the function that should be called if a
suitable spawn location has been found. This function will be passed a
single parameter, pos, indicating where the object should be placed.
Regarding function_or_treedef, this must either be a string indicating the
name of the function that should be called if a suitable spawn location has
been found, OR a table with an L-Systems tree definition.
If you specify a string with a function name, that function will be passed a
single position parameter (in the usual table format), indicating where the
object should be placed. If you specified an L-Systems tree definition, then
that definition will be passed directly to the spawn_tree() function along
with the position to spawn the tree on.
-----
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment