Skip to content

Bonus Feat - Player Tool?

ZephiriusZephirius Member Posts: 411
edited February 2022 in Builders - Toolset
I really feel like I'm missing out on something. What Are Player Tools 1-10?
What are they used for?

Comments

  • ForSeriousForSerious Member Posts: 446
    They are ten feats that are directly tied to ten scripts that you can customize how you want.
    The scripts are x3_pl_tool01 to x3_pl_tool10.
    The feats were intended to be added to the PC Properties skin that can be accessed with the include script x3_inc_skin.
    Just let me know and I can show you some examples of what I have used them for.
  • DJ_WoWDJ_WoW Member Posts: 48
    Gooday to ya,

    Could you supply an example of the scripts you us for the Tool/Feat, I would be interested in seeing one.

    Thank you for your time,

    DJ-WoW
  • ForSeriousForSerious Member Posts: 446
    Why sure. Here's an example OnClientEnter script:
    #include "x3_inc_skin"
    #include "x2_inc_itemprop"
    void main()
    {
        object oPC = GetEnteringObject();
        object oSkin = GetItemInSlot(INVENTORY_SLOT_CARMOUR, oPC);
        if(!GetIsObjectValid(oSkin))
        {
            oSkin = SKIN_SupportGetSkin(oPC);
            itemproperty ipPlayerTool = ItemPropertyBonusFeat(IP_CONST_FEAT_PLAYER_TOOL_01);
            DelayCommand(1.0, IPSafeAddItemProperty(oSkin, ipPlayerTool, 0.0f, X2_IP_ADDPROP_POLICY_IGNORE_EXISTING));
            SendMessageToPC(oPC,"Giving you some player tools.");
        }
        else
        {
            if(!GetHasFeat(FEAT_PLAYER_TOOL_01, oPC))
            {
                itemproperty ipPlayerTool = ItemPropertyBonusFeat(IP_CONST_FEAT_PLAYER_TOOL_01);
                DelayCommand(1.0, IPSafeAddItemProperty(oSkin, ipPlayerTool, 0.0f, X2_IP_ADDPROP_POLICY_IGNORE_EXISTING));
                DelayCommand(1.0, SendMessageToPC(oPC,"Gave you player tool 01."));
            }
        }
    }
    
    I put the add item stuff in delay commands because I think it did weird things if I didn't—while trying to add more than one tool.
    So if I were to add player tool 2, I'd delay that by more than 1.0.
    This script is made with the approach that players joining the game may not have been given the feats before. This way it's pretty easy to just add them, and everyone will get them next time they join.

    Next, example x3_pl_tool01:
    void main()
    {
        object oUser = OBJECT_SELF;
        object oTarget = GetSpellTargetObject();
        if(GetIsObjectValid(oTarget))
        {
            string sTag = GetTag(oTarget);
            string sCD = GetPCPublicCDKey(oUser, TRUE);
            if(sCD == "(MyPublicKey)")
            {
                SendMessageToPC(oUser, "Tag: " + sTag);
                SendMessageToPC(oUser, "RezRef: " + GetResRef(oTarget));
            }
            if(sTag == "BodyBag")
            {
                object oCheck = GetFirstItemInInventory(oTarget);
                if(!GetIsObjectValid(oCheck))
                {
                    SetPlotFlag(oTarget, FALSE);
                    //AssignCommand(oTarget, SetIsDestroyable(TRUE));
                    DestroyObject(oTarget);
                }
                else
                {
                    SendMessageToPC(oUser, "There is still something in that one.");
                }
            }
            if(sTag == "x3_it_pchide")
            {
                SetPlotFlag(oTarget, FALSE);
                DestroyObject(oTarget);
            }
        }
        else
        {
            SendMessageToPC(oUser, "Use this on glitched remains or PC Properties to delete them.");
        }
    }
    
    This little script is to help players clean up loot bags that have gotten stuck open so they never disappear. Not actually a problem I've seen in awhile, but it used to happen all the time on the server I played on. Anyway, I mainly use it for debugging because it can give me and only me the tag and resref of any object I target with it.
  • DJ_WoWDJ_WoW Member Posts: 48
    Gooday all,

    Wanted to thank for the time you took to supply me with some info. Greatly appreciated.

    DJ-WoW
  • ZephiriusZephirius Member Posts: 411
    edited February 2022
    Interesting. Thank you for the scripts Serious, and the guide Proleric! ;)
  • AceonAceon Member Posts: 5
    Hi thanks for this and the tutorial. I hope you can answer one question for me. How can I edit the script for this feat? I have been trying to learn scripting for 5 weeks now and have the basics down but I can't adjust the prestige class I want to fix because it is part of the PRC Hak pak. So, for this reason my scripting changes won't compile (because - apparently you can't change the Hakpacks?) -anyways, out of frustration I was trying to fix the problem with a custom feat. I know the script I want to use, its a scaled down version of the class ability from the PRC which I hope will fix the bug and allow me to play the class correctly...but I can't seem to save it.

    Can you tell me were/how to edit the script for Player Tools. If I can get it right I can create a custom weapon with the feat. I was thinking of making a custom feat and changing the 2da files to give it to the character class as a fix but I still can't compile anything from the PRC.

    I can write and script or edit an NSS file and save it...but the changes won't compile when I have the PRC loaded...
    so nothing happens.
  • MelkiorMelkior Member Posts: 179
    Proleric wrote: »

    Thank you for that. I do some scripting too, and this will be useful for me.
  • ForSeriousForSerious Member Posts: 446
    For PRC, or hackpacks in general… I know nothing. It might come down to you being able to modify the default game script, but the hackpack overriding that.
  • ProlericProleric Member Posts: 1,269
    Sée the suggestion from TheAmethystDragon here

    ...or else put your version of the script in a top hak.
  • MelkiorMelkior Member Posts: 179
    I did a quick check and there are default scripts named x3_pl_tool01 through x3_pl_tool10 for the player tools, so you just edit the script for the tool/feat number which you gave to the player and save it under the same name so that it replaces the default script.
Sign In or Register to comment.