[resolved]Auto Passive State Plugin Compatibility

hello
I am a user of the plugin auto passive state
and I can not make it coexist with my genders plugin
i use
Code:
<Custom Passive Condition>
 if (user.gender == 0) {
    condition = true;
  } else {
    condition = false;
  }
</Custom Passive Condition>
Can you help me please
tanks

ps: my code
Spoiler: genders
Code:
/*:
/*:
@plugindesc atribution d'un genre (sex) au personages et au enemies
Version: Alpha 00.1
@author Johnseed(SeedSoft)
@help
==================================================
Info
==================================================
Seed_Xtype.js
==================================================
Note Tag
==================================================
actor
<Gender: x> x = genre de l'acteur 0=male/1=female/2=gederless
<GenderV: x> x = variable id. de
==================================================
Mise a jour
==================================================
==================================================
prévision
==================================================
ajout des énemies
==================================================
Plugin Params
==================================================
@param ======Gender======
@param Male
@desc choisie le nom du genre masculin(default Male)
@default ♂
@param Female
@desc choisie le nom du genre féminin(default Female)
@default ♀
@param Genderless
@desc choisie le nom du genre sans sex(default aucun)
@default
*/
var SeedSoft = SeedSoft || {};
SeedSoft.Xtype = SeedSoft.Xtype || {};
(function(){
//=================Variables and other=============================================
    var parameters = PluginManager.parameters('Seed_Xtype');
    var Male = String(parameters['Male'] || '♂');
    var Female = String(parameters['Female'] || '♀');
    var Genderless = String(parameters['Genderless'] || 'Aucun');
//=================Notetag =============================================
   var noteGen = /<(?:GENDER\:[ ](.+))>/i;//chois du genre définis 0/1/2
   var noteGenV = /<(?:GENDERV\:[ ](.+))>/i;//chois du genre predefenie selon une variables
//=============================================================================
// Game_Actor
//=============================================================================
SeedSoft.Xtype.Game_Actor_setup = Game_Actor.prototype.setup;
Game_Actor.prototype.setup = function(actorId) {
    SeedSoft.Xtype.Game_Actor_setup.call(this, actorId);
    this.Xtype();
};
Game_Actor.prototype.Xtype = function() {
//=================Gender===================
   var genderchance = Math.random();{
   if (genderchance < 0.4) {
      this._gender = 0;
      this._gendername = Male;
   }
   else if (genderchance < 0.99)    {
      this._gender = 1;
      this._gendername = Female;
     }
   else    {
      this._gender = 2;
      this._gendername = Genderless;
      }
   }
   var actor = this.actor();
   var _setGender = this.setGender()
   var match = noteGen.exec(actor.note);
    if(match){
    this._gender = match[1];
      if (this._gender == 0)
        this._gendername = Male;
    else if (this._gender == 1)
        this._gendername = Female;
    else
        this._gendername = Genderless;
    }
    var match = noteGenV.exec(actor.note);
    if(match){
      this._gender = $gameVariables.value(match[1]);
      if (this._gender == 0)
        this._gendername = Male;
    else if (this._gender == 1)
        this._gendername = Female;
    else
        this._gendername = Genderless;
};
};
//=================Gender Initialisation===================
Game_Actor.prototype.gender = function() {
    if (this._gender === undefined) this.Xtype();
       return this._gender;
};
//=================Gendername Initialisation===============
Game_Actor.prototype.gendername = function() {
    if (this._gendername === undefined) this.Xtype();
       return this._gendername;
};
//=================Gender change===========================
Game_Actor.prototype.setGender = function(gender) {
    this._gender = gender;
    if (this._gender == 0)
        this._gendername = Male;
    if (this._gender == 1)
        this._gendername = Female;
    if (this._gender == 2)
        this._gendername = Genderless;
};
//===========================================================
})(SeedSoft.Xtype)
@john-seed I've split your topic into it's own, rather than posting in someone else's topic.
@john-seed I've split your topic into it's own, rather than posting in someone else's topic.
sorry. thank you
No problem.
It looks like you have extended the Game_Actor class to add a function to return the gender.
Because it is a function, you have to call it like a function with the parenthesis "()"
Code:
if (user.gender() == 0) {
It looks like you have extended the Game_Actor class to add a function to return the gender.
Because it is a function, you have to call it like a function with the parenthesis "()"
Code:
if (user.gender() == 0) {

I thank you for your answer Aloe Guvner, but it does not work, I may have done wrong
Code:
<Custom Passive Condition>
if (user.gender() == 0) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
Can you explain what you mean by 'it does not work'?

Are you getting an error in the console? (press F8 during a play test)
Is the condition "false" but you expect "true" ?
Is the condition "true" but you expect "false" ?

Also, please show a screenshot of your database setup; whichever entry has the notetag you mention.
Can you explain what you mean by 'it does not work'?

Are you getting an error in the console? (press F8 during a play test)
Is the condition "false" but you expect "true" ?
Is the condition "true" but you expect "false" ?

Also, please show a screenshot of your database setup; whichever entry has the notetag you mention.
I am no error in console debug





1) Are you getting an error in the console? (press F8 during a play test)

2) Replace your notetag with this and open the console (press F8 during a play test) and take a screenshot of what it says.
Code:
<Custom Passive Condition>
console.log(user.name());
console.log(user.gender());
if (user.gender() == 0) {
condition = true;
} else {
condition = false;
console.log(condition);
}
</Custom Passive Condition>
Yeah so notice how it says 'undefined' for the gender of every actor? It means the actor's gender is not defined.
You should work on debugging your gender plugin to make sure that the gender is being assigned correctly to the actors, before trying to integrate it with other plugins.
I thank you i will try to debug a genders plugin.
I will come back to you.
I did not succeed in debugging my plugin but managed to work with auto state.
Code:
<Custom Passive Condition>
if (a.gender() == 1) {
condition = true;
} else {
condition = false;
}
</Custom Passive Condition>
tanks

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/resolved-auto-passive-state-plugin-compatibility.92886/