ArcanePariah / Night-of-the-Dead

10 stars 14 forks source link

Enemy spawning errors fix #174

Closed NiktosNOTD closed 6 years ago

NiktosNOTD commented 6 years ago

PATCHNOTES: -Survival wave 10 eilythia now correctly transforms into queen if left alive (Niktos) -Survival enemies no longer can spawn directly on top of team (Niktos) -SEC apopteosis no longer can spawn directly on top of team (Niktos) -Removed various errors related to spawning of enemies in all storylines (Niktos)

This pull does: 1.Fix some errors caused by enemies failing to spawn if their spawn point is incorrect. 2.Fix errors caused by already dead enemies being issued orders or being modified. 3.Improve readability of code by moving spawning of enemies with behaviors to a function. 4.Put survival in line with other storylines in terms of unfair deaths/loss of dsm when enemies could spawn on top of team. Only survival had such problems.

Full list of changes:

**SURV:**
1.Added SmartSpawnWithBehaviorNOTD, and replaced spawning units on the spot with it where applicable for surv to unclutter the code a bit and improve readability.
Notable sideffects of the above:
- wave 4 huggers no longer ping minimap on spot of spawning
- wave 13 lelanthoses no longer have 'warning border' for ratings below 1800
2.Changed remaining actions that spawn units on the spot which don't use premade regions to use 'RandomSpawnPointNOTD' instead of 'RegionRandomPoint'. With this change they now behave in same way as 'SmartSpawned' enemies, affected enemies:
w10 ellythia; w12 ion cannons; w25 super zombies; w36 perses; w37 devastators; w39 nydus worms.  [Simply edge case enemies which undergo specific one of changes]
3.Created 'RandomSpawnPointNOTDlite' function -> It is RandomSpawnPointNOTD which allows point to be on top of marines (copy-paste-delete 1 check)
4.Changed how creep spores that periodically drop in surv determine drop point by replacing their  'RegionRandomPoint' function with 'RandomSpawnPointNOTDlite' . With this change they now no longer fail to spawn.
5.fixed issue with wave 10 eilythia failing to transform into queen if left alive.

**Random Events**
1.Changed actions that spawn units on the spot which don't use premade regions to use 'RandomSpawnPointNOTD' instead of 'RegionRandomPoint'.
Affected units:
-random spawn brain bugs
2.Changed actions that spawn units on the spot which don't use premade regions to use RandomSpawnPointNOTDlite' instead of 'RegionRandomPoint'.
Affected units:
-random spores that spawn creep/ enemies on calldown

**Optional Missions**
1.Fixes related to seth:
    a)Changed non existing sound to other of same type, based on filename.
    b)prevented scv spawning after seth dies
    c)ensured scv will always spawn on calldown (before this fix they could have been called down outside map bounds thus failing)
    d)Fixed small errors related to facing of scv's called down to repair seth. They pointed onto wrong variable.

**SEC:**
1.fix to trigger periodically turning civilians into zombies, which first killed civilian and then wanted to find his position to spawn enemies. now position gets put into variable
2.preventing nazara trying to spawn x1 bots after death which caused errors
3.apopteosis now uses 'RandomSpawnPointNOTD' which will prevent her spawning directly on top of team
4.fixed error related to facing of apopteosis spawn in situations where dr.Bergman was already dead, now she faces team always instead of bergman
5.removing old unused variable in trigger related to start of IVAX defence which caused error
6.fixing error in hephaestus AI related to finding separated marines. It didn't account for possibility of team not being full causing errors
7.fixing how creep spores called down during hades fight sometimes failed to spawn

**AC:**
1.replaced code responsible for spawning 'titans' before perses fight with "smart spawn" function to improve readabilty, it also allowed getting rid of two local variables.
2.replaced code responsible for spawning 'seekers' before perses fight with "SmartSpawnWithBehaviorNOTD" to improve readability.
3.Fixed small error related to sound which plays when you rescue civilians in AC
4.Fixed small error in persesAI - it tried to move firewave shelter domes towards perses even after he died causing errors.

**EC**
1.Fixed small issue with mini queens before erebos. Trying to issue order to already dead units
2.Fixed error in 'BlackOpsAIInitiative' - trying to order attack on player marines that might have been already dead, or never in game
3.Incorporated more ussage of local variables instead of repetetively calling global functions in 'BlackOpsAIInitiative' trigger
4.Fixed small error related to changing color of satchel that blackops can use on players
5.Fixed small error caused by blackops gunship indicator failing to spawn in rare cases
6.Replaced code responsible for spawning zombies during queen fight with 'SmartSpawnWithBehaviorNOTD', to avoid situations when zombies fail to spawn.