Author Topic: Persistent reputation and reset?  (Read 633 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« on: December 06, 2015, 10:14:31 am »


               

Okay here is what I want to go for:


 


I would like to make the reputation (or at least some factions rep) persistent but giving the dm the ability to reset the rep of a certain faction for a player.


 


is this hard to do and how would one do such a thing?



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #1 on: December 07, 2015, 05:55:49 pm »


               

anyone know how to do this?



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #2 on: December 07, 2015, 08:26:13 pm »


               

You will need to save the reputations somewhere and restore them after a server reset or more specifically: When a player re-enters the server. I know of two options to save things presistantly


  1. Save the variables in a database. You can use SetCampaignInt for that. (If you use nwnx you can use an exernal sql database)

  2.    
  3. Save them on an object in a players inventory (SetLocalInt). I've seen you use the cnr. You could use a player's trade journal to save your own stuff.

Each way has it own set of problems and requires workarounds. Let me know what method you want to use and I can give you some pointers. Both ways will use the OnClientEnter event of your module to restore the reputation after a server restart.


 


The difference is when to do the saving. OnClientLeave is a bit wonky. A lot of functions do not work properly during that event, that's what the workarounds are for.


 


Edit: Important question. How can a player change his reputation ? Only by dialogs, quests and dms ? If so, life gets a bit easier. But if it's allowed that one can just walk up to an npc and hit him, we have to be a bit more thorough. Basically, if the reputation gets only ever adjusted by calling the AdjustReputation functions you can write your own and save the reputation each time.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #3 on: December 08, 2015, 05:41:14 am »


               

I would like to save them on an item then.


 


the way the reputation is changed (highered/lowered) is by quests and dialogue options.


 


Basically what the intent of the idea is that a DM can reset a faction reputation (1 not all) back to 0.


 


I appreciate the help here '<img'> 



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #4 on: December 08, 2015, 05:43:51 pm »


               

Alright. If you only change reputation by dialog things get much easier.


 


I recommend two things:


  1. Creating an area dedicated to holding a representative of each faction. Give each of them a unique tag. Remember no plot flag, Immortal flag is the better option. I always used the microset tileset and separated the npc by walls.

  2.    
  3. Write a custom AdjustReputation() function.

It's best to write an include script. That way you can create your own constants for the factions and use them in every script, like so:



// Use the tags from the npc in the faction areas. Add more as necessary.
const string CUSTOM_FACTION_A =  "factionNPC_A";
const string CUSTOM_FACTION_B =  "factionNPC_B";


int GetCustomFactionReputation(string sCustomFactionID , object oCreature);
void SetCustomFactionReputation(string sCustomFactionID, int nNewReputation, object oCreature);
void AdjustCustomReputation(object oTarget, string sCustomFactionID, int nAdjustment);
void RestoreReputations(object oPC);


// For convenience
int GetCustomFactionReputation(string sCustomFactionID , object oCreature)
{
    object oFactionNPC = GetObjectByTag(sCustomFactionID);
    return GetReputation(oFactionNPC, oCreature);
}


// For convenience
void SetCustomFactionReputation(string sCustomFactionID, int nNewReputation, object oCreature)
{
    int nCurrentRep = GetCustomFactionReputation(sCustomFactionID, oCreature);
    AdjustCustomReputation(oCreature, sCustomFactionID, nNewReputation-nCurrentRep);
}


//Custom AdjustReputation function
void AdjustCustomReputation(object oTarget, string sCustomFactionID, int nAdjustment)
{
    object oFactionNPC = GetObjectByTag(sCustomFactionID);
    AdjustReputation(oTarget, oFactionNPC, nAdjustment);
    // Save on a pc's trade journal
    object oTradeJournal = GetItemPossessedBy(oTarget, "cnrTradeJournal");
    if (GetIsObjectValid(oTradeJournal))
    {
        // Save the reputation
        SetLocalInt(oTradeJournal, "fac"+sCustomFactionID, GetCustomFactionReputation(sCustomFactionID, oTarget));
    }
}


void RestoreReputations(object oPC)
{
    // Make sure we do this only once per server reset per player character
    // We'll save a variable on the module for each player character and check
    // for it (it'll dissappear after a reset)
    object oModule= GetModule();
    if (GetLocalInt(oModule, "fac_doOnce"+GetName(oPC))==0)
    {
        SetLocalInt(oModule, "fac_doOnce"+GetName(oPC),1);

        object oTradeJournal = GetItemPossessedBy(oPC, "cnrTradeJournal");
        if (GetIsObjectValid(oTradeJournal))
        {
            ////////////////////////////////////////////////////////////////////////
            // Restore Reputations here. You'll need to do it for each faction
            int rep = 50;

            rep = GetLocalInt(oTradeJournal, "fac"+CUSTOM_FACTION_A);
            SetCustomFactionReputation(CUSTOM_FACTION_A, rep, oPC);

            rep = GetLocalInt(oTradeJournal, "fac"+CUSTOM_FACTION_B);
            SetCustomFactionReputation(CUSTOM_FACTION_B, rep, oPC);
        }
    }
}

Ok, maybe I did a bit more than just pointers, but I ripped most of it from my old server anyway. Create a new script, delete the main() function and save it. In your dialogs you'll need to include your new script with #include "myscript", You can then use the AdjustCustomReputation function insted of the default one. Use the constants from the top of the script access the faction.


 


 


Restoring will need to be done in the modules OnClientEnter event (accessible through the module properties). Include the script like above and call the RestoreReputations() function. You may need to get the player with GetEnteringObject(). But if you use the cnr you should already have a script there which will have the player object somewhere.


 


You should check if the cnr trade journal's tag is indeed "cnrTradeJournal". It may have changed. I assume of course that you have the cnr as the scripts use it's trade journal to save stuff. Else you'll have to add a non-droppable object to players inventory (or maybe use the player's hide item introduced in patch 1.69)


 


You'll need to add constants for each of your factions (along with an npc on the faction map) and adjust the RestoreReputations() function accordingly.



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #5 on: December 08, 2015, 07:14:02 pm »


               

As for DMs. You could create an item for DMs let's say with the tag "faction_editor". You'll need to give it a property Cast Spell, Activate Item: Unique Power (not the "self" one, we need to be able to target things).


 


A DM can target a player with it and reset the faction. If you have a lot of factions it's probably best to use a single item and let it pop up a conversation. You'll need to use the event OnActivateItem from the module properties and add the following lines.



    object oItem      = GetItemActivated();   
    object oActivator = GetItemActivator();
    string sItemTag   = GetTag(oItem);

    if (sItemTag == "faction_editor")
        ExecuteScript("faction_editor", oActivator);

Create a script "faction_editor". It will save the target of the item and initiate a conversation. It's good practice to create a script for each usable item



void main()
{
    object oActivator = GetItemActivator();
    object oTarget    = GetItemActivatedTarget();
    object oItem      = GetItemActivated();

    // Save target of the item on the item's user. That's why the Spell: Activate Item has to be
    // targetable
    SetLocalObject(oActivator, "faction_editor_target", oTarget);

    AssignCommand(oActivator, ActionStartConversation(oActivator, "faction_editor", TRUE, FALSE));
}

Now create a conversation "faction_editor": Create a branch for each of your factions and execute the following when the user selects it:



// include your faction script
#include "inc_faction"

void main()
{
    object oPCSpeaker = GetPCSpeaker();
    object oTarget    = GetLocalObject(oPCSpeaker, "faction_editor_target");

    if (!GetIsObjectValid(oTarget))
    {
        SendMessageToPC(oPCSpeaker, "Invalid target.");
        return;
    }

    // From your included faction script
    // This is for CUSTOM_FACTION_A and will set it to neutral (50)
    // towards the target
    SetCustomFactionReputation(CUSTOM_FACTION_A, 50, oTarget);
}

You'll need to create one script for each of your factions.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #6 on: December 12, 2015, 10:21:00 am »


               


Alright. If you only change reputation by dialog things get much easier.


 


I recommend two things:


  1. Creating an area dedicated to holding a representative of each faction. Give each of them a unique tag. Remember no plot flag, Immortal flag is the better option. I always used the microset tileset and separated the npc by walls.

  2.    
  3. Write a custom AdjustReputation() function.

It's best to write an include script. That way you can create your own constants for the factions and use them in every script, like so:



// Use the tags from the npc in the faction areas. Add more as necessary.
const string CUSTOM_FACTION_A =  "factionNPC_A";
const string CUSTOM_FACTION_B =  "factionNPC_B";


int GetCustomFactionReputation(string sCustomFactionID , object oCreature);
void SetCustomFactionReputation(string sCustomFactionID, int nNewReputation, object oCreature);
void AdjustCustomReputation(object oTarget, string sCustomFactionID, int nAdjustment);
void RestoreReputations(object oPC);


// For convenience
int GetCustomFactionReputation(string sCustomFactionID , object oCreature)
{
    object oFactionNPC = GetObjectByTag(sCustomFactionID);
    return GetReputation(oFactionNPC, oCreature);
}


// For convenience
void SetCustomFactionReputation(string sCustomFactionID, int nNewReputation, object oCreature)
{
    int nCurrentRep = GetCustomFactionReputation(sCustomFactionID, oCreature);
    AdjustCustomReputation(oCreature, sCustomFactionID, nNewReputation-nCurrentRep);
}


//Custom AdjustReputation function
void AdjustCustomReputation(object oTarget, string sCustomFactionID, int nAdjustment)
{
    object oFactionNPC = GetObjectByTag(sCustomFactionID);
    AdjustReputation(oTarget, oFactionNPC, nAdjustment);
    // Save on a pc's trade journal
    object oTradeJournal = GetItemPossessedBy(oTarget, "cnrTradeJournal");
    if (GetIsObjectValid(oTradeJournal))
    {
        // Save the reputation
        SetLocalInt(oTradeJournal, "fac"+sCustomFactionID, GetCustomFactionReputation(sCustomFactionID, oTarget));
    }
}


void RestoreReputations(object oPC)
{
    // Make sure we do this only once per server reset per player character
    // We'll save a variable on the module for each player character and check
    // for it (it'll dissappear after a reset)
    object oModule= GetModule();
    if (GetLocalInt(oModule, "fac_doOnce"+GetName(oPC))==0)
    {
        SetLocalInt(oModule, "fac_doOnce"+GetName(oPC),1);

        object oTradeJournal = GetItemPossessedBy(oPC, "cnrTradeJournal");
        if (GetIsObjectValid(oTradeJournal))
        {
            ////////////////////////////////////////////////////////////////////////
            // Restore Reputations here. You'll need to do it for each faction
            int rep = 50;

            rep = GetLocalInt(oTradeJournal, "fac"+CUSTOM_FACTION_A);
            SetCustomFactionReputation(CUSTOM_FACTION_A, rep, oPC);

            rep = GetLocalInt(oTradeJournal, "fac"+CUSTOM_FACTION_B);
            SetCustomFactionReputation(CUSTOM_FACTION_B, rep, oPC);
        }
    }
}

Ok, maybe I did a bit more than just pointers, but I ripped most of it from my old server anyway. Create a new script, delete the main() function and save it. In your dialogs you'll need to include your new script with #include "myscript", You can then use the AdjustCustomReputation function insted of the default one. Use the constants from the top of the script access the faction.


 


 


Restoring will need to be done in the modules OnClientEnter event (accessible through the module properties). Include the script like above and call the RestoreReputations() function. You may need to get the player with GetEnteringObject(). But if you use the cnr you should already have a script there which will have the player object somewhere.


 


You should check if the cnr trade journal's tag is indeed "cnrTradeJournal". It may have changed. I assume of course that you have the cnr as the scripts use it's trade journal to save stuff. Else you'll have to add a non-droppable object to players inventory (or maybe use the player's hide item introduced in patch 1.69)


 


You'll need to add constants for each of your factions (along with an npc on the faction map) and adjust the RestoreReputations() function accordingly.




 


 


hi sorry for the long wait for a reply but been busy....actually am a bit confused on the first one....so basically copy pasted the script and as I tried to save/compile it but it gave an error, asking if I want to compile it as a conditional script instead?



 


12-12-2015 10:59:43: Error. 'includerep_b' did not compile.

includerep_b.nss: ERROR: NO FUNCTION MAIN() IN SCRIPT

 



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #7 on: December 12, 2015, 12:06:27 pm »


               

No need to compile it and you won't be able to as it has no main() function. Only save it (4th symbol from the left). To use it you'll need to include it in another script. For example if you saved it as "factions" you need to use #include "factions" in the other script. Afterwards all functions inside will be accessible.


It's basically just a collection of functions. It's best to have it all in one place, so you don't have to edit like 20 scripts, when something changes (i.e. you add a new faction). The drawback is that if you make changes to the include script, all scripts using it have to be recompiled to update them. But you can re-compile all scripts from the top menu with Build->Build Module, select compile only.


 


In the module properties under events tab you have OnClientEnter. You can create a new script there or maybe there already is one, in  which case you'll need to edit it. Put the #include "factions" at the top and then call RestoreReputations(oPC) from the main function.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #8 on: December 19, 2015, 09:39:12 pm »


               


No need to compile it and you won't be able to as it has no main() function. Only save it (4th symbol from the left). To use it you'll need to include it in another script. For example if you saved it as "factions" you need to use #include "factions" in the other script. Afterwards all functions inside will be accessible.


It's basically just a collection of functions. It's best to have it all in one place, so you don't have to edit like 20 scripts, when something changes (i.e. you add a new faction). The drawback is that if you make changes to the include script, all scripts using it have to be recompiled to update them. But you can re-compile all scripts from the top menu with Build->Build Module, select compile only.


 


In the module properties under events tab you have OnClientEnter. You can create a new script there or maybe there already is one, in  which case you'll need to edit it. Put the #include "factions" at the top and then call RestoreReputations(oPC) from the main function.




 


thanks for the clarification Asymmetric '<img'> 


 


now got about half of it implemented (and hopefully correct)  will test it later. Thank for helping me out here '<img'>


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #9 on: December 19, 2015, 10:30:22 pm »


               

maybe an utterly stupid question but should I have to rename: CUSTOM_FACTION_A to the name of the actual faction or would I be ruining  the script?



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #10 on: December 19, 2015, 11:02:19 pm »


               
object oItem      = GetItemActivated();   
object oActivator = GetItemActivator();
string sItemTag   = GetTag(oItem);

if (sItemTag == "faction_editor")
    ExecuteScript("faction_editor", oActivator);

 



 


Got a little issue with this one here. trying to add the above script to the onactivation script but I seem to be getting an error each time I do. I tried to even just use the execute script, without the 4 above lines and still errors.....



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #11 on: December 20, 2015, 09:42:16 am »


               

You can rename CUSTOM_FACTION_A and probably should for readability. You'll need to do that everywhere it was used, i.e. RestoreReputations() and the scripts for dialogs.


 


 


As for the error: Hard to say without seeing the rest of the script. The cnr has some stuff of it's own there. I may have named a variable the same they did. Can you post the whole OnActivateItem Script ?



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #12 on: December 20, 2015, 10:01:46 am »


               


void main()

{

    object oItem = GetItemActivated();

    object oPC = GetItemActivator();

    object oTarget = GetItemActivatedTarget();

    string sTag = GetTag(oItem);

    string sPCName;

    string sPlayerName;

 

    // Subrace system: Some player models normally used were changed due to lack of CEP

    if(GetLocalInt(GetModule(),"Subraces")==1)

        {

        ExecuteScript("_cb_activateitem",oPC);

        }

 

    // Werewolf System Addon

    if(GetLocalInt(GetModule(),"Werewolf")==1)

        {

        Werewolf_Form(oPC,oItem,oTarget);

        Wolf_Form(oPC,oItem,oTarget);

        Belladonna(oPC,oItem,oTarget);

        }

 

    // Vampire PC subrace Addon

    if(GetLocalInt(GetModule(),"Vampire")==1)

        {

        ExecuteScript("vamp_on_used", OBJECT_SELF);

        }

 

    // Bleeding/Death system item activation manager

    if (HABDOnActivateItem(oPC, oTarget, oItem)) return;

 

    // Subdual Tool Mode Switch

    if(sTag=="pcsubdualtool")

        {

        int iMode = GetLocalInt(oPC,"SUBDUAL");

        int iNextMode;

        // Only three possible options

        iNextMode = (iMode + 1) % 3;

        // Advance the state of the toggle item by setting the state of it up as an INT

        SetLocalInt(oItem,"Mode",iNextMode);

 

        // Inform them about the notification switch

        switch (iNextMode)

            {

            case 0:

                SetLocalInt(oPC,"SUBDUAL",0);

                SendMessageToPC(oPC,"You are currently doing full damage.");

                break;

            case 1:

                SetLocalInt(oPC,"SUBDUAL",1);

                SendMessageToPC(oPC,"You are currently doing subdual damage.");

                break;

            case 2:

                SetLocalInt(oPC,"SUBDUAL",2);

                SendMessageToPC(oPC,"You are currently in sparring mode.");

                break;

            }

        return;

        }

 

    // This handles the canteen for the dehydration system

    if (GetStringLeft(sTag,4)=="DH2_") ExecuteScript("vg_source_act",OBJECT_SELF);

 

    // This handles the items for the "PnP" Door system

    if (sTag=="IDSBook")

        AssignCommand(oPC, ActionStartConversation(oPC,"ids_book_conv",TRUE,FALSE));

    else if (sTag=="HoldPortal")

        {

        if (GetObjectType(oTarget) ==  OBJECT_TYPE_DOOR)

            {

            SetLocalInt(oTarget,"Magic Lock",1);

            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_KNOCK), oTarget);

            }

        }

 

    //Paladin's Badge of Courage script

    if (sTag=="vg_pal_courage")

        {

        vg_pal_courage(oPC);

        return;

        }

 

    //Enchant Rod script

    if (sTag=="EnchantRod")

        {

        ExecuteScript("ench_start", oPC);

        return;

        }

 

    //Soul Stone script

    if (sTag=="SoulStone")

        {

        SetLocalObject(oPC, "SoulStone", oItem);

        AssignCommand(oPC, ActionStartConversation(oPC, "SoulStoneConv", TRUE, FALSE));

        return;

        }

 

    // DM Epic Level Allow Wand

    if(sTag=="dm_epic_tool" && GetIsDM(oPC) && oTarget!=oPC && GetIsObjectValid(oTarget) && GetIsPC(oTarget))

        {

        sPCName = GetName(oTarget);

        sPlayerName = GetPCPlayerName(oTarget);

        int iMode = GetLocalInt(oTarget,"Allow_Level");

        int iNextMode;

        // Only two possible options

        iNextMode = (iMode + 1) % 2;

        // Advance the state of the toggle item by setting the state of it up as an INT

        SetLocalInt(oItem,"Mode",iNextMode);

 

        // Inform them about the notification switch

        switch (iNextMode)

            {

            case 0:

                SetDBInt("EpicPCs","Allow_Level",0,oTarget);

                SetLocalInt(oTarget,"Allow_Level",0);

                SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' is not currently allowed to take epic levels");

                SendMessageToPC(oTarget,"You are not currently allowed to take epic levels");

                break;

            case 1:

                SetDBInt("EpicPCs","Allow_Level",1,oTarget);

                SetLocalInt(oTarget,"Allow_Level",1);

                SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' is allowed to take epic levels");

                SendMessageToPC(oTarget,"You are now allowed to take epic levels");

                break;

            }

        return;

        }

     if (sTag=="dm_epic_tool" && GetIsDM(oPC) && oTarget==oPC && GetIsObjectValid(oTarget))

        {

        SendMessageToAllDMs("The DM '"+sPCName+"' belonging to '"+sPlayerName+"' is trying to give themselves Epic Level Permission!");

        SendMessageToPC(oTarget,"You are not allowed to give yourself Epic Level Permission!!!");

        return;

        }

     if (sTag=="dm_epic_tool" && !GetIsDM(oPC))

        {

        SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' has a DM Epic Level Allow Tool!");

        SendMessageToPC(oPC,"Only DMs may use this tool!!!");

        return;

        }

 

     // DM Item Modifier

     if(sTag=="dm_item_manipula"&&GetIsDM(oPC))

        {

            if(GetIsObjectValid(oTarget) == TRUE && GetObjectType(oTarget) == OBJECT_TYPE_ITEM)

            {

                SetLocalObject(oPC, "TARGETED_ITEM", oTarget);

                AssignCommand(oPC, ActionStartConversation(oPC, "dm_wand_item", TRUE, FALSE));

            }

            else

                SendMessageToPC(oPC, "That is not a valid item");

            return;

        }

     if (sTag=="dm_item_manipula"&&!GetIsDM(oPC))

            {

            SendMessageToAllDMs("The PC '"+sPCName+"' belonging to '"+sPlayerName+"' has a DM Item Manipulation Tool!");

            SendMessageToPC(oPC,"Only DMs may use this tool!!!");

            }

 

     // This will allow DMs to clear XP Debts as a VERY special reward.

     if (GetTag(oItem)=="xpdebtclearer")

     {

        if ((oTarget!=oPC)&&GetIsDM(oPC))

            {

            //to clear out xp via a dm wand

            ClearDebt(oTarget);

            SendMessageToPC(oTarget,"Your XP Debt has been cleared!");

            SendMessageToAllDMs(GetName(oTarget)+" has had their XP Debt cleared by "+GetName(oPC));

            }

        if ((oTarget==oPC)&&GetIsDM(oPC))

            {

            //to clear out xp via a dm wand

            SendMessageToPC(oPC,"Your XP Debt has NOT been cleared!  Do not try to clear your own debt . . . it is just wrong!");

            SendMessageToAllDMs(GetName(oPC)+" has tried to clear their own XP Debt!  Go smack them!");

            }

        if ((oTarget==oPC)&&(!GetIsDM(oPC)))

            {

            //to clear out xp via a dm wand

            SendMessageToPC(oPC,"Your XP Debt has NOT been cleared!  This tool is for DM use only!");

            SendMessageToAllDMs(GetName(oPC)+" has tried to clear their own XP Debt!  They are not a DM so go take the tool from them!");

            }

     }

 

     // * Generic Item Script Execution Code

     // * If MODULE_SWITCH_EXECUTE_TAGBASED_SCRIPTS is set to TRUE on the module,

     // * it will execute a script that has the same name as the item's tag

     // * inside this script you can manage scripts for all events by checking against

     // * GetUserDefinedItemEventNumber(). See x2_it_example.nss

     if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_TAGBASED_SCRIPTS) == TRUE)

     {

        SetUserDefinedItemEventNumber(X2_ITEM_EVENT_ACTIVATE);

        int nRet =   ExecuteScriptAndReturnInt(GetUserDefinedItemEventScriptName(oItem),OBJECT_SELF);

        if (nRet == X2_EXECUTE_SCRIPT_END)

        {

           return;

        }

}

ExecuteScript ("cnr_module_onact", OBJECT_SELF);

ExecuteScript ("zep_on_activate", OBJECT_SELF);

 

}

 



 



               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #13 on: December 20, 2015, 10:23:57 am »


               

    if (sTag == "faction_editor")
        ExecuteScript("faction_editor", oPC);

should work. Add those two lines somewhere after the variable declarations at the top.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent reputation and reset?
« Reply #14 on: December 26, 2015, 05:50:09 am »


               



    if (sTag == "faction_editor")
        ExecuteScript("faction_editor", oPC);

should work. Add those two lines somewhere after the variable declarations at the top.


 




okay now it says no errors! Thanks again and merry christmas! I will try to test it soon '<img'>