Psychic_Llamas
Wizard in the Making
Progress Update:
I fiddled around with doors some more today. I wanted them to make noise when opening and closing. For some reason, CvEventManager refuses to play noises on the pPlot used in the onUnitMove function. I simply could not coerce the Python to play the sound I wanted when a unit moved onto a closed door (which is a terrain feature). Oddly enough, I had no problem getting it to work for the pOldPlot (plot that the unit is moving off of).
I ended up using a goofy work-around. I created an invisible unit called "UNIT_NOISE." All closed doors get one of these units placed on them to begin with. The only function of this unit is to sit there and wait for a unit to move onto its tile. Once that happens, the Noise unit casts a spell that does nothing but play a certain sound and sacrifice the Noise unit. When the player (or AI) unit moves off of the now open door -- as long as there are no other units remaining in the doorway -- the door gets changed to a closed door, the "door closing" sound gets played, and a new Noise unit is created on the door tile.
What a kludgy mess. But it works. Now the doors open and shut in a believable way, complete with door sounds. This improves the functionality of doors beyond what was done in the Aftermath mod.
rename them to poultergeists. they sound like tricksy little spirits playing pranks on adventureres
