skills utilities - MSUTeam/MSU GitHub Wiki

File path: scripts/config/msu/skills.nut

This page is about Skills Utilities in the ::MSU.Skills namespace. For detailed features related to skills modding see the Skills page.

addEvent

::MSU.Skills.addEvent( _name, _function = null, _update = true, _aliveOnly = false )
// _name is a string
// _function is a function
// _update is a boolean
// _aliveOnly is a boolean

The above code will create a new event function in skill.nut and skill_container.nut with the name of _name. For details and an example, see creating a new skill event.

addPreviewApplicableFunction

::MSU.Skills.addPreviewApplicableFunction( _name )
// _name is a string which is the name of a function in skill.nut

Makes this function subject to MSU's affordability preview modifications. This is essential, for example, for mods which may want to add new kinds of affordability calculation functions e.g. <skill>.isAffordableBasedOnMana() etc. See Affordability Preview for details and an example.

Add or Remove soft reset fields

For details on the automated resetting of fields to their base values see Skill Base Values.

::MSU.Skills.addToSoftReset( _field )
// _field is a key in the m table of skill.nut

Adds the _field member of skill.m to the list of fields to be reset during every call to softReset(). Does nothing if _field is already in the list.

::MSU.Skills.removeFromSoftReset( _field )
// _field is a key in the m table of skill.nut

Removes the _field member of skill.m from the list of fields be reset during every call to softReset(). Does nothing if _field does not exist in the list.

⚠️ **GitHub.com Fallback** ⚠️