Thrice activate on module load

I say it is module load but I simply cannot be sure…Basically I have CNR and Shayan subrace system installed onto my module. I just loaded an test subrace (Avariel) And I noticed the game loads the system thrice! I got 3 skins in my inventory (can they also become invisible btw?) and most likely it is loading all the systems installed 3 times…

My guess it is an on module load error but I cannot be sure…

Anyone ever had this issue before?

Would need to see your OnLoad script to offer any advice as to it being in error

of course!

#include "cnr_persist_inc"
#include "cnr_config_inc"
#include "x3_inc_horse"
#include "_kds1_inc"

void main()
{
  ExecuteScript("aps_onload", OBJECT_SELF);
  ExecuteScript("shop_mod_load", OBJECT_SELF);
  ExecuteScript("sha_mod_load", OBJECT_SELF);

  // if cnr_misc table does not exist, create it
  CnrSQLExecDirect("DESCRIBE cnr_misc");
  if (CnrSQLFetch() != CNR_SQL_SUCCESS)
  {
    /*
    // For Access
    CnrSQLExecDirect("CREATE TABLE cnr_misc (" +
                  "player text(64)," +
                  "tag text(64)," +
                  "name text(64)," +
                  "val memo," +
                  "expire text(4)," +
                  "last date)");
    */

    // for MySQL
    CnrSQLExecDirect("CREATE TABLE cnr_misc (" +
                  "`player` VARCHAR(64) default NULL," +
                  "`tag` VARCHAR(64) default NULL," +
                  "`name` VARCHAR(64) default NULL," +
                  "`val` TEXT," +
                  "`expire` SMALLINT UNSIGNED default NULL," +
                  "`last` TIMESTAMP(14) NOT NULL," +
                  "KEY idx (player,tag,name)" +
                  ")" );
  }

  if (CNR_BOOL_RECIPE_DATA_IS_PERSISTENT_IN_SQL_DATABASE == TRUE)
  {
    // if cnr_devices table does not exist, create it
    CnrSQLExecDirect("DESCRIBE cnr_devices");
    if (CnrSQLFetch() != CNR_SQL_SUCCESS)
    {
      // for MySQL
      CnrSQLExecDirect("CREATE TABLE `cnr_devices` (" +
                    "`sDeviceTag` varchar(16) NOT NULL default ''," +
                    "`sAnimation` varchar(16) default NULL," +
                    "`bSpawnInDevice` integer default '0'," +
                    "`sInvTool` varchar(16) default NULL," +
                    "`sEqpTool` varchar(16) default NULL," +
                    "`nTradeType` integer default '0'," +
                    "`fInvToolBP` float default '0'," +
                    "`fEqpToolBP` float default '0'," +
                    "PRIMARY KEY  (sDeviceTag)" +
                    ")" );
    }

    // if cnr_submenus table does not exist, create it
    CnrSQLExecDirect("DESCRIBE cnr_submenus");
    if (CnrSQLFetch() != CNR_SQL_SUCCESS)
    {
      // for MySQL
      CnrSQLExecDirect("CREATE TABLE `cnr_submenus` (" +
                    "`sKeyToMenu` varchar(64) NOT NULL default ''," +
                    "`sKeyToParent` varchar(64) NOT NULL default ''," +
                    "`sTitle` varchar(64) NOT NULL default ''," +
                    "`sDeviceTag` varchar(16) NOT NULL default ''," +
                    "PRIMARY KEY  (`sKeyToMenu`)," +
                    "INDEX `sDeviceTag` (`sDeviceTag`)" +
                    ")" );
    }

    // if cnr_recipes table does not exist, create it
    CnrSQLExecDirect("DESCRIBE cnr_recipes");
    if (CnrSQLFetch() != CNR_SQL_SUCCESS)
    {
      // for MySQL
      CnrSQLExecDirect("CREATE TABLE `cnr_recipes` (" +
                    "`sKeyToRecipe` varchar(64) NOT NULL default ''," +
                    "`sDeviceTag` varchar(16) NOT NULL default ''," +
                    "`sDescription` varchar(64) NOT NULL default ''," +
                    "`sTag` varchar(16) NOT NULL default ''," +
                    "`nQty` integer default '1'," +
                    "`sKeyToParent` varchar(64) NOT NULL default ''," +
                    "`sFilter` varchar(32) default NULL," +
                    "`nStr` integer default '0'," +
                    "`nDex` integer default '0'," +
                    "`nCon` integer default 0," +
                    "`nInt` integer default '0'," +
                    "`nWis` integer default '0'," +
                    "`nCha` integer default '0'," +
                    "`nLevel` integer default '1'," +
                    "`nGameXP` integer default '0'," +
                    "`nTradeXP` integer default '0'," +
                    "`bScalarOverride` integer default '0'," +
                    "`sAnimation` varchar(16) default NULL," +
                    "`sBiTag` varchar(16) default NULL," +
                    "`nBiQty` integer default '0'," +
                    "`nOnFailBiQty` integer default '0'," +
                    "PRIMARY KEY  (`sKeyToRecipe`)," +
                    "INDEX `sDeviceTag` (`sDeviceTag`)" +
                    ")" );
    }

    // if cnr_components table does not exist, create it
    CnrSQLExecDirect("DESCRIBE cnr_components");
    if (CnrSQLFetch() != CNR_SQL_SUCCESS)
    {
      // for MySQL
      CnrSQLExecDirect("CREATE TABLE `cnr_components` (" +
                    "`sKeyToComponent` varchar(64) NOT NULL default ''," +
                    "`sTag` varchar(16) NOT NULL default ''," +
                    "`nQty` integer default '1'," +
                    "`nRetainQty` integer default '0'," +
                    "`sKeyToRecipe` varchar(64) NOT NULL default ''," +
                    "`sDeviceTag` varchar(16) NOT NULL default ''," +
                    "PRIMARY KEY  (`sKeyToComponent`)," +
                    "INDEX `sDeviceTag` (`sDeviceTag`)" +
                    ")" );
    }
  }

  PrintString("Launching cnr_recipe_init");
  ExecuteScript("cnr_recipe_init", OBJECT_SELF);

  PrintString("Launching cnr_book_init");
  ExecuteScript("cnr_book_init", OBJECT_SELF);

  PrintString("Launching cnr_plant_init");
  ExecuteScript("cnr_plant_init", OBJECT_SELF);

  PrintString("Launching cnr_source_init");
  ExecuteScript("cnr_source_init", OBJECT_SELF);

  PrintString("Launching cnr_merch_init");
  ExecuteScript("cnr_merch_init", OBJECT_SELF);

    ExecuteScript("module_variables", OBJECT_SELF);
}

Okay so apparently it was an execute line that got placed wrong.

Though i would like to use this as a follow up question as I cannot mount my horses anymore. So I was wondering if anyone could help me fix this issue. When I put this together the mod was fairly simple when the system got installed though it stopped working due to the subrace system (shayans) (or so i like to believe)

I will post the scripts below and I hope that anyone knows how to fix this, since my character can no longer mount the horse companions.

On client enter
// NWN v1.69 OnClientEnter Hook Script
//:://///////////////////////////////////////////////////////////////////////////
#include “x3_inc_horse”
#include “_kds1_inc”

  void main()
  {
ExecuteScript( "cnr_module_oce", OBJECT_SELF); // Call the custom OCE script.
ExecuteScript( "sha_on_cl_enter", OBJECT_SELF);

     KDS1OnClientEnter();     //
    object oPC=GetEnteringObject();
    if ((GetIsPC(oPC)||GetIsDM(oPC))&&!GetHasFeat(FEAT_HORSE_MENU,oPC))
    { // add horse menu
        HorseAddHorseMenu(oPC);
        if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB"))
        { // restore PC horse status from database
            DelayCommand(2.0,HorseReloadFromDatabase(oPC,X3_HORSE_DATABASE));
        } // restore PC horse status from database
    } // add horse menu
    if (GetIsPC(oPC))
    { // more details
        // restore appearance in case you export your character in mounted form, etc.
        if (!GetSkinInt(oPC,"bX3_IS_MOUNTED")) HorseIfNotDefaultAppearanceChange(oPC);
        // pre-cache horse animations for player as attaching a tail to the model
        HorsePreloadAnimations(oPC);
        DelayCommand(3.0,HorseRestoreHenchmenLocations(oPC));
    } // more details
}

On hB handle:
#include “x3_inc_horse”

    /////////////////////////////////////////////////////////////[ MAIN ]///////////
    void main()
    {
        ExecuteScript( "x3_mod_def_hb", OBJECT_SELF);
        ExecuteScript( "sha_on_mod_hbeat", OBJECT_SELF);

        object oPC=GetFirstPC();
        int nRoll;
        int bNoCombat=GetLocalInt(GetModule(),"X3_NO_MOUNTED_COMBAT_FEAT");
        while(GetIsObjectValid(oPC))
        { // PC traversal
            if (GetLocalInt(oPC,"bX3_STORE_MOUNT_INFO"))
            { // store
                DeleteLocalInt(oPC,"bX3_STORE_MOUNT_INFO");
                HorseSaveToDatabase(oPC,X3_HORSE_DATABASE);
            } // store
            if (!bNoCombat&&GetHasFeat(FEAT_MOUNTED_COMBAT,oPC)&&HorseGetIsMounted(oPC))
            { // check for AC increase
                nRoll=d20()+GetSkillRank(SKILL_RIDE,oPC);
                nRoll=nRoll-10;
                if (nRoll>4)
                { // ac increase
                    nRoll=nRoll/5;
                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectACIncrease(nRoll),oPC,7.0);
                } // ac increase
            } // check for AC increase
            oPC=GetNextPC();
        } // PC traversal
    }
    /////////////////////////////////////////////////////////////[ MAIN ]///////////

I believe that is all that is needed for the mounts…