Author Topic: NESS Spawn System Question?  (Read 559 times)

Legacy_Tonden_Ockay

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +0/-0
NESS Spawn System Question?
« on: June 09, 2015, 08:06:13 pm »


               

Hey all


 


 I have some questions about NESS (Neshkes Extendable Spawning System (NESS)). I have looked over a wiki page and some other sites trying to learn what all NESS can do. However I can’t seem to find any info on how to set up an encounter that would randomly spawn 1 creature from a list of different creatures.


 


 


Does anyone know how to do this? If so could you explain what all I would need to do?


               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #1 on: June 09, 2015, 08:41:06 pm »


               

It's not very obvious. It's all done through group lists with the SG part of the tag. What you have to do is edit the 'spawn_cfg_group' script. There are two sections. One is for scaled, and the other for non-scaled groups.


 


Here is an excerpt from my own in Avernostra



if (sGroupType == "oldeden")
  {
    switch (nCR)
    {
    case 1:
        switch(d3(1))
      {
        case 1: sRetTemplate = "nw_goblina"; break;
        case 2: sRetTemplate = "nw_goblinb"; break;
        case 3: sRetTemplate = "nw_wolf"; break;
      }
      break;
    case 2:
        switch(d10(1))
      {
        case 1: sRetTemplate = "nw_shadow"; break;
        case 2: sRetTemplate = "nw_allip"; break;
        case 4: sRetTemplate = "nw_krenshar"; break;
        case 5: sRetTemplate = "q1_vbat"; break;
        case 6: sRetTemplate = "cobra"; break;
        case 7: sRetTemplate = "nw_boar"; break;
        case 8: sRetTemplate = "nw_bearblck"; break;
        case 9: sRetTemplate = "q1_gntant001"; break;
        case 10: sRetTemplate = "q1_vbat"; break;
      }
      break;
    case 3:
        switch(d12(1))
      {
        case 1: sRetTemplate = "werewolf_man001"; break;
        case 2: sRetTemplate = "nw_spidgiant"; break;
        case 3: sRetTemplate = "q2_ogrea"; break;
        case 4: sRetTemplate = "q2_ogreb"; break;
        case 5: sRetTemplate = "nw_aranea"; break;
        case 6: sRetTemplate = "nw_gobchiefa"; break;
        case 7: sRetTemplate = "nw_gobchiefb"; break;
        case 8: sRetTemplate = "nw_gobwiza"; break;
        case 9: sRetTemplate = "nw_gobwizb"; break;
        case 10: sRetTemplate = "nw_worg"; break;
        case 11: sRetTemplate = "q1_gntwsp"; break;
        case 12: sRetTemplate = "nw_worg"; break;
      }
      break;
    case 4:
      switch(1)
      {
        case 1: sRetTemplate = "nw_spidwra"; break;
      }
      break;
    case 5:
      switch(d4(1))
      {
        case 1: sRetTemplate = "nw_direwolf"; break;
        case 2: sRetTemplate = "q2_displacerbst"; break;
        case 3: sRetTemplate = "q1_rustmonster"; break;
        case 4: sRetTemplate = "nw_wolfwint"; break;

      }
       break;
    case 6:
      switch(d2(1))
      {
        case 1: sRetTemplate = "nw_bearkodiak"; break;
        case 2: sRetTemplate = "nw_bearbrwn"; break;
      }
       break;
    case 7:
       switch(d3(1))
      {
        case 1: sRetTemplate = "nw_spectre"; break;
        case 2: sRetTemplate = "nw_shfiend"; break;
        case 3: sRetTemplate = "nw_grayrend"; break;
      }
      break;
    default:
       sRetTemplate = "nw_wolf";
       break;
    }  }


That's the scaled one. Notice that it requires you to add a separate group for each CR you want to spawn from.



    // Old Eden - Daytime
    if (sTemplate == "oldedenday")
    {
        switch(d20(1))
        {
            case 1: sRetTemplate = "deer001";        break;
            case 2: sRetTemplate = "deer002";        break;
            case 3: sRetTemplate = "ox";             break;
            case 4: sRetTemplate = "eagle";          break;
            case 5: sRetTemplate = "jaguar";         break;
            case 6: sRetTemplate = "deer006";        break;
            case 7: sRetTemplate = "qc_bird_crow_f"; break;
            case 8: sRetTemplate = "q1_boar001";     break;
            case 9: sRetTemplate = "q1_boar002";     break;
           case 10: sRetTemplate = "q1_moose001";    break;
           case 11: sRetTemplate = "q1_moose002";    break;
           case 12: sRetTemplate = "brownbear";      break;
           case 13: sRetTemplate = "blackbear";      break;
           case 14: sRetTemplate = "q1_snowowl";     break;
           case 15: sRetTemplate = "deer002";        break;
           case 16: sRetTemplate = "deer003";        break;
           case 17: sRetTemplate = "deer004";        break;
           case 18: sRetTemplate = "deer005";        break;
           case 19: sRetTemplate = "jaguar";         break;
           case 20: sRetTemplate = "q1_boar001";     break;
        }
    }

That is an example from the non-scaled group. For my sake I spawn non-scaled non-hostile encounters during the day, and scaled hostile encounters during the night.


 


For the waypoint tag you will need to add SG, for Spawn Group to the name, and then add the sTemplate string you use to the Tag of the waypoint. For example I use the following for commoners:


 


Name: SP_SS002_SD10_PC05_SG_CD240


Tag: commoner


 


SP is for spawn point, SS002 is to fire the number 2 script from 'spawn_sc_spawn' on spawn, SD10 is a 10 minute despawn delay when PC is gone, PC05 makes it so that they only spawn when PC is within five meters, SG is to designate the tag as a spawn group rather than a single spawn which is commoner that holds all the various commoner spawns, and CD240 is a 240 second corpse delay.


 



               
               

               
            

Legacy_Tonden_Ockay

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #2 on: June 09, 2015, 09:21:07 pm »


               

Thanks a lot " The Mad Poet "


 


 


Now I know just enough about scripting in NWN to really jack some stuff up  '<img'>. That said I want to learn how to do this. so do will I need to make a new scripts for each list?


 


For example to make it easy, lets say I want to have 3 different waypoints. One would randomly spawn a creatures from a list of CR1 creatures. The second will randomly spawn one creature from a list of CR2 creatures. Then the third would randomly spawn CR3 creatures. Would I need to make 3 scripts? If so is there a naming system I need to follow? What script would I need to tie them into?


 


Oh and it looks like I would have to make lists that follow the dice system d4, d6, d8, d10, d12, d20, and d100. Right?


 


Ah I just seen you used d2 and d3. So I am guessing that you just put d in front of the number of creatures in your list and it could be any number of creatures?


 


I used to use the ASG spawn system but I want to do more then it will allow at this point and the NESS system sounds like it could do just about anything. Which is why I would like to learn how to use it.


 


I did just download the NESS scripts and the NESS Generator.


 


 


Looking more at your scripts it looks like case 2 is your day encounters. So that said would I make all my encounter list in this one script and just name them case 1, case 2, case 3, and so on? Now that I think about it this would make more sense.


 


I think I am slowly catching on. Well I hope so any way. 



               
               

               
            

Legacy_Tonden_Ockay

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #3 on: June 09, 2015, 09:35:09 pm »


               

Ok so what does the case numbers stand for in spawn_cfg_group ?  I am asking because I see that you can have a set of case numbers for each group like say outside, cave, dungeon, cities, and so on. 






               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #4 on: June 09, 2015, 10:02:52 pm »


               

Now I know just enough about scripting in NWN to really jack some stuff up   '<img'>. That said I want to learn how to do this. so do will I need to make a new scripts for each list?

 


Nope. You should be able to add them to the spawn_cfg_group script as new switch statements.


 


For example to make it easy, lets say I want to have 3 different waypoints. One would randomly spawn a creatures from a list of CR1 creatures. The second will randomly spawn one creature from a list of CR2 creatures. Then the third would randomly spawn CR3 creatures. Would I need to make 3 scripts? If so is there a naming system I need to follow? What script would I need to tie them into?


 


Since each waypoint only has a creature of a single set of CR there is no need to scale them. You could create non-scaled groups with a basic case statement. Example:



if (sTemplate == "examplecr1")
    {
        switch(d4(1))
        {
            case 1: sRetTemplate = "resref1";        break;
            case 2: sRetTemplate = "resref2";        break;
            case 3: sRetTemplate = "resref3";        break;
            case 4: sRetTemplate = "resref4";        break;
        }
    }

if (sTemplate == "examplecr2")
    {
        switch(d4(1))
        {
            case 1: sRetTemplate = "resref5";        break;
            case 2: sRetTemplate = "resref6";        break;
            case 3: sRetTemplate = "resref7";        break;
            case 4: sRetTemplate = "resref8";        break;
        }
    }

if (sTemplate == "examplecr3")
    {
        switch(Random(4)+1)
        {
            case 1: sRetTemplate = "resref9";         break;
            case 2: sRetTemplate = "resref10";        break;
            case 3: sRetTemplate = "resref11";        break;
            case 4: sRetTemplate = "resref12";        break;
        }
    }

Oh and it looks like I would have to make lists that follow the dice system d4, d6, d8, d10, d12, d20, and d100. Right?


 


Not at all. That is just how I did it for those examples. You could use the Random() function as well. I put an example in the previous script paste.


 


Ah I just seen you used d2 and d3. So I am guessing that you just put d in front of the number of creatures in your list and it could be any number of creatures?


 


There are several d functions. Like d2, d3, d4, d6, d8, d10, d12, d20, d100... they're convenient but they don't cover every number. Random() should be used instead if you don't have an exact match. Honestly you could just use Random(), I use the d4(1) instead of Random(4)+1 just for my own convenience.


 


I used to use the ASG spawn system but I want to do more then it will allow at this point and the NESS system sounds like it could do just about anything. Which is why I would like to learn how to use it.


 


It does quite a bit. There is a little program that is a big help. It's called the Spawn Waypoint Generator. Very useful.


 


Ok so what does the case numbers stand for in spawn_cfg_group ?  I am asking because I see that you can have a set of case numbers for each group like say outside, cave, dungeon, cities, and so on. 


 


You might want to look up some information on the switch/case statements. HERE is a link to the lexicon for some help. It's easier to look at the non-scaled example. That is just one switch. The 'Switch' is a d20 in that example. A random number selected between 1 and 20. The 'Case' is what number comes up. So if it randomly selects a 4 it will select the resref 'eagle'.


 


The scaled encounters are a little more tricky. It's actually several switch/case statements nested inside of one another. The first switch is nCR, which is called earlier in the spawn_cfg_group script as the avg party level I think. So for a 5th level character it would be five. Then each separate case of nCR, or each CR group for those who speak english and not matrix code, has its own switch case statement like the non-scaled one where it just picks one from a group based on a random number.


 


In all two checks are made. One to determine party level, and then once it has party level it picks from a random list inside of that CR.


 


You can set sTemplate, or the string that determines what list is used, to any valid string. I use descriptive ones that are easy to remember. Like 'catacombs_easy', or 'oldedenday', or even 'cannibal_01'.


 


Hope I made that clear.


               
               

               
            

Legacy_Tonden_Ockay

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #5 on: June 09, 2015, 11:04:04 pm »


               

I see that you put a 1 or a +1 after the number on random, why is this?


if (sTemplate == "examplecr2")
{
switch(d4(1))
{
case 1: sRetTemplate = "resref5"; break;
case 2: sRetTemplate = "resref6"; break;
case 3: sRetTemplate = "resref7"; break;
case 4: sRetTemplate = "resref8"; break;
}
}

if (sTemplate == "examplecr3")
{
switch(Random(4)+1)
{
case 1: sRetTemplate = "resref9"; break;
case 2: sRetTemplate = "resref10"; break;
case 3: sRetTemplate = "resref11"; break;
case 4: sRetTemplate = "resref12"; break;
}
}


 


Ok so first of all are you telling me that this system can scale an encounter based off of a player characters level?


 


Example: a level 1 PC walks into an area so the waypoint spawns a CR1 creature. While at the same time if a level 10 PC walks in to the same area that same waypoint would spawn say ten CR1 creatures? Oh and it can take the whole level of the party and scale up even more?


 


If this works like this man I will love this system woooohoooo '<img'> . 


               
               

               
            

Legacy_Tchos

  • Sr. Member
  • ****
  • Posts: 454
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #6 on: June 09, 2015, 11:35:01 pm »


               


I see that you put a 1 or a +1 after the number on random, why is this?




 


Because the Random function starts at 0, whereas the dice functions start at 1.



               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #7 on: June 09, 2015, 11:45:39 pm »


               

I see that you put a 1 or a +1 after the number on random, why is this?


 


Because Random(int) pulls a random number between 0 and int-1. Essentially to get a random number between 1-10 you would write Random(10) +1;   If you just write Random(10) it actually pulls between 0-9.


 


 


Ok so first of all are you telling me that this system can scale an encounter based off of a player characters level?


 


Yep. That's what the scaled encounter group is for.


 


 


Example: a level 1 PC walks into an area so the waypoint spawns a CR1 creature. While at the same time if a level 10 PC walks in to the same area that same waypoint would spawn say ten CR1 creatures? Oh and it can take the whole level of the party and scale up even more?


 


It works more like a level 1 PC walks into an area so the waypoints spawns a CR1 creature. If a level 10 PC walks into the same area it spawns a CR10 creature.


 


You can control the number of creature spawns through the SN flag. So if you want 3 I think your use SN003 or something similar. Been awhile since I've written tags. The waypoint generator can help.


 


I've been using NESS awhile, but I haven't played with EVERY flag and combo. I'm not sure if there is a way to scale the number of creatures that spawn directly or not. If there is and someone knows a way please let me know. 


 


And yes, it does take the whole party into account by the HitDice of each individual party member. So lets say you have a level 5, and a level 10 PC, with 5 HD and 10 HD respectively. It averages them out. So 5+10=15, 15/2 = 7.5.


 


Just remember when you write your waypoint tag that you have to write 'scaled_' as a prefix. So for the example above it would be 'scaled_oldeden'. That tells NESS to scale the encounter correctly.


               
               

               
            

Legacy_Tonden_Ockay

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #8 on: June 10, 2015, 12:02:07 am »


               

WoW I love what your telling me. Now I just need to play around with it and learn how to use it.


 


Thanks a lot for all the insight " The Mad Poet " and thanks to you as well " Tchos "


               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #9 on: June 10, 2015, 01:39:03 am »


               

You might find this useful. It walks you through a lot of what NESS can do. 



               
               

               
            

Legacy_The Mad Poet

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #10 on: June 10, 2015, 02:32:49 am »


               

I've been missing that document for a year. Thanks for linking it.



               
               

               
            

Legacy_Tonden_Ockay

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +0/-0
NESS Spawn System Question?
« Reply #11 on: June 10, 2015, 05:17:06 am »


               

Thanks " Meaglyn " and The Mad Poet "