Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action and task programs #39

Open
BrunoMine opened this issue Apr 18, 2018 · 2 comments
Open

Action and task programs #39

BrunoMine opened this issue Apr 18, 2018 · 2 comments

Comments

@BrunoMine
Copy link
Contributor

I am already working on updating the documentation with the new tasks and actions that will work in program format.
I would like to use this issue for explanations on some programs.
Can you explain more details about the IDLE ("advanced_npc:idle") program? To better understand ways it can be used.

@hkzorman
Copy link
Owner

The "advanced_npc:idle" program is a program meant to be run when NPC are doing nothing and standing idle. It has two main features (as-of the moment, more planned):

  • Acknowledge nearby objects by looking at them, with configurable object search interval and radius
  • Trigger wandering with configurable chance (1-100 chance of wander) and radius (how many nodes to wander from starting point)

Both features above are disabable.
Idle program doesn't loops, it is meant to be executed as a state program (which is scheduled continously as long as the process queue is empty)

@BrunoMine
Copy link
Contributor Author

BrunoMine commented Apr 23, 2018

About "advanced_npc:node_query" program, can this be used like any program?

Is this documentation completely correct?

#### `NODE QUERY` (advanced_npc:node_query)
Check and run a program with nodes found near.

    {
        range = 2, -- Range of checked area in blocks.
        
        count = 20, -- How many checks will be performed.
        
        random_execution_times = true, --[[
            ^ Randomizes the number of checks that will be performed.
            ^ min_count and max_count is required ]]
        
        min_count = 20, -- minimum of checks
        max_count = 25, -- maximum of checks
        
        nodes = {"itemstring1", "itemstring2"}, --[[ 
            ^ Nodes to be found for the actions.
            ^ When a node is found, it is add in the npc place map 
              with the place name "schedule_target_pos"
        
        prefer_last_acted_upon_node = true, -- If prefer to act on nodes already acted upon
        
        walkable_nodes = {"itemstring1", "itemstring2"}, -- Walkable nodes
        
        on_found_executables = { --[[
            ^ Table where index is a itemstring of the node to be found, 
              and value is an array of programs to be performed 
              when found the node. ]]
       	
            ["itemstring1"] = {            
               [1] = <program>,
               [2] = <program>,
               [3] = <program>
            },
            ["itemstring2"] = {            
               [1] = <program>,
               [2] = <program>
            }
        },
        
        on_not_found_executables = { --[[ 
            ^ An array of programs to be performed when not found any node.
            
            [1] = <program>,
            [2] = <program>
        },

        state_program_on_finished = <program> --[[ 
            ^ [OPTIONAL] 
            ^ A state program performed after ending all check counts ]]
        
    }

EDIT: state_program_on_finished included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants