Code Monkey home page Code Monkey logo

-ror2-extraskillslots's Introduction

For users

It's utility mod and does almost nothing on its own. What you should know about it is that mod has key bindings for extra skills that must be assigned in settings. Here's, I think, the best key bindings (default, starting from 1.4.0): Keybingins

For developers

TL; DR;

Adding extra skill is almost the same as adding normal skills. Along with SkillLocator, you need to use ExtraSkillLocator. It contains info about extra skills. Here's code snipet for adding extra skills:

var extraSkillLocator = commandoPrefab.AddComponent<ExtraSkillLocator>();

extraSkillLocator.extraFirst = firstExtraSkill;
extraSkillLocator.extraSecond = secondExtraSkill;
extraSkillLocator.extraThird = thirdExtraSkill;
extraSkillLocator.extraFourth = fourthExtraSkill;

That's all it takes for adding simple skills.

Full documentation

All defined classes extend corresponding classes from RoR2. Class naming follows one pattern: Extra{NameOfRoR2Class}.

  • ExtraSkillLocator - The main thing that you need. It's a component that you add to your character prefab to be able to use extra skills. Fields:

    • GenericSkill extraFirst - contains info about first extra skill
    • GenericSkill extraSecond - contains info about second extra skill
    • GenericSkill extraThird - contains info about third extra skill
    • GenericSkill extraFourth - contains info about fourth extra skill
  • ExtraInputBankTest - Containts info about user inputs state for extra skills. Fields:

    • InputBankTest.ButtonState extraSkill1 - contains info about first extra skill state
    • InputBankTest.ButtonState extraSkill2 - contains info about second extra skill state
    • InputBankTest.ButtonState extraSkill3 - contains info about third extra skill state
    • InputBankTest.ButtonState extraSkill4 - contains info about fourth extra skill state
  • ExtraSkillSlot - Contains consts for extra skill slots. Can be used to get skills from the corresponding slot from SkillLocator.

  • RewiredActions - Contains consts for rewired actions. With that info, you can manually access corresponding buttons state via Rewired.Player

  • ExtraSkillSlotsPlugin - Main class of this mod. There's nothing you can do with it, except to look at BepInPlugin definition to define a dependency to that mod.


Small tips

If you got to the point where you need more skills, you probably know enough about creating characters/skills, just want to leave here a small guide for skills creating.

  • To access ExtraInputBankTest(and any component that not stored in fields) from EntityState you should use outer field, for example:
var extraInputBankTest = outer.GetComponent<ExtraInputBankTest>();
  • Mini guide about adding extra skill
//Create new SkillFamily
var firstSkillFamily = ScriptableObject.CreateInstance<SkillFamily>();

//IMPORTANT! Do not forget to add name for SkillFamily 
//because game uses it for saving loadout
//Also I recomend to follow naming convention "{PrefabName}{SkillSlot}Family";
(firstSkillFamily as ScriptableObject).name = "MyCharacterBodyFirstExtraFamily";

//Adding skill variants to the family
firstSkillFamily.variants = variants;

//Registering skill family in catalog
LoadoutAPI.AddSkillFamily(firstSkillFamily);

//Adding new GenericSkill component to character prefab
var firstExtraSkill = myCharacterPrefab.AddComponent<GenericSkill>();

//Setting SkillFamily to our GenericSkill
firstExtraSkill.SetFieldValue("_skillFamily", firstSkillFamily);

...

//Adding ExtraSkillLocator to character prefab
var extraSkillLocator = myCharacterPrefab.AddComponent<ExtraSkillLocator>();

//Assigning our skill to corresponding slot
extraSkillLocator.extraFirst = firstExtraSkill;

Bugs

Feel free to ping me on discord @KingEnderBrine if you found one.

Changelog

1.5.1

  • Making of extra skill icons in the HUD is now more reliable, thanks, Bubbet. (Now icons work with BetterHudLite)

1.5.0

  • Fixes for Survivor of the Void update.

1.4.5

  • Fixed vanilla bug that was causing ExtendedLoadout break for Captain

1.4.4

  • Fixed compatibility with R2API 3.0.71

1.4.3

  • Updated dependencies

1.4.2

  • Fixed cooldown reduction on extra skills.
  • Finally fixed default keybindings.

1.4.1

  • Minor fix for default keybindings.

1.4.0

  • Added default keybindings. Thanks to DrBibop for code example.

1.3.2

  • Fixed an issue when starting a run hud would not show up.

1.3.1

  • Added missing MMHOOK_Standalone dependency

1.3.0

  • Removed r2api dependency

1.2.2

  • Minor fixes

1.2.1

  • Moved extra skill row up a bit, to not interfere with the default skills stock number.

  • Optimization.

1.2.0

  • Added BaseSkillState hooks

  • Again fixed stats recalculation.

1.1.0

  • Updated for RoR2 release version.

  • Changed extra skill slot indices (11, 12, 13, 14). Mainly this was done to not interfere with Sniper's ammo.

  • Added support for Purity cooldown reduction.

1.0.4

  • Actually fixed stats recalculation hook.

1.0.3

  • Fixed issue where stats recalculation starts throwing errors in console.

  • Updated dependencies

1.0.2

  • One more Readme fix

1.0.1

  • Readme fix

1.0.0

  • Mod release.

-ror2-extraskillslots's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.