ARK: Survival Evolved

ARK: Survival Evolved

Upgrade My Dino - Mod Wild Stat Levels, Imprints, & More
 This topic has been pinned, so it's probably important
Kozenomenon  [developer] Dec 28, 2020 @ 9:20am
Gacha Mod Integration
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
🢜 🢝 🢞 🢟 Gacha Mod Integration 🢟 🢞 🢝 🢜
The Gacha Features detailed in this discussion topic can be used by other mods that have custom Gachas that are copies (instead of inherited child) of the vanilla Gacha.

The integration uses the Mod Communication Interface provided in the Ark Dev Kit by Wildcard. All information passed between mods is using the JsonObject type.

To aid in demonstrating this integration I have added 'NottaGacha' to my open-source integration mod Koz Dinos.
Workshop page for that mod:
Koz Dinos Mod Page
The source for this mod is also available on GitHub:
Koz Dino Source[github.com]

You can also reach out to me on Discord to discuss implementation or if you just have some questions:
Koz's NOUModding Discord[discord.gg]

▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
🢜 🢝 🢞 🢟 Integration Details 🢟 🢞 🢝 🢜
All integration calls are made to the Gacha dino reference itself.
The integration uses the 'Key' param to indicate which type of call is being made.
The below bold items are those Key values that your mod can expect to receive.

IntegrationSupport
This is the first call that will be made. It is asking for which features/functions your mod will support. Two string arrays are sent in the 'InJson' of the 'RequestModDataProcessing' interface call: AllFeatures, AllFunctions. The call is expected your mod to return 'OutJson' with two string arrays: SupportedFeatures, SupportedFunctions. Features represent a capability overall and each may imply the support of one or more functions. Functions represent specific types of integration calls (Keys).
All Features:
  • FoodFix
    • No explicit integration. Indicates if it is 'ok' to edit food settings.
  • WildInventoryTame
      Required: GetItemTamingValue, GiveAffinity, Get_EmotionInfo, Set_TamingSearchTimer, Get_TamingConsumeAmount, Get_AfterMealSearchInterval
    • Optional: StartEating, SetTimer_CleanUpEating, PlayAnimEx_RefuseToEat, PlayAnimEx_ConsumeFood, Get_IsEating
  • ResourceInfo
    • Required: Get_ResourceInfo
    • Optional: Get_ProductionMode
  • EmotionInfo
    • Required: Get_EmotionInfo
  • ResourceReroll
    • Required: Get_ResourceInfo, Set_ResourceProduction
All Functions:
  • GetItemTamingValue
  • GiveAffinity
  • StartEating
  • SetTimer_CleanUpEating
  • PlayAnimEx_RefuseToEat
  • PlayAnimEx_ConsumeFood
  • Get_EmotionInfo
  • Get_ResourceInfo
  • Set_TamingSearchTimer
  • Get_TamingConsumeAmount
  • Get_AfterMealSearchInterval
  • Get_IsEating
  • Get_ProductionMode
  • Set_ResourceProduction

GetItemTamingValue
Intended to mimic the vanilla Gacha's GetItemTamingValue function. This is needed so UMD's Gacha buff knows what item the Gacha would prefer to eat for taming, if any.
Interface: RequestModDataProcessing
InJson:
  • Field: Object / Type: ObjectCorrelation
    • (struct, using FromObject pin only)
OutJson:
  • Field: Affinity / Type: Float
  • Field: IsWanted / Type: Boolean

GiveAffinity
Intended to mimic vanilla Gacha's GiveAffinity function. This will begin to or continue to tame the gacha for a player.
Interface: RequestModDataProcessing
InJson:
  • Field: affinityToGive / Type: Float
  • Field: tamer / Type: ObjectCorrelation
    • (struct, using FromObject pin only)
OutJson:
  • Field: wasTamed / Type: Boolean

StartEating
Intended to mimic vanilla Gacha's StartEating function. This is used for wild inventory taming if a desirable item is found in the inventory.
Interface: SendModData
InJson: None
OutJson: N/A

SetTimer_CleanUpEating
Intended to mimic calling SetTimer on vanilla Gacha's CleanUpEating function. This is used for wild inventory taming. The Time input field is intended for the timer.
Interface: SendModData
InJson:
  • Field: Time / Type: Float
OutJson: N/A

PlayAnimEx_RefuseToEat
Intended to mimic calling PlayAnimEx on vanilla Gacha w/ the Refuse To Eat animation montage. This is used for wild inventory taming if the Gacha doesn't like the items or is unhappy. ReturnValue output field is expected to be the float return from PlayAnimEx node.
Interface: RequestModDataProcessing
InJson: None
OutJson:
  • Field: ReturnValue / Type: Float

PlayAnimEx_ConsumeFood
Intended to mimic calling PlayAnimEx on vanilla Gacha w/ the Consume Food animation montage. This is used for wild inventory taming if the Gacha eats in order to tame. ReturnValue output field is expected to be the float return from PlayAnimEx node.
Interface: RequestModDataProcessing
InJson: None
OutJson:
  • Field: ReturnValue / Type: Float

Get_EmotionInfo
This is for retrieving the value of the float EmotionLevel variable as well as what the Happy/Sad thresholds are. Vanilla Gacha's do not have variables for Happy/Sad threshold, but their graphing uses float literals 0.5/-0.5 respectively. This is used for the Gacha HUD to display current emotion as well as for wild inventory taming to determine if the Gacha can eat to tame (not unhappy).
Interface: RequestModData
InJson: N/A
OutJson:
  • Field: EmotionLevel / Type: Float
  • Field: HappyThreshold / Type: Float
  • Field: SadThreshold / Type: Float

Get_ResourceInfo
This is for retrieving the 5 Gacha_ResourceStruct arrays from the Gacha.
Interface: RequestModData
InJson: N/A
OutJson:
  • Field: ResourceProduction / Type: JsonObject*
  • Field: Resources_Common / Type: JsonObject*
  • Field: Resources_Uncommon / Type: JsonObject*
  • Field: Resources_Rare / Type: JsonObject*
  • Field: Resources_VeryRare / Type: JsonObject*
* Custom array of structs for Json, see Koz Dino source asset: /_Macros/KozDino_JsonStructArrayMacros.uasset

Set_TamingSearchTimer
Intended to mimic a Set of vanilla Gacha's variable TamingSearchTimer. This is used during wild inventory taming in same way that vanilla Gacha's taming graph does it.
Interface: SendModData
InJson:
  • Field: TamingSearchTimer / Type: Float
OutJson: N/A

Get_TamingConsumeAmount
Intended to mimic a Get on vanilla Gacha's TamingConsumeAmount variable. This is used during wild inventory taming in same way that vanilla Gacha's taming graph does it.
Interface: RequestModData
InJson: N/A
OutJson:
  • Field: TamingConsumeAmount / Type: Integer

Get_AfterMealSearchInterval
Intended to mimic a Get on vanilla Gacha's AfterMealSearchInterval variable. This is used during wild inventory taming in same way that vanilla Gacha's taming graph does it.
Interface: RequestModData
InJson: N/A
OutJson:
  • Field: AfterMealSearchInterval / Type: Float

Get_IsEating
Intended to mimic a Get on vanilla Gacha's IsEating variable. This is used during wild inventory taming in same way that vanilla Gacha's taming graph does it.
Interface: RequestModData
InJson: N/A
OutJson:
  • Field: IsEating / Type: Boolean

Get_ProductionMode
Intended to mimic a Get on vanilla Gacha's ProductionMode variable. This is used for the Gacha HUD to show which resource is currently selected, if any. This call is only made on server/authority, the UMD gacha buff will handle replicating to clients.
Interface: RequestModData
InJson: N/A
OutJson:
  • Field: ProductionMode / Type: Integer

Set_ResourceProduction
Intended to mimic a Set on vanilla Gacha's ResourceProduction struct array. This is used for UMD's Reroll Gacha Resources item. The UMD gacha buff handles the selection process for the resources (based on what you provide via Get_ResourceInfo). It is also expected that ProductionMode will be reset to 0 (any).
Interface: SendModData
InJson:
  • Field: ResourceProduction / Type: JsonObject*
OutJson: N/A
* Custom array of structs for Json, see Koz Dino source asset: /_Macros/KozDino_JsonStructArrayMacros.uasset
Last edited by Kozenomenon; Dec 28, 2020 @ 9:26am