SWG-Source / dsrc

Other
11 stars 49 forks source link

clone relics doing your duty, phase 2 #301

Closed ladybogit closed 3 years ago

ladybogit commented 3 years ago

npc's spawn unhittable here and under the star port when you trigger the spawn event (infount of the bunker door) unknown (5) i had to restart the quest 4 times to do the quest using this command /gmregrantquest <quest/code_string> Mission info: https://swg.fandom.com/wiki/Doing_Your_Duty

AconiteX commented 3 years ago

I've pushed some experimental changes for this which should fix this about 90% of the time (as this impacts many spawn circumstances) but ultimately this is a problem related to collision and how it is evaluated more than anything else which is a bigger picture issue (and it was an issue on live, as noted in the wiki article you linked).

Changes:

  1. getRandom2DLocationAroundLocation() now uses a while loop so it will try 100 times instead of 4 to find a suitable spawning location.
  2. isValidQuestSpawnPoint() which is used by getRandom2DLocationAroundLocation() now checks if there is a building located at the spawn point, which should prevent spawns from getting placed where they would be unreachable (e.g. behind the walls of a building but not actually in a building).
  3. Specific to the encounter type of quest task, I added a height check so if a spawn ends up on top of some random object like in this case, it should destroy it and try again.
  4. There's now a failover if finding a suitable spawn location at the requested distance doesn't work, in which case it'll spawn the spawns around your character.

I tested this a few hundred different ways and it seems to be working as intended but there are a lot of cases where this is used that I may not have caught. If anything starts spawning weird/broken/stuck, let me know. Just keep flagging these as there may be a few cases where this solution won't work and we'll need to carve out some custom rules or adjust what I implemented. Thank you!!

For reference, below are examples of the collision issues I've mentioned so you can visualize them:

image