Author Topic: Disabling Portions of DMFI  (Read 431 times)

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Disabling Portions of DMFI
« on: September 16, 2015, 03:51:47 am »


               

I'm curious. I'm using the 1.09 version of DMFI and I want to disable certain portions of it. Right now I'm looking to remove the language support as well as auto-emote commands while retaining the other functions. Looking over the DMFI chat scripts I know I can't just remove them without breaking some of the DMFI widgets such as the appearance changer, which is something I use a lot as a DM. Has anyone done this already, or perhaps could give me a hand figuring this one out? These big packages are a bit more than I bite into scripting.



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Disabling Portions of DMFI
« Reply #1 on: September 16, 2015, 02:53:27 pm »


               

When  you say remove the language support, what do you mean exactly? Do you mean you want to disable the .lang chat command? I suppose the widgets can be disabled simply by not given the players any language widgets. 


 


In dmfi_plychat_exe (in the version I just pulled down from the new vault it's around line 2770)



   else if (GetStringLeft(sCom, 4) == ".lan") //sets the language of the target
    {
        // check target allowed
        if (!(GetIsDM(oCommander) || GetIsDMPossessed(oCommander) ||
            oTarget == oCommander || GetMaster(oTarget) == oCommander))
        {
            FloatingTextStringOnCreature("You cannot perform this command on a creature you do not control.", oCommander, FALSE);
            return;
        }

You could for example make that first "else if"   something like this



else if (0 && (GetStringLeft(sCom, 4) == ".lan")) //sets the language of the target

Or comment out that whole block to the next else if. Or if you use it as a DM you could remove the 3rd and 4th parts of the //check target allowed.


 


Then for the emotes you mean you want to prevent people from doing "*sits*" type commands? Or is that something else you are referring to?


If the former you can cripple the code around line 3844 (with "0 &&" or commenting out the block or whatever).



 else if (sLeadChar == "*")
                {

-meaglyn



               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Disabling Portions of DMFI
« Reply #2 on: September 16, 2015, 04:22:05 pm »


               

I've recently installed Sim Tools, and it has language support in a way I prefer. No need to have the redundant systems. I want to keep the DMFI tools, so I want to keep them installed, but some of the other parts of DMFI I have no need for. I'm not 100% familiar with how DMFI works exactly but I see no need to run any DMFI language code every time the chat event fires if I'm already firing the ones from Sim Tools. The same with the emote commands. 



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Disabling Portions of DMFI
« Reply #3 on: September 16, 2015, 06:36:14 pm »


               

What I showed above will do most of what you are asking for then.  It will prevent the emote commands from running and prevent the .lang command from doing anything. You could remove the call to RelayTextToEavesdropper but if you never register any listeners it won't cost that much and remove the code in the actual module on player chat handler that uses the chat hooks if you are not registering any hooks.


               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
Disabling Portions of DMFI
« Reply #4 on: September 16, 2015, 11:43:03 pm »


               

I must have a slightly different version than the one you've pulled up because I'm finding all of that in a script called 'dmfi_plychat_inc'.


 


I've managed to take out the language support, but emotes seem to be set up differently in this one then what you are showing...


 


However I did find this.



void ParseEmote(string sEmote, object oPC)
{
    // allow builder to suppress
    if (GetLocalInt(GetModule(), "DMFI_SUPPRESS_EMOTES") != 0) return;

    // initialize
    object oRightHand = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
    object oLeftHand =  GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);

    //isolate emote text from chat message
    int nLength = GetStringLength(sEmote);
    int nPos1, nPos2;
.
.
.
.
.

From the look of it there is a module variable "DMFI_SUPPRESS_EMOTES" that I can turn on that should disable it. I'm guessing this would just hit that return statement and ignore the rest of the code? Would it be better to remove/comment out the code itself, or would keeping it in with this not make any major difference?



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Disabling Portions of DMFI
« Reply #5 on: September 17, 2015, 01:38:56 am »


               

Ahh, I was going to as about that. That's Henesua's patched version. That's what I actually use as my base but I downloaded the latest official version since I thought that was what you had.  I was going to recommend Henesua's version anyway. The code is nicely cleaned up.