Aller au contenu

Photo

Spawning groups of NPC's or making a prefab and spawning that.


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
Friar

Friar
  • Members
  • 293 messages
I am trying to create it to where when I go inside an area, go to sleep, recieve a certain quest, and go back outside there is a wagon with gypsies nearby.

I thought it would be nice if I could just place the wagon, camp, and two gypsies the way I want it them I could group them and make a prefab. Then I could erase them, place a wp and then spawn them when the pc enters the area.

It turns out it isn't that easy. :mellow:

#2
_Knightmare_

_Knightmare_
  • Members
  • 643 messages
Don't think you can spawn in an entire prefab. you'd need to spawn in the individual components. When I need a placeable to spawn in at a specific location and facing I first place it down in the toolset and set it just how I want it to look (location, facing). Then put down a waypoint, copy over the placeable's location and facing to the WP, delete the placeable. When you spawn in the placeable via script at the waypoint, it will use the placeable's location and facing. Make sure the placeable has collision turned on so the player and NPCs can't walk through it (since the area walkmesh still considers it a valid walking zone). It can be tricky if you have lots of placeables to spawn (which means lots of WPs), but it works. You can spawn the NPCs in a similar way or have them as an Encounter Trigger that gets fired off.

Modifié par _Knightmare_, 12 septembre 2010 - 02:41 .