I hope to change the Combatant's status value.

For example, There is the Combatant 'Main' ID = 17


image

and There is Status Value 'Like' ID =13


image

I hope to change and show up the Value about Status Value 'Like'(ID =13) of the Combatant name :'Main' (ID = 17).

I tried but it was error.
This is What I wrote...


image

How can I Get the Combatant by ID?
How can I Get The Combatant ID's specific Status value??
  • You can't get a combatant's instance by their ID, and there could be multiple instances for the same combatant ID.
    Your first line of code already got you the combatant from the game object:
    Combatant target = ORKComponentHelper.GetCombatant(gameObject);

    However, you can get a combatant for an ID from a group, e.g. the active player group:
    Combatant target = ORK.Game.ActiveGroup.GetMember(ORK.Combatants.Get(17));
    But keep in mind that the group can also contain multiple combatants of the same ID.

    You can get the status values of the combatant like that, e.g. getting the current value from status value ID 13:
    int value = target.Status[13].GetValue();
    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 October 2023
    Thank you!! It was working!!
    I could show the Status value at my UI and change the value by script.

    I always thank you for your kindness and smartness!!
    Post edited by YoungA_Cha on
  • edited October 2023
    Sorry. I have 1 more question.
    I could change my status value by script.
    but even though I added values to my status value so changed the value's number and effected well,
    whenever I got my level up, my status value returned to the number which I set by the level(not added number).

    this is the script which I used.
    public AdvEngine engine;
    public Text loveText;
    public Text likeText;

    public void ORK_status()
    {
    if (!engine.Param.IsInit) return;
    int love = engine.Param.GetParameterInt("love01");
    Combatant target = ORK.Game.ActiveGroup.GetMember(ORK.Combatants.Get(17));
    int value = target.Status[6].GetValue();


    // love와 engine.Param.GetParameterInt("love01")가 value와 같은 값을 가지도록 함
    if (love != value)
    {
    int diff = love - value;
    love -= diff;
    engine.Param.SetParameterInt("love01", love);
    target.Status[6].SetValue((int)value, false, true, true, false, false, null);
    }

    loveText.text = "UTAGE Love: " + love;
    likeText.text = "ORG Like: " + value;

    Debug.Log("ORG Status" + target.Status[6].GetValue());
    Debug.Log("Utage Param" + engine.Param.GetParameterInt("love01"));
    Debug.Log("ORG Like: " + value);
    Debug.Log("UTAGE Love: " + love);


    }

    image



    I tried to change by the Status Developments by percent or own Formula
    but It desen't work.
    How should I do?

    I'm so sorry not to know the coding.


    image


    image

    Post edited by YoungA_Cha on
  • For Normal type status values, you also need to change the base value, e.g.:
    target.Status[6].SetBaseValue(value);
    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!
  • Oh!! Thank you so much!1 It was perfectly working!
    I always thank you!!
Sign In or Register to comment.