mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
8 lines
16 KiB
HTML
8 lines
16 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/pet_command - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a> — <a href="datum/pet_command.html#var">Var Details</a> - <a href="datum/pet_command.html#proc">Proc Details</a></header><main><h1>Pet Command <aside>/<a href="datum.html">datum</a>/<a href="datum/pet_command.html">pet_command</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L8"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 8"></a></h1><p>Set some AI blackboard commands in response to receiving instructions
|
||
This is abstract and should be extended for actual behaviour</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/pet_command.html#var/command_desc">command_desc</a></th><td>Description to display in radial menu</td></tr><tr><th><a href="datum/pet_command.html#var/command_feedback">command_feedback</a></th><td>Shown above the mob's head when it hears you</td></tr><tr><th><a href="datum/pet_command.html#var/command_name">command_name</a></th><td>Unique name used for radial selection, should not be shared with other commands on one mob</td></tr><tr><th><a href="datum/pet_command.html#var/command_regex">command_regex</a></th><td>The regex for finding our commands in speech</td></tr><tr><th><a href="datum/pet_command.html#var/hidden">hidden</a></th><td>If true, command will not appear in radial menu and can only be accessed through speech</td></tr><tr><th><a href="datum/pet_command.html#var/parent_uid">parent_uid</a></th><td>UID of who follows this command</td></tr><tr><th><a href="datum/pet_command.html#var/pointed_reaction">pointed_reaction</a></th><td>our pointed reaction we play</td></tr><tr><th><a href="datum/pet_command.html#var/requires_pointing">requires_pointing</a></th><td>does this pet command need a point to activate?</td></tr><tr><th><a href="datum/pet_command.html#var/sense_radius">sense_radius</a></th><td>How close a mob needs to be to a target to respond to a command</td></tr><tr><th><a href="datum/pet_command.html#var/speech_commands">speech_commands</a></th><td>Speech strings to listen out for</td></tr><tr><th><a href="datum/pet_command.html#var/targeting_strategy_key">targeting_strategy_key</a></th><td>Blackboard key for targeting strategy, this is likely going to need it</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/pet_command.html#proc/add_new_friend">add_new_friend</a></th><td>Register a new guy we want to listen to</td></tr><tr><th><a href="datum/pet_command.html#proc/execute_action">execute_action</a></th><td>Execute an AI action on the provided controller, what we should actually do when this command is active.
|
||
This should basically always be called from a planning subtree which passes its own controller.
|
||
Return SUBTREE_RETURN_FINISH_PLANNING to pass that instruction on to the controller, or don't if you don't want that.</td></tr><tr><th><a href="datum/pet_command.html#proc/find_command_in_text">find_command_in_text</a></th><td>Returns true if we find any of our spoken commands in the text.
|
||
if check_verbosity is true, skip the match if there spoken_text is way longer than the match</td></tr><tr><th><a href="datum/pet_command.html#proc/look_for_target">look_for_target</a></th><td>Target the pointed atom for actions</td></tr><tr><th><a href="datum/pet_command.html#proc/on_target_set">on_target_set</a></th><td>Target the pointed atom for actions</td></tr><tr><th><a href="datum/pet_command.html#proc/remove_friend">remove_friend</a></th><td>Stop listening to a guy</td></tr><tr><th><a href="datum/pet_command.html#proc/respond_to_command">respond_to_command</a></th><td>Respond to something that one of our friends has asked us to do</td></tr><tr><th><a href="datum/pet_command.html#proc/set_command_active">set_command_active</a></th><td>Activate the command, extend to add visible messages and the like</td></tr><tr><th><a href="datum/pet_command.html#proc/set_command_target">set_command_target</a></th><td>Store the target for the AI blackboard</td></tr><tr><th><a href="datum/pet_command.html#proc/try_activate_command">try_activate_command</a></th><td>Apply a command state if conditions are right, return command if successful</td></tr><tr><th><a href="datum/pet_command.html#proc/waive_automute">waive_automute</a></th><td>Stop the automute from triggering for commands (unless the spoken text is suspiciously longer than the command)</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/command_desc"><aside class="declaration">var </aside>command_desc <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L14"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 14"></a></h3><p>Description to display in radial menu</p><h3 id="var/command_feedback"><aside class="declaration">var </aside>command_feedback <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L20"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 20"></a></h3><p>Shown above the mob's head when it hears you</p><h3 id="var/command_name"><aside class="declaration">var </aside>command_name <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L12"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 12"></a></h3><p>Unique name used for radial selection, should not be shared with other commands on one mob</p><h3 id="var/command_regex"><aside class="declaration">var </aside>command_regex <aside>– /regex</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L30"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 30"></a></h3><p>The regex for finding our commands in speech</p><h3 id="var/hidden"><aside class="declaration">var </aside>hidden <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L16"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 16"></a></h3><p>If true, command will not appear in radial menu and can only be accessed through speech</p><h3 id="var/parent_uid"><aside class="declaration">var </aside>parent_uid <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L10"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 10"></a></h3><p>UID of who follows this command</p><h3 id="var/pointed_reaction"><aside class="declaration">var </aside>pointed_reaction <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L28"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 28"></a></h3><p>our pointed reaction we play</p><h3 id="var/requires_pointing"><aside class="declaration">var </aside>requires_pointing <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L24"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 24"></a></h3><p>does this pet command need a point to activate?</p><h3 id="var/sense_radius"><aside class="declaration">var </aside>sense_radius <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L22"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 22"></a></h3><p>How close a mob needs to be to a target to respond to a command</p><h3 id="var/speech_commands"><aside class="declaration">var </aside>speech_commands <aside>– /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L18"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 18"></a></h3><p>Speech strings to listen out for</p><h3 id="var/targeting_strategy_key"><aside class="declaration">var </aside>targeting_strategy_key <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L26"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 26"></a></h3><p>Blackboard key for targeting strategy, this is likely going to need it</p><h2 id="proc">Proc Details</h2><h3 id="proc/add_new_friend"><aside class="declaration">proc </aside>add_new_friend<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/tamer) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L39"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 39"></a></aside></h3><p>Register a new guy we want to listen to</p><h3 id="proc/execute_action"><aside class="declaration">proc </aside>execute_action<aside>(/<a href="datum.html">datum</a>/<a href="datum/ai_controller.html">ai_controller</a>/controller) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L164"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 164"></a></aside></h3><p>Execute an AI action on the provided controller, what we should actually do when this command is active.
|
||
This should basically always be called from a planning subtree which passes its own controller.
|
||
Return SUBTREE_RETURN_FINISH_PLANNING to pass that instruction on to the controller, or don't if you don't want that.</p><h3 id="proc/find_command_in_text"><aside class="declaration">proc </aside>find_command_in_text<aside>(spoken_text, check_verbosity) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L79"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 79"></a></aside></h3><p>Returns true if we find any of our spoken commands in the text.
|
||
if check_verbosity is true, skip the match if there spoken_text is way longer than the match</p><h3 id="proc/look_for_target"><aside class="declaration">proc </aside>look_for_target<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/friend, /<a href="atom.html">atom</a>/potential_target) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L109"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 109"></a></aside></h3><p>Target the pointed atom for actions</p><h3 id="proc/on_target_set"><aside class="declaration">proc </aside>on_target_set<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/friend, /<a href="atom.html">atom</a>/potential_target) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L169"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 169"></a></aside></h3><p>Target the pointed atom for actions</p><h3 id="proc/remove_friend"><aside class="declaration">proc </aside>remove_friend<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/unfriended) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L46"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 46"></a></aside></h3><p>Stop listening to a guy</p><h3 id="proc/respond_to_command"><aside class="declaration">proc </aside>respond_to_command<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/speaker, speech_args) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L61"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 61"></a></aside></h3><p>Respond to something that one of our friends has asked us to do</p><h3 id="proc/set_command_active"><aside class="declaration">proc </aside>set_command_active<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/parent, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/commander, radial_command) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L123"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 123"></a></aside></h3><p>Activate the command, extend to add visible messages and the like</p><h3 id="proc/set_command_target"><aside class="declaration">proc </aside>set_command_target<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/parent, /<a href="atom.html">atom</a>/target) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L153"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 153"></a></aside></h3><p>Store the target for the AI blackboard</p><h3 id="proc/try_activate_command"><aside class="declaration">proc </aside>try_activate_command<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/commander, radial_command) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L94"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 94"></a></aside></h3><p>Apply a command state if conditions are right, return command if successful</p><h3 id="proc/waive_automute"><aside class="declaration">proc </aside>waive_automute<aside>(/<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/speaker, /<a href="client.html">client</a>/client, last_message, mute_type) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/datums/components/pet_commands/pet_command.dm#L54"><img src="git.png" width="16" height="16" title="code/datums/components/pet_commands/pet_command.dm 54"></a></aside></h3><p>Stop the automute from triggering for commands (unless the spoken text is suspiciously longer than the command)</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html> |