edited February 2014 in ORK Scripting
Hi! It should be easy, but it doesn work 0_0

I have "Status Value" named "Might" under index 0;

After I get players combatant via script, I try to assign it like that:

combatant.Status[MIGHT].SetValue(charStats[i][MIGHT], false, false, false, false, false);

But for some reason, might is always "57", no matter what, when I try to get it back with GetValue(); And its the same in the Unity inspector, when I inspect combatant.

I just can't understand - where does this "57" comes from at all, how should I set my own value?

I event ticked "No status development" for this particular combatant, and set value to 0, but it is still 57.

Why?
Post edited by gamingislove on
  • Is it only that particular Status Value that is giving you trouble? If you spawn it without your script, does the issue persist?
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
  • No, it can be just any value I have, actually.
    Without any script, it is still "57", so it must be set from somewhere else, but I can't figure out where.
  • For example, my second status value is intellect, and it is "37". And others have some numerals too
  • Inside "Combatants", as I mentioned, I have custom development settings set to 0. But, if I set "Might", say, to "10", might value becomes 67. So it is adding to it, instead to overwriting.
  • Wait a second! Actually, I think I know what might be going on. I see now that I have all status effects I have assigned to combatant at start 0_0 Likely that is the culprit. I'll get back here once I investigate it further
  • edited February 2014
    That is true. Then I have 2 questions:

    Why "combatant.Status[MIGHT].SetValue(charStats[i][MIGHT], false, false, false, false, false)" is not assigning a value?

    And why do I get all status effects assigned to my combatants by default? How can I disable it?
    Post edited by ryumaster on
  • edited February 2014
    Status effects aren't assigned by default, so you must have made some changes somewhere.

    I'd make sure that your auto-apply settings for the status effects are correct, and that you don't have the status effects set on your combatant, or that any possible equipment isn't giving you the status effects, etc.

    Post edited by Kirb on
    Tactics RPG Grid Battle System for ORK
    ---------------------------------------
    Personal Twitter: https://twitter.com/AMO_Crate
    I make RFI! https://twitter.com/NootboxGames
  • Thank you. Now that I know that by default they are not assigned, I'll get to the root of this.
  • "Auto apply" was on for all my status effects n_____n

    So, only 1 question remains:

    Why "combatant.Status[MIGHT].SetValue(charStats[i][MIGHT], false, false, false, false, false)" is not assigning a value?

    I tried to find other way to assign it, but can't.
  • Well, what value is stored in charStats[i][MIGHT]?
    Also to consider - what's the min/max value of the status value (set up in it's settings), are you using the correct index, do you have the correct combatant, etc.

    Usually this should work, that's also the function used by ORK to set a status value. You can also try to set the last two bools to true, if you want to display a change notification and on a console HUD.
    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!
  • Got it, thanks! I'll try to find out why it is not working then.
  • combatant.ChangeClass(charClasses[i], false, false, false, false, false, false, false);

    This line completely resets my stats changes. But it comes at the very top, before status. My idea was to firstly assign new class, the new stats.

    Why ChangeClass, even that it comes first, makes Status Changes totally obsolete later?
  • edited February 2014
    Are you working with already initialized combatants (i.e. added/spawned by ORK) or are you initializing them yourself?

    Also, the class change will mark the status for a complete recalculation based on equipment/status effects and other things - so if you need permanent changes to status values, you should use the function:

    public void SetBaseValue(int val)

    Or, if you want to initialize the status value, you can also use:

    public void InitValue(int val)


    Edit: moved to scripting.
    Post edited by gamingislove on
    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!
  • Thank you, I think I understand how it works now.
Sign In or Register to comment.