Skip to content

Script to add to character base stats possible or no?

EpicValorEpicValor Member Posts: 12
edited July 2023 in Builders - Scripting
Before I start working on a module I have in mind, I need to know if it's even possible to do certain things, like characters earn feats by doing certain things in game. Along with that, there will be either no levels, or few levels to increase base stats. I really don't want to script stat buffs so players can see their actual stats increase on their character sheet. I'm also assuming that BAB can be changed in the .2das.

The entire premise is kinda like a Japanese isekai with all custom classes, spells, skills, etc.

I know at one point, like 15 years ago this wasn't possible. If it still can't be done then that's the end of that idea. It's okay to squash this idea, no worries.
Post edited by EpicValor on

Comments

  • EpicValorEpicValor Member Posts: 12
    I'm guessing by the lack of any response that it can't be done. Thanks anyway.
  • TarotRedhandTarotRedhand Member Posts: 1,481
    edited August 2023
    Simple answer is I don't know. Better answer try asking on the vault but you'll need a free account to use the forums there. Also, for a full record of all the changes that have been made to NwN to make it into EE take a look on the wiki, starting from this page. On the wiki there is also a page dedicated to what is still hard-coded.

    TR
  • EpicValorEpicValor Member Posts: 12
    Thanks, I came across a post in scripting there where a guy was assigning epic stat feats to emulate increasing core stats, but while he could indeed assign the feats, the PC character's stats did not increase. Anyway, this led to another response in the thread that increasing core stats was not possible via nwscript alone. A third party tool was required to do it if you were using the mod online, but can't be used in single player. I don't care to have to use a linux only tool.

    As much work as Beamdog has done on this game you'd think adding script code to modify core stats would have been one of the top priorities. If a DM client can do it, then it should be possible to do either directly, or make an NPC able to be a DM and use DM tool.

  • MelkiorMelkior Member Posts: 204
    It's my understanding that it's not possible to change base stats in the game, although it is possible to add bonuses through scripting. The problem with adding bonuses is that you still can't boost any stats beyond the coded limits for boosts. So by default, you can't add any more strength as a bonus once the PC already has 12 points of total str boost from items. I gather that EE has enabled a method to change that limit so that it's no longer hard-coded, but I haven't yet explored exactly how it's done.

    Presuming you can reset the limits, you can probably do what you want by using an OnClientEnter script to first check for and remove any permanent boosts which are already on the PC's skin, then calculate the proper boost(s) and apply them to the PCs skin as a permanent effect.

    One server which I play (Kharlindale Realms) already has boosts to certain abilities when PCs get legendary levels which are simulated via scripting and journal entries. My impression is that they only boost stats which are not already boosted via equipment. That's one option, but the other is to learn how to change the boost limits which were previously hard coded in 1.69 but can now be changed in EE.
  • EpicValorEpicValor Member Posts: 12
    Yeah, I don't think that would work for me. I don't think that works for feat requirements. Thank you for the idea though. I kinda wanted to make a module that could be played by anyone solo, or host it themselves to play with friends. Though I suppose I could make it a PW, but then I'd still have to use a 3rd party tool.
  • MelkiorMelkior Member Posts: 204
    Regarding making a module work in both single-player and multi-player mode, you can check for that and have your scripts behave appropriately. You just make use of this function:
    // Get the public part of the CD Key that oPlayer used when logging in.
    // - nSinglePlayerCDKey: If set to TRUE, the player's public CD Key will
    //   be returned when the player is playing in single player mode
    //   (otherwise returns an empty string in single player mode).
    string GetPCPublicCDKey(object oPlayer, int nSinglePlayerCDKey=FALSE)
    
    And here's the quick & dirty way of doing it:
    // Returns TRUE if the currently running module is in multiplayer mode, or FALSE otherwise.
    int GetIsMultiPlayer()
    {
      return GetPCPublicCDKey(GetFirstPC())==GetPCPublicCDKey(GetFirstPC(),TRUE);
    }
    
  • TerrorbleTerrorble Member Posts: 179
    I've never played with changing the base stats either - because I knew it wasn't doable via scripting/2da edits I did.

    If it didn't get explicitly mentioned here already:

    SetAbilityBonusLimit()

    You could throw this in the OnModuleLoad event script, then script whatever bonuses you want when the player enters. It, of course, doesn't change the base stats, but effectively lets you set them however you like.
Sign In or Register to comment.