Hello there , i am new to moding and the toolset . I am trying to make something but i have no clue how it should be made :
I want to make an object that reveal itself (with a spot check, if he succeed) when the player come near, a bit like a secret door . Instead it would be some secret note or loot .
Make a template for the placeable, including inventory if required. Put a waypoint in the area at the position you want it to appear. When your skill check script detects success, use CreateObject() to make the object appear :
location lLoc = GetLocation(GetObjectByTag("waypoint_tag"));
CreateObject(OBJECT_TYPE_PLACEABLE, "placeable_resref", lLoc);
where waypoint_tag is the tag of your waypoint and placeable_resref is the resref of your template.
Set a flag to stop this happening more than once.
There are lots of other options - using a trigger around the target with a skill check, an invisible object running a heartbeat check like the official secret doors, and so on.
IIRC the official skill for this is Search rather than Spot but you can code whichever you prefer.
If you’re completely new to scripting, you’ll want to check out some primers and tutorials before this makes sense.
Thank you But i don’t understand anything about what you are saying lol
In your toolset there is something called a waypoint. Looks like a flag on the ground. You’ll normally want to name it something unique for what the purpose is.
There are also triggers. These are triggered when a player walks through them. if you place one in your area and right click it, under one of the tabs you’ll see some scripting options. Proleric is referring to making a script for the OnEnter that will spawn (or instantiate) the object you want under certain conditions. A great tool to help do some of the scripting for you is Lilac Soul’s script generator. It’s very helpful. Lilac Soul's NWN Script Generator V2.3 | The Neverwinter Vault
I second @Buddywarrior 's recommendation of Lilac Soul’s script generator. I have very limited understanding of scripting in NWN and rely on that tool for almost everything, and I’m currently putting the finishing touches on my second module. Obviously taking the time to learn scripting properly will make many more things possible, but if you want to make a simple functioning module with a minimum of fuss, Lilac Soul is very much your friend.
This youtube series by Kevlar Creates is also very informative, helpful and accessible.
That is very helpful ! Thank you
While this script pack is ancient, I still use it periodically just for what you are talking about - Descriptive Skill Triggers 1.0 (Descriptions, Flavor Text, Skill & Ability Checks) | The Neverwinter Vault
It provides different types of checks and allows you to create a description along with experience and item creation.
Just , Whoa !! Thank you very much , this is what i needed ! Its great !
I just tried for items and it always tell me the same Error , that it cannot creat the item …
I found the problem while searching the code In the pdf it gave an example :
Find some darts
DC 10 search skill, checks once per player
DMs are notified on success, 100 XP given on success
create item (dart), item has default facing
But it is wrong , because its an item and OBJ should be 2 not 3 ( placable )