edited May 2022 in ORK Scripting
Hi GiL,
Haven't been here since I finished my game with ORK2. I purchased ORK3 a few days ago and working on a prototype. I'm having trouble with listing equip conditions of selected equipshortcut to UI via script.

I have no idea how to get the equip condition entity.

image

//Conditions
var equipConditions = equipShortcut.Setting.equipConditions.conditions;
if(equipConditions.useConditions){
if(equipConditions.conditions.condition != null){
for(int i = 0; i < equipConditions.conditions.condition.Length; i++){
var condition = equipConditions.conditions.condition[i];
//Don't know how to get condition details.
}
}
}


Also, it would be great if you can help me with how to highlight the Unmeet condition.
Thank you.
Post edited by bitmore on
  • It's a bit complex, since those conditions also support more than just status conditions.

    This let's you cycle through status conditions and checks if they're valid or not:
    var equipConditions = this.Setting.equipConditions.conditions;
    if(equipConditions.useConditions)
    {
    if(equipConditions.conditions.condition != null)
    {
    for(int i = 0; i < equipConditions.conditions.condition.Length; i++)
    {
    var statusCondition = equipConditions.conditions.condition[i].settings as CombatantStatusGeneralCondition<GameObjectSelection>;
    if(statusCondition != null)
    {
    for(int j = 0; j < statusCondition.conditions.condition.Length; j++)
    {
    if(statusCondition.conditions.condition[i].Check(combatant))
    {
    // valid
    }
    else
    {
    // not valid
    }
    }
    }
    }
    }
    }
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited May 2022
    Thanks @gamingislove .
    var statusCondition = equipConditions.conditions.condition[i].settings as CombatantStatusGeneralCondition<GameObjectSelection>;
    This is what I need.

    And I have another similar question, how can I get the Research Item's Ability Settings and Item Settings like the screenshot below? Also the Research Cost and Research Conditions.
    I can only get the cost string text, but not the Research Cost entity.

    var allTrees = m_Combatant.Research.GetAllTrees();
    foreach (var tree in allTrees)
    {
    foreach (var item in tree.GetItems())
    {
    Debug.Log(" KKKKKK: " + item.GetName() + "///" + item.GetTypeContent() + "///" + item.GetUseCostText(m_Combatant));
    //How to get Research Item's Ability/Item/Quest Settings? And Research Cost/Condition.
    }
    }


    Research01
    Research02

    Edit:
    I can get the Ability/Item/Quest Settings of the Research Item by this code:
    if(item.GetTypeContent() != null && item.GetTypeContent().GetType() == typeof(AbilityType)){
    var abilityResearchItem = item.Setting.settings as AbilityResearchItem;

    }


    But still don't know how to get the cost and conditions entity.
    Post edited by bitmore on
  • Solved. The cost and condition can be found by this:

    researchItem.Setting.learnConditions;
    researchItem.Setting.learnCost;
Sign In or Register to comment.