Author Topic: Random Encounters  (Read 240 times)

Legacy_JerrodAmolyan

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Random Encounters
« on: July 10, 2013, 09:49:13 pm »


                Ok, here's the deal. I have a "sort of" random encounter script that can be modified and put into triggers that you can then paint around where ever you want. 

But I think there could be SO much better solutions for that. 
This is very good if you want to have your custom monsters only in your encounters, and don't want them to scale (I hate level scaling. There's always the "run away" option, if you spawn an epic monster at level 1 '<img'>)

Folks got anything better than this? :


// Put this script OnEnter.


void main()
{

    object oTarget;
    object oSpawn;


    // Get the creature who triggered this event.   
       object oPC = GetEnteringObject();

    // Only fire for (real) PCs.   
       if ( !GetIsPC(oPC)  ||  GetIsDMPossessed(oPC) )       
             return;
    // If the local int is exactly 0.   
       if ( GetLocalInt(OBJECT_SELF, "nIsUsed") == 0 )   
{            
    // Set a local integer.       
       SetLocalInt(OBJECT_SELF, "nIsUsed", 1);
    // Set a local integer.       
       DelayCommand(1800.0, SetLocalInt(OBJECT_SELF, "nIsUsed", 0));       
    // Decide what to do based on a die roll.       
      switch ( d100() )     
  {           
     case 100:           
{               
     // Spawn "Epic Monster".               
    oTarget = GetNearestObjectByTag("your custom waypoint tag here"); 
    oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget)); 
     } break;       
     
      case 96:       
      case 97:       
      case 98:       
      case 99:       
{           
     // Spawn "Great Monster. "          
     oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
     oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
      } break;       
case 88:       
case 89:       
case 90:       
case 91:       
case 92:       
case 93:       
case 94:       
case 95:       
{           
// Spawn Smaller Monster.           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       

case 75:       
case 76:       
case 81:       
case 82:       
case 83:       
case 85:       
case 87:       
{           
// Spawn some critters.
           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");                     
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;
       
case 79:       
case 80:       
case 84:       
case 86:       
{           
// Spawn some critters.
           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget)); 

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 71:       
case 72:       
case 73:       
case 74:       
case 77:       
case 78:       
{           
// Spawn some critters.
           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetWaypointByTag("your custom waypoint tag here");            
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 66:       
case 67:       
case 68:       
case 69:       
case 70:       
{           
// Spawn some critters.
           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 58:       
case 59:       
case 60:       
case 61:       
case 62:       
case 63:       
case 64:       
case 65:       
{           
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 50:       
case 51:       
case 52:       
case 53:       
case 54:       
case 55:       
case 56:       
case 57:       
{           
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 42:       
case 43:       
case 44:       
case 45:       
case 46:       
case 47:       
case 48:       
case 49:       
{           
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 35:       
case 36:       
case 37:       
case 38:       
case 39:       
case 40:       
case 41:       
{           
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 26:       
case 27:       
case 28:       
case 29:       
case 30:       
case 31:       
case 32:       
case 33:       
case 34:       
{           
// Spawn some critters.            
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 17:       
case 18:       
case 19:       
case 20:       
case 21:       
case 22:       
case 23:       
case 24:       
case 25:       
{           
// Spawn some critters.           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));       
} break;       
case 2:       
case 3:       
case 4:       
case 5:       
case 6:       
case 7:       
case 8:       
case 9:       
case 10:       
case 11:       
case 12:       
case 13:       
case 14:       
case 15:       
case 16:       
{           
// Spawn some critters.
           
oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));

oTarget = GetNearestObjectByTag("your custom waypoint tag here");           
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));           
}       
}
}
}



Basicly, you should be able to make every case spawn something, and those cases that I have set to spawn, can contain more than 1 - 3 different waypoints (All must have unique tag) This is something simple that I like in my module, but I'm looking for something more complicated than this. Anyone feel free to share ideas, or if you are looking for a simple random encounter script, feel free to grab this if you like it.
               
               

               


                     Modifié par JerrodAmolyan, 10 juillet 2013 - 09:10 .
                     
                  


            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Random Encounters
« Reply #1 on: July 13, 2013, 12:58:39 am »


                I did this one a while ago:
http://nwvault.ign.c....Detail&id=3318 
               
               

               
            

Legacy_JerrodAmolyan

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Random Encounters
« Reply #2 on: July 13, 2013, 09:43:25 am »


               That's a good looking system and I might find use for it on my main project for sure '<img'>. It's sadly not quite what I'm looking for for my current project. I'm trying to create something that rolls random monsters regardless of anything else than a randomness roll. I know Kalbaern has something similar on his module, and I absolutely love it, but what I'm trying to do, is create a similar randomness without scaling according to level. The randomness should decide which of my custom monsters it spawns.

Of course, this random spawn is mainly used for wilderness areas, dungeons have the regular spawns in addition to this. Heh, like to keep players nervous '<img'> Adds the ingredients to what we call "an adventure".
               
               

               
            

Legacy_CaveGnome

  • Sr. Member
  • ****
  • Posts: 432
  • Karma: +0/-0
Random Encounters
« Reply #3 on: July 13, 2013, 04:28:48 pm »


               One of various encounter spawn systems on the vault, the ness system (used in Vuldricks universal module):

nwvault.ign.com/View.php
www.lrjonline.net/swg/ness.html
               
               

               


                     Modifié par CaveGnome, 13 juillet 2013 - 03:30 .
                     
                  


            

Legacy_JerrodAmolyan

  • Full Member
  • ***
  • Posts: 175
  • Karma: +0/-0
Random Encounters
« Reply #4 on: July 13, 2013, 07:18:24 pm »


               I would have used NESS long ago, if it didn't seem like such an intimidating task to learn how to use it, heh. Maybe I should take up on learning that. '<img'> It just looks very complicated.
               
               

               
            

Legacy_kalbaern

  • Hero Member
  • *****
  • Posts: 1531
  • Karma: +0/-0
Random Encounters
« Reply #5 on: July 16, 2013, 04:19:32 pm »


               

JerrodAmolyan wrote...

That's a good looking system and I might find use for it on my main project for sure '<img'>. It's sadly not quite what I'm looking for for my current project. I'm trying to create something that rolls random monsters regardless of anything else than a randomness roll. I know Kalbaern has something similar on his module, and I absolutely love it, but what I'm trying to do, is create a similar randomness without scaling according to level. The randomness should decide which of my custom monsters it spawns.

Of course, this random spawn is mainly used for wilderness areas, dungeons have the regular spawns in addition to this. Heh, like to keep players nervous '<img'> Adds the ingredients to what we call "an adventure".


You can just send me a PM over on my forums and I'd be glad to get you started with a template. I actually use both scaling and non-scaling encounters in my many flavors of encounter scripts.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Random Encounters
« Reply #6 on: July 16, 2013, 04:58:06 pm »


               Yes, I knew it was not quite what you were looking for as it scales.  I just thought the structure and approach might be of value to you.  I used NESS in second god war and found it useful though overly complex, at least in the sense that you had to learn the system, (codes) which I did.  There was one by Aman Shader too, on the vault.  Btw if you notice in the demo the same monsters spawn not matter what level you are.  I just did it that way since I did not want to create gobs of special creatures for the demo.  It just spawns random monsters no matter what level you are.  Then later the player could add their own creatures.  Just thought I would point that out.