slapcraft_step
Vars | |
blacklist_item_types | Item types to make a typecache of for blacklisting. |
---|---|
blacklist_typecache | Typecache of the blacklist |
check_if_mob_can_drop_item | If the user is holding the item, check if they need to be able to drop it to be able to craft with it. |
check_types | Whether we should check the types of the item, if FALSE then make sure can_perform() checks conditions. |
desc | The description of the step, it shows in the slapcraft handbook |
finish_msg | Visible message when you finish the step. |
finish_msg_self | Personalized visible message when you finish the step. |
finished_desc | The description of the finished step when you examine the assembly. |
insert_item | Whether we insert the valid item in the assembly. |
insert_item_into_result | Whether we insert the item into the resulting item's contents |
item_types | List of types of items that can be used. Only relevant if check_types is TRUE |
list_desc | Quantified description of the required element of this step. "screwdriver" or "15 cable", or "can with 50u. fuel" etc. |
optional | Whether this step is optional. This is forbidden for first and last steps of recipes, and cannot be used on recipes with an order of SLAP_ORDER_FIRST_THEN_FREEFORM |
perform_time | How long does it take to perform the step. |
recipe_link | The recipe this step can link to. Make sure to include %LINK% and %ENDLINK% in desc to properly linkify it. |
start_msg | Visible message when you start the step. |
start_msg_self | Personalized visible message when you start the step. |
todo_desc | The description of the step when it's the next one to perform in the assembly. |
typecache | The typecache of types of the items. |
Procs | |
can_perform | Below are virtual procs I allow steps to override for their specific behaviours.
Checks whether a user can perform this step with an item. Exists so steps can override this proc for their own behavioural checks.
assembly can be null here, when the recipe finding checks are trying to figure out what recipe we can make. |
check_type | Checks whether a type is in the typecache of the step. |
get_speed_multiplier | Returns a speed multiplier to the time it takes for the step to complete. Useful for tool-related steps |
make_desc | Makes a description for the step. |
make_finish_msg | Makes a description for the visible message of finishing a step. |
make_finish_msg_self | Makes a personalized description for the visible message of finishing a step. |
make_finished_desc | Makes a finished description for the step. |
make_list_desc | Makes a list description for the item. |
make_start_msg | Makes a description for the visible message of starting a step that requires some time to perform. |
make_start_msg_self | Makes a personalized description for the visible message of starting a step that requires some time to perform. |
make_todo_desc | Makes a todo description for the step. |
move_item_to_assembly | Behaviour to move the item into the assembly. Stackable items may want to change how they do this. |
on_perform | Behaviour to happen on performing this step. Perhaps removing a portion of reagents to create an IED or something. |
perform | Make a user perform this step, by using an item on the assembly, trying to progress the assembly. |
perform_check | Checks if the passed item is a proper type to perform this step, and whether it passes the can_perform() check. Assembly can be null |
perform_do_after | Proc to perform handling a do_after, return FALSE if it failed, TRUE if succeeded. |
play_perform_sound | Plays a sound on successfully performing the step. |
progress_crafting | Whether the step progresses towards the next step when successfully performed. This can be used to allow "freeform" crafting to put more things into an assembly than required, possibly utilizing it for things like custom burgers |
step_replace_text | Text replacing for sending visibile messages when the steps are happening. |
Var Details
blacklist_item_types
Item types to make a typecache of for blacklisting.
blacklist_typecache
Typecache of the blacklist
check_if_mob_can_drop_item
If the user is holding the item, check if they need to be able to drop it to be able to craft with it.
check_types
Whether we should check the types of the item, if FALSE then make sure can_perform()
checks conditions.
desc
The description of the step, it shows in the slapcraft handbook
finish_msg
Visible message when you finish the step.
finish_msg_self
Personalized visible message when you finish the step.
finished_desc
The description of the finished step when you examine the assembly.
insert_item
Whether we insert the valid item in the assembly.
insert_item_into_result
Whether we insert the item into the resulting item's contents
item_types
List of types of items that can be used. Only relevant if check_types
is TRUE
list_desc
Quantified description of the required element of this step. "screwdriver" or "15 cable", or "can with 50u. fuel" etc.
optional
Whether this step is optional. This is forbidden for first and last steps of recipes, and cannot be used on recipes with an order of SLAP_ORDER_FIRST_THEN_FREEFORM
perform_time
How long does it take to perform the step.
recipe_link
The recipe this step can link to. Make sure to include %LINK% and %ENDLINK% in desc
to properly linkify it.
start_msg
Visible message when you start the step.
start_msg_self
Personalized visible message when you start the step.
todo_desc
The description of the step when it's the next one to perform in the assembly.
typecache
The typecache of types of the items.
Proc Details
can_perform
Below are virtual procs I allow steps to override for their specific behaviours.
Checks whether a user can perform this step with an item. Exists so steps can override this proc for their own behavioural checks.
assembly
can be null here, when the recipe finding checks are trying to figure out what recipe we can make.
check_type
Checks whether a type is in the typecache of the step.
get_speed_multiplier
Returns a speed multiplier to the time it takes for the step to complete. Useful for tool-related steps
make_desc
Makes a description for the step.
make_finish_msg
Makes a description for the visible message of finishing a step.
make_finish_msg_self
Makes a personalized description for the visible message of finishing a step.
make_finished_desc
Makes a finished description for the step.
make_list_desc
Makes a list description for the item.
make_start_msg
Makes a description for the visible message of starting a step that requires some time to perform.
make_start_msg_self
Makes a personalized description for the visible message of starting a step that requires some time to perform.
make_todo_desc
Makes a todo description for the step.
move_item_to_assembly
Behaviour to move the item into the assembly. Stackable items may want to change how they do this.
on_perform
Behaviour to happen on performing this step. Perhaps removing a portion of reagents to create an IED or something.
perform
Make a user perform this step, by using an item on the assembly, trying to progress the assembly.
perform_check
Checks if the passed item is a proper type to perform this step, and whether it passes the can_perform()
check. Assembly can be null
perform_do_after
Proc to perform handling a do_after, return FALSE if it failed, TRUE if succeeded.
play_perform_sound
Plays a sound on successfully performing the step.
progress_crafting
Whether the step progresses towards the next step when successfully performed. This can be used to allow "freeform" crafting to put more things into an assembly than required, possibly utilizing it for things like custom burgers
step_replace_text
Text replacing for sending visibile messages when the steps are happening.