/tg/ Station 13 - Modules - TypesVar Details - Proc Details

chemical_reaction

#Chemical Reaction

Datum that makes the magic between reagents happen.

Chemical reactions is a class that is instantiated and stored in a global list 'chemical_reactions_list'

Vars

H_ion_releasepH change per 1u reaction
determin_ph_rangeHow far out pH wil react, giving impurity place (Exponential phase)
is_cold_recipeSet to TRUE if you want the recipe to only react when it's BELOW the required temp.
mix_messageThe message shown to nearby people upon mixing, if applicable
mix_soundThe sound played upon mixing, if applicable
mob_reactDetermines if a chemical reaction can occur inside a mob
optimal_ph_maxHigest value for above
optimal_ph_minLowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
optimal_tempUpper end for above (i.e. the end of the curve section defined by temp_exponent_factor)
overheat_tempTemperature at which reaction explodes - If any reaction is this hot, it explodes!
ph_exponent_factorHow sharp the pH exponential curve is (to the power of value)
purity_minIf purity is below 0.15, it calls OverlyImpure() too. Set to 0 to disable this.
rate_up_limOptimal/max rate possible if all conditions are perfect
reaction_flagsbitflags for clear conversions; REACTION_CLEAR_IMPURE, REACTION_CLEAR_INVERSE, REACTION_CLEAR_RETAIN, REACTION_INSTANT
reaction_tagsTagging vars A bitflag var for tagging reagents for the reagent loopup functon
required_catalystsRequired chemicals that must be present in the container but are not USED.
required_containerIf required_container_accepts_subtypes is FALSE, the exact type of what container this reaction can take place in. Otherwise, what type including subtypes are acceptable.
required_container_accepts_subtypesIf required_container will check for the exact type, or will also accept subtypes
required_otherSet this to true to call pre_reaction_other_checks() on react and do some more interesting reaction logic
required_reagentsRequired chemicals that are USED in the reaction
required_tempFermiChem! - See fermi_readme.md Required temperature for the reaction to begin, for fermimechanics it defines the lower area of bell curve for determining heat based rate reactions, aka the minimum
resultsResults of the chemical reactions
temp_exponent_factorHow sharp the temperature exponential curve is (to the power of value)
thermic_constantHow much the temperature changes per unit of chem used. without REACTION_HEAT_ARBITARY flag the rate of change depends on the holder heat capacity else results are more accurate

Procs

chemical_mob_spawnMagical mob spawning when chemicals react
clear_productsClears the beaker of the product only
clear_reactantsClears the beaker of the reagents only if volume is not set, it will remove all of the reactant
clear_reagentsClears the beaker of ALL reagents inside
default_explodeGeneric explosions/failures
explode_fireBEGIN FIRE BASED EXPLOSIONS
freeze_radiusEND FIRE BASED EXPLOSIONS
on_reactionShit that happens on reaction Only procs at the START of a reaction use reaction_step() for each step of a reaction or reaction_end() when the reaction stops If reaction_flags & REACTION_INSTANT then this is the only proc that is called.
overheatedOccurs when a reation is overheated (i.e. past its overheatTemp) Will be called every tick in the reaction that it is overheated If you want this to be a once only proc (i.e. the reaction is stopped after) set reaction.toDelete = TRUE The above is useful if you're writing an explosion By default the parent proc will reduce the final yield slightly. If you don't want that don't add ..()
overly_impureOccurs when a reation is too impure (i.e. it's below purity_min) Will be called every tick in the reaction that it is too impure If you want this to be a once only proc (i.e. the reaction is stopped after) set reaction.toDelete = TRUE The above is useful if you're writing an explosion By default the parent proc will reduce the purity of all reagents involved in the reaction in the beaker slightly. If you don't want that don't add ..()
pre_reaction_other_checksREACTION PROCS Checks if this reaction can occur. Only is ran if required_other is set to TRUE.
reaction_clear_checkREACTION_CLEAR handler If the reaction has the REACTION_CLEAR flag, then it will split using purity methods in the beaker instead
reaction_finishStuff that occurs at the end of a reaction. This will proc if the beaker is forced to stop and start again (say for sudden temperature changes). Only procs at the END of reaction If reaction_flags & REACTION_INSTANT then this isn't called if reaction_flags REACTION_CLEAR_IMPURE then the impurity chem is handled here, producing the result in the beaker instead of in a mob Likewise for REACTION_CLEAR_INVERSE the inverse chem is produced at the end of the reaction in the beaker You should be calling ..() if you're writing a child function of this proc otherwise purity methods won't work correctly
reaction_stepStuff that occurs in the middle of a reaction Only procs DURING a reaction If reaction_flags & REACTION_INSTANT then this isn't called returning END_REACTION will END the reaction

Var Details

H_ion_release

pH change per 1u reaction

determin_ph_range

How far out pH wil react, giving impurity place (Exponential phase)

is_cold_recipe

Set to TRUE if you want the recipe to only react when it's BELOW the required temp.

mix_message

The message shown to nearby people upon mixing, if applicable

mix_sound

The sound played upon mixing, if applicable

mob_react

Determines if a chemical reaction can occur inside a mob

optimal_ph_max

Higest value for above

optimal_ph_min

Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)

optimal_temp

Upper end for above (i.e. the end of the curve section defined by temp_exponent_factor)

overheat_temp

Temperature at which reaction explodes - If any reaction is this hot, it explodes!

ph_exponent_factor

How sharp the pH exponential curve is (to the power of value)

purity_min

If purity is below 0.15, it calls OverlyImpure() too. Set to 0 to disable this.

rate_up_lim

Optimal/max rate possible if all conditions are perfect

reaction_flags

bitflags for clear conversions; REACTION_CLEAR_IMPURE, REACTION_CLEAR_INVERSE, REACTION_CLEAR_RETAIN, REACTION_INSTANT

reaction_tags

Tagging vars A bitflag var for tagging reagents for the reagent loopup functon

required_catalysts

Required chemicals that must be present in the container but are not USED.

required_container

If required_container_accepts_subtypes is FALSE, the exact type of what container this reaction can take place in. Otherwise, what type including subtypes are acceptable.

required_container_accepts_subtypes

If required_container will check for the exact type, or will also accept subtypes

required_other

Set this to true to call pre_reaction_other_checks() on react and do some more interesting reaction logic

required_reagents

Required chemicals that are USED in the reaction

required_temp

FermiChem! - See fermi_readme.md Required temperature for the reaction to begin, for fermimechanics it defines the lower area of bell curve for determining heat based rate reactions, aka the minimum

results

Results of the chemical reactions

temp_exponent_factor

How sharp the temperature exponential curve is (to the power of value)

thermic_constant

How much the temperature changes per unit of chem used. without REACTION_HEAT_ARBITARY flag the rate of change depends on the holder heat capacity else results are more accurate

Proc Details

chemical_mob_spawn

Magical mob spawning when chemicals react

Your go to proc when you want to create new mobs from chemicals. please dont use on_reaction. Arguments:

clear_products

Clears the beaker of the product only

clear_reactants

Clears the beaker of the reagents only if volume is not set, it will remove all of the reactant

clear_reagents

Clears the beaker of ALL reagents inside

default_explode

Generic explosions/failures

explode_fire

BEGIN FIRE BASED EXPLOSIONS

freeze_radius

END FIRE BASED EXPLOSIONS

on_reaction

Shit that happens on reaction Only procs at the START of a reaction use reaction_step() for each step of a reaction or reaction_end() when the reaction stops If reaction_flags & REACTION_INSTANT then this is the only proc that is called.

Proc where the additional magic happens. You dont want to handle mob spawning in this since there is a dedicated proc for that.client Arguments:

overheated

Occurs when a reation is overheated (i.e. past its overheatTemp) Will be called every tick in the reaction that it is overheated If you want this to be a once only proc (i.e. the reaction is stopped after) set reaction.toDelete = TRUE The above is useful if you're writing an explosion By default the parent proc will reduce the final yield slightly. If you don't want that don't add ..()

Arguments:

overly_impure

Occurs when a reation is too impure (i.e. it's below purity_min) Will be called every tick in the reaction that it is too impure If you want this to be a once only proc (i.e. the reaction is stopped after) set reaction.toDelete = TRUE The above is useful if you're writing an explosion By default the parent proc will reduce the purity of all reagents involved in the reaction in the beaker slightly. If you don't want that don't add ..()

Arguments:

pre_reaction_other_checks

REACTION PROCS Checks if this reaction can occur. Only is ran if required_other is set to TRUE.

reaction_clear_check

REACTION_CLEAR handler If the reaction has the REACTION_CLEAR flag, then it will split using purity methods in the beaker instead

Arguments:

reaction_finish

Stuff that occurs at the end of a reaction. This will proc if the beaker is forced to stop and start again (say for sudden temperature changes). Only procs at the END of reaction If reaction_flags & REACTION_INSTANT then this isn't called if reaction_flags REACTION_CLEAR_IMPURE then the impurity chem is handled here, producing the result in the beaker instead of in a mob Likewise for REACTION_CLEAR_INVERSE the inverse chem is produced at the end of the reaction in the beaker You should be calling ..() if you're writing a child function of this proc otherwise purity methods won't work correctly

Proc where the additional magic happens. You dont want to handle mob spawning in this since there is a dedicated proc for that.client Arguments:

reaction_step

Stuff that occurs in the middle of a reaction Only procs DURING a reaction If reaction_flags & REACTION_INSTANT then this isn't called returning END_REACTION will END the reaction

Arguments:

Outputs: