Hi guys, i was wondering if someone knows where’s stored the script or whatever that makes trolls unkillable except fire/acid in nwn2. I saw that if i simply remove the basic damage script they become simply immortal then in game… Even if i put the default nw_c2_default6 whatsoever in the creature blueprint!
The ‘immortal’ property of trolls is set to TRUE by default. That property is set to FALSE through the ‘gb_troll_dmg’ OnDamaged script if it has taken fire/acid damage greater than is current HP. Then an EffectDeath
is applied to it, killing it for good.
LOL. And to think i changed the scripts there, and i’ve never noticed that. Aging is really catching up on me i suppose. Anyway, at this point it’s better edit the script rather than remove it. Otherwise, anytime someone uses trolls in a module i should have to go and check for it. Thanks for the answer by the way.
By the way, is there some small tutorial on how add a scripted effect to the special propriety that you can add to objects? I’m completely noob when it comes to stuff like that.
Not sure exactly what you mean here…You want to add an effect to an item/object through scripting? Don’t think there’s any tutorials for these kind of things, but if you are a bit more specific about what effect you want to add to what object maybe some of us here on the vault forums can help you.
Sure. I was replaying the wonderful halloween 2008 project, and old Elysian gave me the idea. It would be nice to make the chime of opening working like the flute he made on his halloween module. Like when the character uses it, he begins to play, start a melody and then you got the effect, like knock or whatsoever.
Alas, i have no idea how add those things. I could port models into many games without a problem, but it seems i couldn’t compile a script even if my life would depending on it…
I know that in the toolset when you create a new object, in “properties” you can add “unique effect” which is a scripted effect, but i have no idea how then you add the script to that very effect.
usually its done w/ tag-based scripting (nwn2-style, is based on nwn1-style).
Basic Scripting (not so basic) | The Neverwinter Vault
An item’s CastSpell:UniquePower can fire a script i_tagofitem_ac
when player activates the item. It can be a bit complicated to hook up (even before writing the script). but Here’s a simple script that you can use to see if/when the item and module-scripts have been wired properly enough to start your custom code →
// 'i_tagofitem_ac'
void main()
{
SendMessageToPC(GetFirstPC(FALSE), "i_tagofitem_ac");
}
(check that your toolset Options|Autosave is turned off – its on by default)
… poke away at it and get back in touch with whatever results :|
If you try kevL_s’ script and it works you can maybe then change it to something like this:
// 'i_tagofitem_ac'
void PlayCustomAnimationVoid(object oObject, string sAnimation, int iLoop = 1, float fSpeed = 1.f)
{
PlayCustomAnimation(oObject, sAnimation, iLoop, fSpeed);
}
void main()
{
object oFluteplayer = GetObjectByTag("tagoffluteplayer"); //Change the tag to the tag of the flute player
PlayCustomAnimationVoid(oFluteplayer, "playflute");
}
EDIT: I don’t remember if you get a sound from the flute by using my script but otherwise you could try this (the additional code here is made by travus):
// 'i_tagofitem_ac'
void PlayCustomAnimationVoid(object oObject, string sAnimation, int iLoop = 1, float fSpeed = 1.f)
{
PlayCustomAnimation(oObject, sAnimation, iLoop, fSpeed);
}
void main()
{
object oFluteplayer = GetObjectByTag("tagoffluteplayer"); //Change the tag to the tag of the flute player
PlayCustomAnimationVoid(oFluteplayer, "playflute");
object oIP = CreateObject(OBJECT_TYPE_PLACEABLE, "plc_ipoint ", GetLocation(oFluteplayer));
// do not remove this space ^
string sWave = "gui_flutesong02"; // <--- sound file name
DelayCommand(0.2f, AssignCommand(oIP, PlaySound(sWave, TRUE)));
SetPlotFlag(oIP, FALSE);
DestroyObject(oIP, 0.3f);
}
What really bothers me is also that at least in the previous toolset (the nwn1 one) there was the option of open and edit scripts, but in this crappy nwn2 toolset i don’t even uncerstand how to load them. For making things quicker i simply exported the flute and then i exported the script after having removed the not necessary parts, ending with something more or less as you showed here, but then in game, nothing?
More important then: for exporting a script you exporting it like .erf? Then you put it in override or…?
And it auto loads if the names are correct?
Hmm, it’s quite easy to create new scripts and edit them…I have worked extremely little in the NWN1 toolset but from what I have been able to tell, opening and creating scripts are just as easy in both the toolsets.
Just doulbe click in the white area when in “Scripts” and you create a new script.
I highly recommend using and installing this:
https://neverwintervault.org/project/nwn2/other/tool/powerbar
Here’s a good basic tutorial:
EDIT: For exporting scripts you can export them as a .erf file, but if you use Directory Mode (highly recommend that) you can just move scripts from your directory module folder to another directory module folder. Or, even better, if you use Campaign Mode you put all your scripts in the Campaign folder and you can move scripts back and forth from there. It’s a bit hard to explain if you haven’t got into the basics of the Toolset yet, so watch the video first, I think.
You can put scipts in the override too, but I really don’t recommend that.
@andgalf i assume this is for player-usage rather than building a module … (hence i suggest /override so its available in all modules/campaigns)
Unfortunately the Chime of Opening doesn’t use a script; it has itemproperty
CastSpell:Knock instead of CastSpell:UniquePower.
The Chime item could be copied to your MyDocs/Nwn2/Override folder and modified, but that doesn’t guarantee that when you get a Chime ingame it will be your custom version.
if you want to try it anyway, you don’t need to fool around with .ERFs. Find the Chime in blueprints, rightclick, CopyBlueprint->Global. This makes a copy of the .UTI file to your MyDocs/Nwn2/Override folder as x0_it_mthnmisc040.UTI
. You should now see 2 ChimesOfOpening in the toolset’s blueprints panel.
Select the one with the extra “0” on the end: x0_it_mthnmisc040
Go to its Properties|Behavior|ItemProperties slot. Remove CastSpell:Knock and add CastSpell:UniquePower. Click the itemproperty and set its charge/usage to what you want. Then select it in the blueprints panel again and right click → SaveToFile, navigate to your MyDocs/Nwn2/Override folder and overwrite the previous file: x0_it_mthnmisc040.UTI
.
If you want a better name for the resref, under its Properties|Basics, change the ResourceName, Tag, and TemplateResref slots to something like “chime_uniquepower”. This changes the filename from x0_it_mthnmisc040.UTI
to chime_uniquepower.UTI
.
do right click → SaveToFile again to update the blueprint. Now you need a script for it …
// 'i_chime_uniquepower_ac'
/*
Item event script OnActivateItem.
*/
void PlayFluteAni(object oActivator)
{
PlayCustomAnimation(oActivator, "playflute", FALSE);
}
void main()
{
object oActivator = GetItemActivator();
AssignCommand(oActivator, PlaySound("gui_flutesong02"));
DelayCommand(0.75f, PlayFluteAni(oActivator));
}
save that in MyDocs/Nwn2/Override folder (or better in a subfolder, along with your .UTI file) as i_chime_uniquepower_ac.nss
(or use whatever tag you’ve chosen, between i_ and _ac)
You’ll need to close and reopen the toolset for the toolset to pick up that new script.
Then do File|Open Conversation/Script and browse to the script (or use the FileFilter). Press Save & Compile [F7] and an .ncs
file ought to appear alongside the .nss
file in your folder.
Load the game and open the console →
` debugmode 1 giveitem chime_uniquepower debugmode 0 `
all things equal … enjoy chime that sounds like a flute …
Oh, sorry. My mistake.
Absolutely. Totally agree.
oh, one thing i forgot in all that …
actually cast a knock spell …
/l8r tho
Hmm… Regarding the menu Andgalf spoken, i don’t find it anywhere. (maybe it’s a matter of settings…? booh)
Anyway, i compiled, saved exported, aand… Nothing happens lol. I’m afraid, as someone once said, “a men should be aware of his limits” that is surely one for me (or one of many lol).
Of course, i couldn’t export it in nss, but only in erf, so it could be that the problem, but exporting a modified version of the elysium ones didn’t worked too so… Go figure.
I don’t fully understand what menu you are talking about now, and I’m confused you are talking about something I said since @kevL_s told me this is only for player-usage and I assumed you were making your own module…
Did you follow kevL_s’ instructions, @John_Barleycorn ? His instructions tend to be very exact and most of the times easy to follow (I know since he has taught me a lot of things and explained things well).
Maybe you can take a picture of how the toolset looks for you so that we might help better? At the moment I’m not sure I understand what you are doing or what you are trying to do. I wish I could help you better…
Are you trying to import scripts somehow into the toolset into a new module and from there you want to edit the scripts? Is that it perhaps? Or have you opened the Elysian module and you try to find a script there to modify?
Ok, better go sleep now. It’s late where I live…
I’m referring to the screenshot you shown, where you pointed the scripts, i don’t have it in that way. Anyway, if i open any script, i have only save and compile, but if i use the export option, (under the “file” menu) and i select a script, it alows me to export it only in .erf, not even i nss…? So booh. I don’t understand a damn thing of this toolset. In the previous you had the program with all the options, here it doesn’t seem…?
I you use Directory Mode (Save Directory), like I talked about, you don’t need to export anything. You can just move the files out in Windows, since then the toolset creates a folder where every file you have is visible. Easy peasy. I mostly use exporting as erf if I want a whole area with characters and scripts and everything, then it’s easier to have that as one file for importing into some other module or whatnot that I’m working on.
I would really like to see how your Toolset looks from a screenshot. I believe, if you want to have it like I do, you need to install the powerbar plugin. It’s the most essential (IMHO) tool to have when working in the NWN2 toolset: PowerBar | The Neverwinter Vault
I mean, to work wuth NWN2 and the toolset can sometimes be a pain-in-the-behind, but that’s more due to all the bugs that are still present.
Ah! Must have missed that tool! Seems interesting. I’ll try that out and see if i can do the trick with that. Thanks for the tip!