Drop Rates, NWNVault, and other toolset questions
ApolloMk2
Member Posts: 3
Hey everyone, I've been working on a new PW but I've been out of the game for about 10 years. Last thing I did was a moderately successful NWN2 PW (Legends of Arcadia). So I'm making good progress but I have lots of questions I would appreciate help with..
1 - It seems like the NWNVault with its sample areas and scripts and all that is gone and no one else really has it hosted. Is there any other good place for this stuff?
2 - When you make a monster drop items, is there a way to specify drop rate? Like if I want to make a baddie Wizard drop the occasional magic wand instead of having your inventory full of 100 of them after 20 minutes.
3 - Whats the best way to make an item kick off a script or conversation? For example if I wanted to make a binding/teleportation stone. So when you got to a totally new section of the map you could get a stone for that area and just teleport back to it.
I appreciate any suggestions you have - thanks
1 - It seems like the NWNVault with its sample areas and scripts and all that is gone and no one else really has it hosted. Is there any other good place for this stuff?
2 - When you make a monster drop items, is there a way to specify drop rate? Like if I want to make a baddie Wizard drop the occasional magic wand instead of having your inventory full of 100 of them after 20 minutes.
3 - Whats the best way to make an item kick off a script or conversation? For example if I wanted to make a binding/teleportation stone. So when you got to a totally new section of the map you could get a stone for that area and just teleport back to it.
I appreciate any suggestions you have - thanks
0
Comments
3 - NWN "Tag based scripting" might be of interest. Primer: https://nwnlexicon.com/index.php/Grimlar_-_Introduction_To_Tag_Based_Scripting
But I still have to get to making that series of scripts anyway, this is the simpler version. It uses getting local variables set on the creature to drop a fire beetle eye, and you place it on a fire beetle's on spawn. In a similar fashion, as I mentioned before - you can just modify it to drop whatever by putting the tag of what you want to randomly drop in its variables as a string with the variable named BODYDROP_TAG. You can also change the "drop rate" from 1 in 6 to whatever.
Oh, and it makes critters that do drop something have a lootable corpse. Its important to not have a module OnSpawn that generates a small amount of treasure. The default expansion scripts are good for that, they generate no treasure for anything. If you dont want the lootable corpse to happen, just comment out the last two lines of SetIsDestroyable and DelayCommand.
// NAME TA_dropbodybag written for Atlantis mod
// Function: random chance to drop an item specific to the critter = 1 in 6
// Examples: fire beetle might drop a fire beetle eye, wolf might drop a wolf skin, goblin might drop a goblin ear....
//placed OnSpawn, makes corpse lootable if special item is created as loot, otherwise they act normally
// purpose: some creatures like fire beetles dont have treasure, but might produce something valuable from their corpse
//set a string variable on the creature named BODYDROP_TAG and set it to the tag of the item to drop
//inserted scripts into standard on spawn
//::///////////////////////////////////////////////
-----------generic onspawn lines here
//////////////////
//
//
/////BEGINNING OF INSERTED SCRIPT LINES
//
//
// Roll the dice
int iBodyDrops = d6(1); // change this line if you want different odds
// Only return if dice roll is a 1
if(iBodyDrops != 1) //if this is a one, the NPC has a lootable corpse and drops its special item
{ return; }
// Gets the variable off of the NPC that tells what the tag of the loot item is.
string sItemTemplate = GetLocalString(OBJECT_SELF, "BODYDROP_TAG");
CreateItemOnObject(sItemTemplate, OBJECT_SELF, 1);
SetIsDestroyable(TRUE, FALSE, TRUE);
DelayCommand(1.0, SetLootable(OBJECT_SELF, TRUE));
}
https://neverwintervault.org/project/nwn1/module/gameworld/time-atlantis
Doing it on spawn will allow rogues to pickpocket it as well, which is a nice feature that rogues can actually utilize.
Piggy backing off local variables is a great way to make a reuseable script, instead of hard coding your item resrefs, and having 10 million scripts for each and every spawn.
If you need an example I can grab one of my old scripts and post it here.
This makes it easier to modify the drop tables - Either edit the chest inventory through the GUI in the toolset, or if you're a PW the DMs can dynamically add/remove items from these chests. No need to mess around with item resrefs, just chest tags, which can be pretty descriptive. E.g.: "loot_mundane", "loot_plusone", "loot_unique", etc..
My personal view is to make a chest for each area, and have four scripts that divide that one chest up into four chunks, as I mentioned above. But this is more of a choice to make each area have its own "loot personality" (since I am making a PW thats open world exploration with different places of origin based on starting PC class and race - thus a ranger/druid place would drop ranger/druid elf stuff and an evil wizard/monk place would drop evil wizard/monk stuff) plus, some areas like non-adventure areas in towns and newbie areas (with stuff like the aforementioned fire beetles) would then not have chests or junk items chests - so they would be safe for DM events because you could spawn high CR creatures and they would then drop none to negligible treasure unless you ploinked it into their inventory from the DM interface.
At some point, Ill get those scripts done and when I put them on the vault, Ill link it here, It sounds complicated but its not much more than what I did up there with the 'bodybag' script (I have a dark sense of humor and sometimes it shows up in script names).
You could have a way to add things to a spawn table if it used Local Variables, you just need to add something to the module variables, and match against tag or resref.
Anyway, just trying to give me 2 cents on scripting for reusability, and also effective scripting. The container idea is a great addition for the DM interoperability. (You could also make a DM tool that the DM could use and add to a specific tag/resref of creature's spawn table, via SetLocalObject on the module, no need to go to a special area and drop items in a container)
https://neverwintervault.org/project/nwn1/script/magus-loot-system