It is currently Thu Sep 09, 2010 7:25 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Anyone familiear with NESS?
PostPosted: Wed Mar 10, 2010 3:45 am 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
Anyone familiar with NESS? I have a question regarding some changes I want to make to spawn_cfg_loot.

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Wed Mar 10, 2010 1:49 pm 
Offline
Developer
Developer
User avatar

Joined: Fri Jul 16, 2004 10:08 am
Posts: 421
I have used it a lot, ask away. :D


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Wed Mar 10, 2010 11:16 pm 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
Yeah!

Okay, here goes:

I use the NESS alot. I use NESS for loot. Normally, I use the flags that have an integer >500 for loot. This means, for anyone interested who doesn't know NESS, that I store all of the loot in loot merchants, which act as containers. Each merchant is given a tag like LOOT_501. When a spawn is created, the script goes into the loot merchant, pulls out a random item, and sticks it in the spawns inventory.

This works well, and its very easy to add or subtract items from the loot merchant.

However, the issue I'm running into is that I like to have low % chances for really good items (like most mods do, I imagine). The way to do this is to create copies of more mundane items in the loot merchants. So, as a poor example, you might have a +3 flaming longsword, but 20 heal kits. As you increase the number of items in the merchants, they get really bloated.

My solution to this, I hope, was to put a % table directly into spawn_cfg_loot, and use flags that call to numbers less than 500. I will try to post the script so you can see it. I've left off the tail end, but its essentially what cereborn and neshke use for the >500 merchants. In fact, most of it comes from the >500 portion of the script, I've just moved it, added in the random die roll, and then made a call for the oSpawn's CR (putting it in place of the call for the Loot_ +string).


Quote:
// Only Make Modifications Between These Lines


// Table 00
if (nLootTable == 77)
{
object oStore = OBJECT_INVALID;
int nCR;
object oItem;
int nCount;
int nAmount = 1;

// Determine Loot Merchant
nRandom = d100();

if(nRandom < 41)
{
oStore = GetObjectByTag ( "LOOT_POTION");
}
else if(nRandom < 71)
{
oStore = GetObjectByTag ( "LOOT_GEMS");
}
else if(nRandom < 81)
{
oStore = GetObjectByTag ( "LOOT_SCROLLS");
}
else if(nRandom < 91)
{
oStore = GetObjectByTag ( "LOOT_LQ_STATIC");
}
else if(nRandom < 98)
{
int nCR = GetChallengeRating (oSpawned) + 100;
oStore = GetObjectByTag ( "LOOT_" + IntToString(nCR));
}
else if(nRandom < 99)
{
int nCR = GetChallengeRating (oSpawned) + 101;
oStore = GetObjectByTag ( "LOOT_" + IntToString(nCR));
}
else if(nRandom == 99)
{
int nCR = GetChallengeRating (oSpawned) + 102;
oStore = GetObjectByTag ( "LOOT_" + IntToString(nCR));
}
else if(nRandom == 100)
{
int nCR = GetChallengeRating (oSpawned) + 103;
oStore = GetObjectByTag ( "LOOT_" + IntToString(nCR));
}

if( GetIsObjectValid ( oStore ) )
{
// -- check if we already know item count
nCount = GetLocalInt (oStore , "nItemCount" );
if( nCount <= 0 )
{
// -- Count Items in Store Inventory
oItem = GetFirstItemInInventory ( oStore );
while( GetIsObjectValid( oItem ) )
{
nCount++ ;
oItem = GetNextItemInInventory ( oStore );
}
SetLocalInt ( oStore , "nItemCount" , nCount );
}
while( nAmount > 0 )
{
// -- Determine random item
int nSelected;
int nRand = Random( nCount ) + 1;
// -- Get the item
oItem = GetFirstItemInInventory ( oStore );

for( nSelected = 1 ; nSelected < nRand ; nSelected++ )
{
oItem = GetNextItemInInventory ( oStore );
}
// -- Grab item template
if (oItem != OBJECT_INVALID)
{
sTemplate = GetResRef( oItem );
}

// -- Checks to see if this it is a ammo or thrown item and creates more in the stack

string sRoot = GetStringLowerCase ( GetSubString( sTemplate , 0 , 6 ) );

if( sRoot == "nw_wam" || sRoot == "nw_wth" )
{
nStack = Random( 30 ) + 1;
}
else
// -- Check if the item is Gold, and creates more in Stack
// small amount generated : gold placement should maybe be handled in some other way.

if( GetStringLowerCase ( sTemplate ) == "nw_it_gold001" )
nStack = Random( 30 ) + 5;

else
if( nStack < 1 )
nStack = 1;

// -- create the item on oSpawned
oItem = CreateItemOnObject ( sTemplate , oSpawned , nStack );

// -- decerement the Item Amount counter
nAmount--;
}
}



Do you see any issues with this? Any comments? Is there an easier way to do it?

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Wed Mar 10, 2010 11:24 pm 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
Ignore the %s. I'm just using those for fillers now.

I like it because later on, I can call to another merchant, like #78, say, and make adjustments, like taking out the weaker scrolls and pots, adding in higher priced mundane goods like jeweled scabbards or something. Or make scripts specifically for bosses.

Hmmm, actually, I think I could make a call to the creatures tag even, which would control the loot merchant. Similar to an onrest script I use. But only for unique situations.

Also, the stack size and gold amount portions could be deleted, as I they won't be used. I use RG to generate gold, and if I were to put in stackable items with more than one item in the stack, I would just adjust the stack size in the pallette.

But it seems bloated. Since I'm clueless about scripting, my scripts tend be... bloated. Am I missing something?

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Wed Mar 10, 2010 11:29 pm 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
I suppose I could make the initial script check be something like:
if Loot flag is <200

Then do the random generator, up to about 95, and then do:

If nRandom >94

If Loot_ is 78
If nRandom ==95, do THIS, etc.

I dunno. Just looking for some general feedback ideas. My loot merchants are way too big.

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Thu Mar 11, 2010 3:24 am 
Offline
Arakan Scribe
Arakan Scribe
User avatar

Joined: Mon Feb 16, 2009 8:48 pm
Posts: 471
I think 3T uses a similiar if not the exact same system.

Depending on the random number you get a certain amount of gold and higher random number will add an item from another merchant to the loot bag. I'm guessing those merchants are what people refer to a tiers around here.

I read through your script and I think I understand it fairly well. Although I have 0 toolset experience.

The problem seems to be that you cannot add more rare items to a vendor as that means you need to add more not so good items. Correct?

If thats the case then why not add all the items you want to be rare to another merchant and use something like
Code:
if(nRandom + nCR <= % || => %)
//where  % are two different numbers of your choice.

{
pick from rare vendor with the sweet stuff!
}

If the total adds up to between x and y pick an item from the rare table. This could ensure that the rare stuff only drop from high cr monsters if you use the right numbers. For instance if the max CR is 50 and you pick the numbers 146 and 150 the chance would be 1% from from a CR 46 monster as you'd need nRandom to be 100. If the monster is CR 47 2% and so on.

_________________
Nex Umbra


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Thu Mar 11, 2010 12:38 pm 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
Quote:
The problem seems to be that you cannot add more rare items to a vendor as that means you need to add more not so good items. Correct?


That is right on the money, yes. Unfortunately, I'm too darn stupid to make sense of the script you posted.
:o

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Thu Mar 11, 2010 4:49 pm 
Offline
Arakan Scribe
Arakan Scribe
User avatar

Joined: Mon Feb 16, 2009 8:48 pm
Posts: 471
Ok like I said I'm not familiar at all with the NWN toolset synthax.

But maybe you can make sense of it if I break it down to you :)

if(nRandom + nCR <= % || => %)

If, well that's the condition obviously.

nRandom is the random integer you generate with the d100

nCR is the oSpawn monster CR.

<= means greater than or equal to
=> means less than or equal to
|| is boolean "or"
% and this is just something I put in there. This should be replaced by numbers as in my example.

So my example would spell out something like

if(nRandom + nCR <= 146 || => 50)

if d100 + monster cr is higher or equal to 146 and lesser or equal to 150 then and so forth->

I realize this is not an actual script, you would have to rewrite it for the toolset synthax, and I'm possitive Dirion or Chreelister can help you with that. Note that I haven't done any programming in a very long time.

_________________
Nex Umbra


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Thu Mar 11, 2010 5:14 pm 
Offline
Fer Apprentice
Fer Apprentice

Joined: Thu Nov 04, 2004 2:43 pm
Posts: 907
Location: USA
1. test <= 50.
2. test >= 50.

<= is less then or equal to.
>= is greater then or equal to.

Remembering back to my middle school math teacher (that takes me back...), if the aligator's mouth is open, it is greater... if it is closed, it is lesser. :D
Thus.
1. test is less then or equal to 50.
2. test is greater then or equal to 50.

_________________
It's time for a new sig, don't you think?


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Thu Mar 11, 2010 7:11 pm 
Offline
Developer
Developer
User avatar

Joined: Fri Jul 16, 2004 10:08 am
Posts: 421
The way I used it was this.....

Put this tag on all spawn points you want to give out loot..."DT001" or any unused number
This runs a custom on death script.

In the script spawn_sc_death, you have to define the number, can't remember exactly how it was , but if number equals 1 or whatever you set the DT number to be, then do this sort of thing, that is where the ExecuteScript("chree_tres_gen", OBJECT_SELF); line is.

Then I made a script named chree_tres_gen and have it get the CR of creature killed, add a bunch of random numbers, very very similar to the way mentioned above and this determines what category or tier you get. Then I have another random number determine what exact item gets dropped on the creature and its the CreateItemOnObject function that is used to do this.

This gives you total control of loot and works awesomely with NESS. You can then set % chance of loot dropping, how rare each item is, % chance of gold, how much, etc., % chance of scrolls, potions, scrap, etc.

Takes forever to put the resrefs in the right tiers though.


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Thu Mar 11, 2010 11:58 pm 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
Okay, some good stuff here, thanks guys.

The || I had no idea about. I guessed 'or,' but a guess is a guess. Thanks for clarifying.

Chree, I didn't realize you could use ondeath. I thought the loot had to spawn on the creature before it died. Ondeath would be great. No more mobs using pots I don't want them to use.

Quote:
Takes forever to put the resrefs in the right tiers though.


This is why I like the loot merchants. No resref hassles. I am thinking the solution is to use the ondeath script, but calling to the loot merchants. Okay, I'm going to tinker with this.

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Fri Mar 12, 2010 4:18 am 
Offline
Fer Apprentice
Fer Apprentice

Joined: Fri Jul 16, 2004 3:14 pm
Posts: 818
Location: Other side of halfway there
Well, my script didn't work.

But I came up with a new one. Only about 4 lines, and it works fine. Much more efficient.
:lol:

_________________
I'm just here as a volunteer.
---------------------
Wor Lass (in dragon shape): "Fear me mortals... crap, I'm stuck."


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Fri Mar 12, 2010 5:46 am 
Offline
Developer
Developer
User avatar

Joined: Fri Jul 16, 2004 10:08 am
Posts: 421
1 pro or con, depending on how you see it, on putting it on death is you can't PP the item off the creature, because the loot doesn't exist until the creature dies. But I do believe you can put it on spawn of the creature, but I have never tried it that way.


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Sun Mar 14, 2010 6:44 am 
Offline
Developer
Developer

Joined: Tue Aug 31, 2004 6:41 pm
Posts: 10012
Location: England
|| is an or marker but when you use || if the first statement is TRUE then the second statement will not be tested and the optional statements will run

&& is similar but if the first test is false , subsequent tests will not apply and the optional statement will not run.

these reduce the number of logical tests the engine needs to apply.

3T does not use this loot system or anything like it.

my recomendation would be to have 2 merchants for each level one for mundane and one for rare and then when loot is generated just have a small chance of picking the rare merchant, and a small chance of picking the next higher mundane merchant.

_________________
36 quickslots is just not enough


Top
 Profile  
 
 Post subject: Re: Anyone familiear with NESS?
PostPosted: Sun Mar 14, 2010 2:13 pm 
Offline
Arakan Scribe
Arakan Scribe
User avatar

Joined: Mon Feb 16, 2009 8:48 pm
Posts: 471
Dirion Scrab wrote:
3T does not use this loot system or anything like it.



tbh I'd rather not know what system the module uses, more exciting that way. I suspect you wouldn't spill the beans even if someone asks either.

_________________
Nex Umbra


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
mergenine: orange