-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Artifact Code API] Custom artifact codes for Bulwark's Ambry #299
Conversation
Can you update the changelog in the readme with a link to this PR |
I've pushed a new version that contains the feedback from Harb and the feedback from other core devs. Details can be found in the push |
ArtifactCodeAPI: * Uses a single Logger.LogInfo() to log the code inputted. * Improvement in the foreach loop in the awake hook, now uses a tupple correctly. * ArtifactCodeAPI now checks wether a code has already been added, should avoid code conflcts. * Moved wrapper * Replaced methods that asked for a List<int> and int[] with an IEnumerable<int>. ArtifactCodeScriptableObject: * Renamed to ArtifactCode * Moved to a new folder that holds scriptable object. * Now in the namespace R2API.ScriptableObjects README.MD * Added the pullrequest in the changelog
Ran codemaid to cleanup codestyle
For clarity sake on the readme, you may want to change where you said |
I might have typod that trying to remove typos. |
Allows the creation of new Artifact codes to be used in the artifact portal found in sky meadow.
Works by storing an array of DialedActions and appending them to the Portal Dialer Controller instance of SkyMeadow on Awake.
There are 3 public classes
ArtifactCodeAPI
: Handles the overall storing and creation of new artifact codesArtifactCodeScriptableObject
: Allows the ease of creation of codes by simply inputting the Artifact Compound's values into a list. Works both for Code use and Editor use.CompoundValues
: Contains the values of Vanilla Risk of Rain 2 Artifact Compounds (Empty, Square, Circle, Triangle and Diamond.)Detailed information:
Hooks
The API works by mainly hooking into 2 methods inside the PortalDialerController class.
awake
: Reads through the list of ArtifactCodes (Composed by an ArtifactDef and a Sha256HashAsset) and checks if the artifact Def is in the ArtifactCatalog. If true, it adds a new DialedAction that calls theOpenArtifactPortalServer(artifactDef)
, which allows for the Portal to open. Creating these dialed actions must be done in theawake
function, since the UnityEvent found inside DialedAction needs a direct reference to the PortalDialerController instance in SkyMeadow.PerformActionServer
: While not completely necesary for the API to function,PerformActionServer
prints out the necessary values for a modder to use in their Sha256Asset, assuming they desire to create their artifact code this way.Methods
The main method to use for adding new codes is the
Add()
Method, having a total of 5 Overloads for a myriad of different methods of implementing codes.