Skip to content

Award Feat

ZephiriusZephirius Member Posts: 411
edited February 2021 in Builders - Scripting
Is it possible through scripting to award the PC with an active feat of my choosing. I mean it actually showing up in the GUI? Was ploughing through the script editor trying to stumble on something of value. Would you use "talent"
How would you even apply that to a PC? Somehow make it into an effect?

void FeatKnockdown(talent tTalent)
{
tTalent = TalentFeat(FEAT_KNOCKDOWN);

}

                

Comments

  • ProlericProleric Member Posts: 1,281
    You can add an item property ITEM_PROPERTY_BONUS_FEAT to the PC skin.

    Feats added that way show up in the GUI character sheet.
  • ForSeriousForSerious Member Posts: 446
    Were you hoping to add it to the options while leveling up? To me that sounds like overriding 2da files, and would mean that it would not be unique to one PC.
    Otherwise, Proleric stated the best way to do it.
  • ProlericProleric Member Posts: 1,281
    edited February 2021
    To make it a level up option, you'd need to change the package feat files packft*.2da for all classes and packages affected, rather than the PC skin. The player could then choose the feat (with pre-requisites, if you like) but equally could choose not to take it.
  • ZephiriusZephirius Member Posts: 411
    ForSerious wrote: »
    Were you hoping to add it to the options while leveling up? To me that sounds like overriding 2da files, and would mean that it would not be unique to one PC.
    Otherwise, Proleric stated the best way to do it.

    No. I was going to try to script it from the actions taken tab. The conversation goes something like this:
    "Yes professor", " "I will pay 5000 gold to learn take your lesson." lesson=New Feat.

    I don't see how it can be scripted though.
  • ForSeriousForSerious Member Posts: 446
    The functionality comes from the built in x3_inc_skin script.
    Your script would look something like:
    // Has all the PC_Properties functions.
    #include "x3_inc_skin"
    void main()
    {
        object oPC = GetPCSpeaker();
        object oSkin = SKIN_SupportGetSkin(oPC);
        itemproperty ipAward = ItemPropertyBonusFeat(IP_CONST_FEAT_KNOCKDOWN);
        AddItemProperty(DURATION_TYPE_PERMANENT, ipAward, oSkin);
       // Todo: Add the take gold part.
    }
    
    Of course that's only a small portion of what you want to have scripted. You'll want to check the player before to see if they have enough gold, or already have the award feat, and not show the conversation option if so.
  • ZephiriusZephirius Member Posts: 411
    Thank you Serious, I couldn't have been farther from the solution.
  • ForSeriousForSerious Member Posts: 446
    You're welcome.
    As a potential interest: This is also the way to add player tool feats.
  • ZephiriusZephirius Member Posts: 411
    edited February 2021
    Yeah, I was looking at IP_CONST_FEAT_PLAYER_TOOL. Not exactly sure what a tool feat is?

    Hey serious, take a look at this script and tell me why ActionResumeConversation isn't firing. Thx
    effect e1;
    effect e2;
    
    void main()
    {
    
    object oTarget;
    location lTarget;
    oTarget = GetWaypointByTag("SMELLS");
    lTarget = GetLocation(oTarget);
    
    ActionPauseConversation(); //works just fine
    
    object oPC = GetPCSpeaker();
    
    //ClearAllActions();
    
    /*ActionMoveToObject(GetObjectByTag("BLACKBOARD"));
    
    ActionPlayAnimation(ANIMATION_FIREFORGET_READ);
    
    object oSelf = OBJECT_SELF;
    ActionMoveToObject(oSelf);*/
    
    e1 = EffectDisappearAppear(lTarget);
    e2 = EffectVisualEffect(VFX_DUR_BLUR);
    
    DelayCommand(1.5, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e1, OBJECT_SELF, 7.5));
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, e2, OBJECT_SELF, 1.5);
    
    DelayCommand(7.7, AssignCommand(OBJECT_SELF, ClearAllActions()));
    ActionResumeConversation(); //broken, "so to speak"
    
  • ForSeriousForSerious Member Posts: 446
    My initial thought was to put it in a delay command that is long enough for all the actions to complete. That's not how the example in the lexicon is set up though. Does the conversation window ever close while the actions are happening?
  • ZephiriusZephirius Member Posts: 411
    yes
  • ForSeriousForSerious Member Posts: 446
    edited February 2021
    Oh okay. "If the PC moves out of range of the object it was having a conversation with, it is not possible to resume it." —The Lexicon
    Sounds like you need to need to either keep the actions closer, or, you have to set a variable and some string conditionals. That way you can just call start conversation after the actions.
    (My experience with conversations and their script functions is pretty low.)
  • ZephiriusZephirius Member Posts: 411
    Got it. ;)
  • ProlericProleric Member Posts: 1,281
    For what it's worth, Player Tool Feats are discussed here.

    Not what you need in this case, but very useful.
  • ZephiriusZephirius Member Posts: 411
    edited February 2021
    ok
Sign In or Register to comment.