Spawner and Procedural Generation

Announcements, support questions, and discussion for Quest Machine.
Post Reply
parnell
Posts: 3
Joined: Wed Mar 02, 2022 7:29 pm

Spawner and Procedural Generation

Post by parnell »

I'm having 2 issues with the spawner script:

1)I'm trying to setup a bunch of quest givers with the same quest to be placed randomly on a procedurally created terrain. For example, go to X object and come back. X object should spawn only for the guest giver I trigger. The good news is the object does spawn. However, I'm noticing that if I go to 1 of the guest givers the spawn item is duplicated for all quest givers in the world. Is it possible to have multiple quest givers have the same quest assigned to them and understand that when they are triggered to spawn something it would be unique to them?

2)The spawner script doesn't spawn the enemies or objects to adjust to a 3D terrain that has height. It seems to set and place whatever is spawned at the height the spawner object is set at.

Thanks!
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawner and Procedural Generation

Post by Tony Li »

Hi,
parnell wrote: Wed Mar 02, 2022 9:02 pm1)I'm trying to setup a bunch of quest givers with the same quest to be placed randomly on a procedurally created terrain. For example, go to X object and come back. X object should spawn only for the guest giver I trigger. The good news is the object does spawn. However, I'm noticing that if I go to 1 of the guest givers the spawn item is duplicated for all quest givers in the world. Is it possible to have multiple quest givers have the same quest assigned to them and understand that when they are triggered to spawn something it would be unique to them?
You'll need to assign different quests that use different spawners, or write a subclass of Spawner or your own spawning code to handle it differently.
parnell wrote: Wed Mar 02, 2022 9:02 pm2)The spawner script doesn't spawn the enemies or objects to adjust to a 3D terrain that has height. It seems to set and place whatever is spawned at the height the spawner object is set at.
You can also set spawnpoints for the spawner instead of a radius from the spawner object. If you're procedurally generating terrain, you'll need to update those spawnpoints after generating the terrain.

Alternatively, you could add a script to your spawnable object that does a raycast down from the sky and places the object where it intersects the ground.
Post Reply