EffectAbilityIncrease() can be made more durable using SupernaturalEffect(), but it still counts as temporary for some purposes (see Lexicon). Ability increase on items (e.g. skin) is also durable, but I don’t know a way of increasing base ability that counts as permanent for all purposes.
you know, i was sure i saw something like this a few years back. it was a hak pack called ‘romantic animations’, i think, but damned if i can find it now. i wonder if it’s been deleted from the site for some reason… anyway, there are a couple of places that might work to get you started :
yes, this is possible, but not w/vanilla scripting. you’d need nwnx, which isn’t only realistic if you’re developing for single-player mod. if you’re not, nwnx_funcs has what you need.
in principal, this is fairly simple. you’d call SetCreatureBodyPart ; as in SetCreatureBodyPart(CREATURE_PART_PELVIS, nPart, oTarget)
…where oTarget is the target creature and nPart is the number corresponding to the pelvis you want. how do you imagine this will be used ? a conversation in which the player is asked to choose ? a pullchain or switch ? a trigger ?
@Proleric & xorbaxian:
Yes, I want the PC to change the pelvis in game through conversation in which the player is asked to choose. Let’s say I want to change from pfh0_Pelvis001 to pfh0_Pelvis002, then the script would be:
I suppose you’re referring to the one on Nexus. In that case you’ll get a description of the various animations here: Lust Lagoon Haks at Neverwinter Nights - mods and community
Now, if you want to see them for real, the first option is to create a test module. The other one is to import the .mdl in Blender or 3ds max.
This (altering base ability scores via script) is indeed impossible in vanilla game. You’ll have to settle for an ability bonus solution, which shows up in green on character info.
Using a permanent effect is one way to do it, but it will show an effect icon in viewport’s corner, which is distracting if you’re emulating a “permanent” ability bonus. Try it with item property on PC’s skin instead:
@NWShaker Thank you very much, I’ll test the script. Btw, it brings me to another question.
If I want to save local variables, best to do it on the PC’s skin or on item? So that the local variables are stored when the character is exported to the next module. And what would be the script for this case?
Local variables are not persistent, they are lost if you start a new mod. And (afaik) the player skin is lost as well on a new mod.
If it’s not too much stuff, you may use an item description of any item you give the PC to store the variables. This requires some advanced scripting. Or you use the campaign database.
To store a few local variables on an item.
Let’s say the local variables are:
LoveHim
-LoveHer
-GoodHer
-EvilHer
To read the local variables stored on an item in the next module.
@NWShacker That ability increase script on PC’s skin, if I export the character into the next module, will they stay the same or back to the basic ones?
Item properties added via script persist across StartNewModule() and export + new game.
Variables you set on an item (eg. skin) will persist across modules when StartNewModule() is called. But if you export the character and start a new game with it, they will all be cleared. So, the best way to keep them around is to save them to skin and then save that skin to the database. Of course, any item would work here, but skin is a natural choice as you just need to give it to the PC. Oh and keep only the “essential” vars on the skin (the rest on PC as usual) to make it easier to debug or hack the module.
I recently published a prefab item Interdimensional bankcard | The Neverwinter Vault which has the feature. Well the scripting probably needs some polish up (it was my first publication), but it works. It should give you the basic idea how to store variables in a description.
BTW, @NeverKnight, paste your code here like this for proper formatting and highlighting:
[code]
void main() // lines with your code
[/code]
@Mmat, x3_mod_def_enter script does it, but it can be altered or removed. I don’t think it destroys current skin (for sure not if it has horse menu on it). But to be sure I tested both itemprop’s and variable’s persistence on a non-skin item and can confirm what is written in my previous post.
Your project: vars can be stored like that in unidentified description, each in own row, in name|type|value format or something. I also had a similar idea of a notebook project, where you convert all those useless note items to one item as its “pages” in dialogue.
@Mmat I’ve looked them up, but I don’t really understand what to do with them.
Is there a ‘vanilla scripting’ to store local variables on an item? I have like 7 local variables.
@NWShacker I was gonna use this script to export the character to the next module:
// give token inside container, transfer all variables to it
// then export and exit
#include "tgo_variables"
void main()
{
object oPC = GetFirstPC();
object oCont = GetItemPossessedBy(oPC, "tgo_plotitem");
object oTok;
if (!GetIsObjectValid(oCont))
CreateTGOTokenOnPC(oPC); // gives container + token, with 2.0 delay!!!
else {
oTok = GetItemPossessedBy(oCont, "tgo_token");
if (!GetIsObjectValid(oTok))
GiveTok(oCont);
}
// assume that PC now has the token after at most 3.0 seconds
// set variables (just in case, it attempts to do this on area enter, too)
DelayCommand(3.0, SetVariables(oTok));
// export character
DelayCommand(6.0, ExportSingleCharacter(GetFirstPC()));
DelayCommand(9.0, StartNewModule ("The Next Module"));
DelayCommand(0.5, FloatingTextStringOnCreature("Please wait 3...", oPC));
DelayCommand(2.33, FloatingTextStringOnCreature("2...", oPC));
DelayCommand(4.16, FloatingTextStringOnCreature("1...", oPC));
}
But then I’m stuck, 'cause I don’t know how to make the game read all the local variables stored on those two items in the next module. Or maybe is there an easier script that I can use, to export the character and to read all the local variables stored on item in the next module?
Here’s the thing: you can’t. You can only copy all variables between items via CopyItem. The game operates on an assumption that builder knows what variables he keeps on an item and can manually read & write them. Hence it does not provide any way to list variables in a way accessible by script.
This is why writing “persistent” variables to PC’s skin by all systems is the best solution. This skill either travels with the player via StartNewModule (keeping the vars for the next module) or is saved to DB before export and retrieved in the other module (keeping the vars for the next module).
In your case, the items will retain the variables because you take the PC to the other module directly, making them immediately readable there. They won’t if you try to start it with the exported character (exporting prunes all vars from all items). You’ll have to use database to store them for that character.
You would have seen it when you played Sanctum of the Archmage a few years back. I helped NinjaWeaselMan beta test the Romantic Animations suite when he developed it, and he gave me permission to integrate and package it into my project. He ended up not releasing it because of a conflict that arose in the CC community at the time (that was over a dozen years ago now). As far as I know only Project Q and I were ever given the official OK to use it.
Since I believe that Project Q is now “open,” it may be the case that the RAS is fair game for re-release. I certainly think it would be a benefit to the community, and I actually created a hak pack and some documentation for it that was never released that could be used for that purpose. I could try reaching out to him if there’s interest.
@NWShacker: So I don’t need another script in the next module, because the one I’m using has done the intended task? Or do I need another script to read all these variables from both items in the next module?
@Andarian: I’d love to be able to use the ‘romantic animations’. Because I was wondering, how come we get the amazing ‘intimate animations’, but we don’t get the romantic ones.
@Tarot_Redhand: How does it work? I mean, do I need to type something in game? I’m planning to use the romantic animations through dialogue.