Author Topic: Spawn Triggers and Waypoints  (Read 382 times)

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Spawn Triggers and Waypoints
« on: May 17, 2012, 10:56:38 pm »


                Im pretty sure this has been asked before, but here it goes.
 to make this simple:
1.I have a simple wide area, i want to pupulate it with monsters with out making like 50 trigger spots.
 My question leads to how can i make one trigger spot, create Several different Waypoints, and connect it with the trigger. So that when the player steps on the trigger, all the monsters spawn at the set waypoints in the area.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Spawn Triggers and Waypoints
« Reply #1 on: May 18, 2012, 02:27:19 am »


               The on enter of the trigger needs to be a script that creates all of the monsters. The locations of the monsters will be the waypoints. You will need to come up with a means for the script to get the locations of the waypoints, and use those locations in their respective CreateObject methods which you call in the script. FindWaypointByTag is a good method to get the waypoints, then get the location of each waypoint.

You can then come up with a naming convention for your tags. Set the tag names as Local Strings on the trigger. The script on the trigger can then do the following

string sGoblinTag  = GetLocalString(OBJECT_SELF, "TAG_NAME_1");

I haven't spelled out exactly how to do this, but you should have a grasp of the basic strategy. Let us know if you have more specific questions.
               
               

               


                     Modifié par henesua, 18 mai 2012 - 01:29 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Spawn Triggers and Waypoints
« Reply #2 on: May 18, 2012, 08:48:16 am »


               Other knowledge that would be helpful to know:

-Will they all be the same or different monsters at the different waypoints?
-Is it just one monster per waypoint, multiple, random?
               
               

               
            

Legacy_Omega27

  • Sr. Member
  • ****
  • Posts: 255
  • Karma: +0/-0
Spawn Triggers and Waypoints
« Reply #3 on: May 18, 2012, 02:48:14 pm »


               thanks Henesua ill get back to you on how this works out. Gonna play around a bit.

@Ghost, it'll be the same monsters, and multiple per waypoint, like
waypoint1 would spawn a total of five 5 gobs
               
               

               
            

Legacy_AndarianTD

  • Hero Member
  • *****
  • Posts: 725
  • Karma: +0/-0
Spawn Triggers and Waypoints
« Reply #4 on: May 19, 2012, 01:21:25 am »


               You could create a single trigger and set out multiple spawn points, but that'll get you at the most about 8 creatures from each. If you want to really fill an area, you'll need to do it via a script triggered by a trigger. And once you go down that road, I'm not sure there's much advantage to doing it via an encounter vs. a regular trigger, but you could do either.

One way I've found to automate this kind of thing (as long as your area doesn't have too much in it) is to use a single script driven by variables. For example: write a script that reads the name of a string variable on OBJECT_SELF, which contains the name of another variable (say, an int). Write the script to look for objects in the area that have that variable on them set to TRUE. You can use one of the area restricted iterators like GetNearestObject. For each object it iterates over, if it finds your variable set to true, spawn a creature at that object's location. Have the script read the resref of the creature you want to spawn from the trigger as well, and you can end up using that one script multiple times for different uses -- setting up different variables and different waypoints to trigger different monsters in different locations.