Skip to content
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

QParams - Bug using ratesFormula tag #25

Open
Roguedeus opened this issue Oct 12, 2021 · 2 comments
Open

QParams - Bug using ratesFormula tag #25

Roguedeus opened this issue Oct 12, 2021 · 2 comments

Comments

@Roguedeus
Copy link

qParam_bug_21_1012a

I can only imagine that no one has tried to use that note tag, because merely removing it from the trait object removes the error.

use in question is this, on a State.

<ratesFormula>
mcr: a._turnUsedBP * 1.5
</ratesFormula>

I realize you are not exactly active in the community at the moment, but this isn't a small bug. Nor one that I think I am easily able to isolate myself. As a matter of fact, I'm not sure whats going on there except that the trait object 23 is the SPARAM group, and MCR is in it.

Thanks for any time you can spare here.

@Roguedeus
Copy link
Author

The problem appears to be this:

 * ============================================================================
 * ## Notetags
 * ============================================================================
 * We can modify all parameters (mv built in and custom ones) with some notetags
 * inside the Actor, Class, Equipment, Weapons, Enemies and State databases.
 * ----------------------------------------------------------------------------

States are supposed to be included in all Param and Rates formulas.
But...

  var Alias_DataManager_extractQData = DataManager.extractQData;
  DataManager.extractQData = function(data, object) {
    Alias_DataManager_extractQData.call(this, data);
    if (data.qmeta['params']) {
      var value = QParams.stringToParamsObj(data.qmeta['params']);
      if (object === $dataStates) {
        QParams._states[data.id] = value;
      } else if (object === $dataWeapons) {
        QParams._equips.weps[data.id] = value;
      } else if (object === $dataArmors) {
        QParams._equips.armor[data.id] = value;
      } else if (object === $dataActors) {
        QParams._charas.actor[data.id] = value;
      } else if (object === $dataClasses) {
        QParams._charas.class[data.id] = value;
      } else if (object === $dataEnemies) {
        QParams._charas.enemy[data.id] = value;
      }
    }
    if (data.qmeta['rates']) {
      var value = QParams.stringToRatesObj(data.qmeta['rates']);
      if (object === $dataActors) {
        QParams._rates.actor[data.id] = value;
      } else if (object === $dataClasses) {
        QParams._rates.class[data.id] = value;
      } else if (object === $dataEnemies) {
        QParams._rates.enemy[data.id] = value;
      }
    }
    if (data.qmeta['ratesFormula']) {
      var value = QParams.stringToRatesForumlaObj(data.qmeta['ratesFormula']);
      console.log(object);
      console.log(value);
      var prop;
      if (object === $dataActors) {
        prop = 'actor';
      } else if (object === $dataClasses) {
        prop = 'class';
      } else if (object === $dataEnemies) {
        prop = 'enemy';
      }
      console.log(prop);
      console.log(QParams._rates);
      console.log(data.id);
      var curr = QParams._rates[prop][data.id] || {};
      QParams._rates[prop][data.id] = Object.assign(curr, value);
    }
  };

As you can see... $dataStates is not included in processing rates or rate formulas.

@Roguedeus
Copy link
Author

The further I tracked this issue, the more it became obvious I'd be better off writing my own Plugin to do what I need.

It appears you never intended the plugin to allow States to do much, other than give main Param adjustments. Your SParam and XParam (plus) algorithms totally ignore States.

QParams, however, don't.

So, your note tag is erroneously suggesting all functions should apply to all trait objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant