Author Topic: custom skill tutorial request  (Read 412 times)

Legacy_nwnsmith

  • Full Member
  • ***
  • Posts: 125
  • Karma: +0/-0
custom skill tutorial request
« on: July 11, 2012, 06:41:09 am »


               I have never played around with custom skills but I think I want to add custom skills for CNR crafts. If anyone could point me towards a tutorial or prefab that would be uhh-mah-zing.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
custom skill tutorial request
« Reply #1 on: July 11, 2012, 04:58:55 pm »


               Since Im going to create new skill for my never-finished PW project, I can make a rough tutorial how to do that.

Anyway, you should know that new skills need scripting support. Without it, player will be able to put points into the skill but the skill itself won't do anything on its own. To do something, you need to script it. I will explain how later

Part 1: Preparing the new skill.
1) edit TLK - you need two new lines, one for skill name second for skill description
2) edit skills.2da (you can get this 2da from my package of 2das from 1.69 if you dont have this, or export it va nwnexplorer from hotu patch datas), add new line - see this for reference - LINK
for example my line looks like this:

      Label            Name      Description   Icon             Untrained   KeyAbility   ArmorCheckPenalty   AllclassesCanUse   Category   MaxCR   Constant                 HostileSkill  
29    Survival         1124136   112137        ife_X1CrTrap     1           WIS          0                   1                  ****       ****    SKILL_SURVIVAL           0             

custom icon is good idea, you can get nice craft icons in here: LINK

3) ok that was the easiest part, now you need to set upt each class skills to set it to be (cross)class skill, you need edit all cls_skill_*.2da files. Maybe its not needed to set up the skill into these 2da if the skill have to be cross-class, it should be selectable and crossclass automaticall (provided its untrained= 1, trained only must be listed in 2das), but its good practice anyway. Now look into those 2das, its easy to understand the logic and how to set it up there.

that should be for preparing everything
               
               

               


                     Modifié par ShaDoOoW, 11 juillet 2012 - 04:01 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
custom skill tutorial request
« Reply #2 on: July 11, 2012, 05:18:52 pm »


                There also appears to be a maximum number of skills. Check this thread.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
custom skill tutorial request
« Reply #3 on: July 11, 2012, 05:20:38 pm »


               By setting the skill up, you have now access to the GetIsSkillSuccessful scripting function, simply put into the parameters line number of your skill instead of constat which doesnt exists.

Now to the scripting part. It depends how you want to use the skill. In my case of survival skill, I want from this skill to create conversation with various tasks like: tracking, resting, area info, gather food etc.

Possibilities are to add this convo into the resting convo (if there is any in your module, there isnt in mine so not option for me), or default nwn crafting conversation or into the class radial menu. I choosed the last option so I need to:
1) create survival spell with script that activates the conversation
2) create feat linked with the spell
3) add the feat to all classes radial's menu (think there is tutorial for this out there).
4) add this feat into iprp_feats which wil allow me to grant this feat as bonus feat to players (while I can set up the feat to be acquired automatically, already made characters wont get this feat, so i need ot add it to them either by bonus feat or nwnx_funcs
5) manage the conversation itself


The scripting part of this is hard to explain to someone who isn't scripter. If you are good for you. If not well, this won't help you much. Anyway there are some basic stepts how to do something skill-related:

Synergies:
you have to set up script in OnLevelup, OnClientEnter which adds the synergy bonus as itemproperty on players skin. Not sure whether more of the same skill bonuses on skin stacks so you should count it together before adding on skin. You can also use effect to achieve this, but then this effect will be visible to player (unless you will use my solution how to hide an effect icon (posted in homebrew functions into this forum, its like next to last page in scripting). Even then you have to re-apply the effect after respawn/resurrect so you need to add script into the resurrection spells Raise dead and Resurrect.

Automatic bonuses like AC/AB
same method as for synergies

Use to grant a temporary advantage like speed increase, jump/teleport etc.
same method ad for survival, needs feat in radial +spell to do this

Crafting
you have to somehow add it into the CNR, cant help with details on that, but the GetIsSkillSuccessful is your friend