Dungeon Adventure MOD MOD

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 :p
 
I know that for Forests there is a 15% chance of getting the Birds to fly out of them and make a sound. You should be able to create a similar effect for your doors and set it to 100% chance, no? But of course that would then happen even when you moved onto a door you already opened... unless they close again when you move off of them that is :)

EDIT: And now that I re-read your post, they DO close again... so this should be the perfect solution.
 
I know that for Forests there is a 15% chance of getting the Birds to fly out of them and make a sound. You should be able to create a similar effect for your doors and set it to 100% chance, no? But of course that would then happen even when you moved onto a door you already opened... unless they close again when you move off of them that is :)

EDIT: And now that I re-read your post, they DO close again... so this should be the perfect solution.

Using the terrain effect would be easier, but I can't find where sounds are associated with the visual effect. CvEffectInfos lists the EFFECT_BIRDSCATTER that is referenced in the CvFeatureInfos file. But the CvEffectInfos just references a NIF, not a sound file. The SND_BIRDS_SCATTER can be found in AudioDefines and linked to AS3D_UN_BIRDS_SCATTER in the Audio3DScripts file.

So how do the effects get their associated sounds?
 
Yes, but that only calls the effect, which so far we can only see as being visual. The problem is finding where it actually calls the Sound file from.

Every location that "Birds" shows up in the Python or XML:

In Audio3DScripts.xml
Code:
	<Script3DSound>
		<ScriptID>AS3D_UN_BIRDS_SCATTER</ScriptID>
		<SoundID>SND_BIRDS_SCATTER</SoundID>
		<SoundType>GAME_SFX</SoundType>
		<iMinVolume>55</iMinVolume>
		<iMaxVolume>80</iMaxVolume>
		<iPitchChangeDown>-3000</iPitchChangeDown>
		<iPitchChangeUp>0</iPitchChangeUp>
		<bLooping>0</bLooping>
		<iMinTimeDelay>0</iMinTimeDelay>
		<iMaxTimeDelay>0</iMaxTimeDelay>
		<StartPosition>NONE</StartPosition>
		<EndPosition>NONE</EndPosition>
		<iMinVelocity>0</iMinVelocity>
		<iMaxVelocity>0</iMaxVelocity>
		<iMinDistanceFromListener>0</iMinDistanceFromListener>
		<iMaxDistanceFromListener>0</iMaxDistanceFromListener>
		<iMinDistanceForMaxVolume>500</iMinDistanceForMaxVolume>
		<iMaxDistanceForMaxVolume>1000</iMaxDistanceForMaxVolume>
		<iMinCutoffDistance>7000</iMinCutoffDistance>
		<iMaxCutoffDistance>7000</iMaxCutoffDistance>
		<bTaperForSoundtracks>0</bTaperForSoundtracks>
		<iLengthOfSound>0</iLengthOfSound>
		<fMinDryLevel>1.0</fMinDryLevel>
		<fMaxDryLevel>1.0</fMaxDryLevel>
		<fMinWetLevel>0.5</fMinWetLevel>
		<fMaxWetLevel>0.5</fMaxWetLevel>
		<iNotPlayPercent>0</iNotPlayPercent>
	</Script3DSound>

In AudioDefines.xml
Code:
		<SoundData>
			<SoundID>SND_BIRDS_SCATTER</SoundID>
			<Filename>Sounds/BirdsScatter</Filename>
			<LoadType>DYNAMIC_RES</LoadType>
			<bIsCompressed>1</bIsCompressed>
			<bInGeneric>1</bInGeneric>
		</SoundData>

In CIV4EffectInfos.xml
Code:
		<EffectInfo>
			<Type>EFFECT_BIRDSCATTER</Type>
			<Description>Birds flying out and fading.</Description>
			<fScale>0.4</fScale>
			<fUpdateRate>1.0</fUpdateRate>
			<Path>Art/Effects/Magpie/Flock.nif</Path>
			<bIsProjectile>0</bIsProjectile>
		</EffectInfo>

And then where you cited from CIV4FeatureInfos.xml

There is nothing in the Python at all that contains the word "Birds", and nothing seems to actually link the sound to the Effect thus far.

EDIT: Just checked the Uncompiled DLL from before this patch. Line 3311 of CvUnit.cpp:
Code:
	if (getOwnerINLINE() == GC.getGameINLINE().getActivePlayer())
	{
		if (!(pPlot->isOwned()))
		{
			//spawn birds if trees present - JW
			if (featureType != NO_FEATURE)
			{
				if (GC.getASyncRand().get(100) < GC.getFeatureInfo(featureType).getEffectProbability())
				{
					EffectTypes eEffect = (EffectTypes)GC.getInfoTypeForString(GC.getFeatureInfo(featureType).getEffectType());
					gDLL->getEngineIFace()->TriggerEffect(eEffect, pPlot->getPoint(), (float)(GC.getASyncRand().get(360)));
					gDLL->getInterfaceIFace()->playGeneralSound("AS3D_UN_BIRDS_SCATTER", pPlot->getPoint());
				}
			}
		}
	}

Looks like this might be our winner. It states that if the plot is NOT owned & DOES have a feature, to then check the probability for the effect (whatever it might be), play that effect if the probability hits, and then I think it sends a Sync message for Multiplayer? Don't know on that line... and then it plays the Birds Scatter sound effect (no matter what your effect actually was...)
 
Well.... I don't plan to mess around with the DLL. My previous attempts at fiddling with DLLs and recompiling them were not pretty.

One option would be to simply change the birdscatter sound file to the "door opening" sound. I plan to get rid of forests anyway, so the birdscatter effect could be repurposed to doors. I'd have to shrink the bird NIF down to invisible, too.

The other option would be to just use the noise trigger units. I already have them implemented, and to be honest I am liking this option. They can be used for other atmospheric sounds, too, just by giving them different promotions -- sort of the same system I used for traps and glyphs. Think about it... the player walks along a corridor and suddenly hears an evil chuckle... or a series of clicks. Or any other sound you care to have triggered.

Since I've got it working the way I want -- both door opening and door closing sounds that behave realistically -- I think I'll just leave it. Besides, I may be able to repupose the bird scatter effect to make them look like bats. THAT, would be cool. :)
 
In other news, I had some success with my spawner units.

I now have invisible barb units that boogie around The Dungeon seeding it with a specific type of barb unit. Again, utilizing the same sort of promotions scheme that my traps and glyphs use, the spawner will spawn a particular type of unit depending on what promotions it has.

The spawner units have a special promotion that calls a PyPerTurn effect. the effect looks around the unit a certain distance. If there are no enemy units within the radius, there is a chance to spawn a regular unit. The spawners can move through impassable terrain, and have a move of four. The AI is set to EXPLORE. This keeps them running around The Dungeon, seeding the occasional unit. I am still fiddling with the best combination to keep them from using doors -- it looks sort of silly when a door opens by itself for no apparent reason.

It will take a good deal of play testing to get the balance right on these units. I want them to add a steady stream of wandering monsters, but not overpower the player with solid waves of enemy units. I may change the code so that the spawner will only have a chance to spawn if there are NO other units of any kind within the set radius. So, in essence, if another barb unit was too close, there would be no spawn. Otherwise, it is possible that the spawner would get stuck in an isolated area and spawn up a solid mass of units.

In any case, this is good fun. The Dungeon is starting to look more lived in!
 
Does it give you a log entry for the unit's death with the invisible units method? I assume not.


The sound file should trigger for any tile that uses an effect, and you can customize your effect to use any NIF that you want, so you don't have to remake the Bird Scatter at all to still use it. And as long as you only use 1 sound you can just use the already implemented Bird Scatter and just replace it with whatever sound you want.


I think you could get a simple scampering sound and have someone whip up a NIF for you which is spiders scuttling across the floor, and another which is rats scurrying down the corridor. Either of those would be pretty nifty too :)

EDIT: To get your spawners to quit opening doors, just tell your Door Sound dudes not to cast their spell if it is a Spawner on the tile. You tied both the opening/closing and the sound to them, didn't you?
 
I got the spawner to stop opening doors by removing their flat movement cost, and upping the movement cost of doors. I had been meaning to make a doors a "forced stop" anyway.

In the rare event that a spawner still triggers a door, well... I can live with that. It is sort of spooky and freaks out the player a little.

Oh, and the door noise units just handle the "door opening" sound. The door closing effect and sound is handled by an onUnitMove lookback to pOldPlot.
 
I have the visuals for stone altars done, but tonight I worked on adding some functionality.

For now, I have the code in place that looks to see if a stone altar is adjacent to a given unit and if the altar has an aura. If so, the unit is able to cast a "Pray at altar" spell.

Praying at the altar applies a certain effect, and removes the aura. Right now, the effect is just to heal the unit. As I add more code, the spell will apply effects depending on the player's alignment and the type of aura. (For example, and evil player praying at an altar with an evil aura will get some benefit -- but the same player praying at an altar with good aura will get a bad effect: either a bad spell or a hostile summon.)

I will also make it possible for players to "recharge" the altar with either good or evil aura.
 
Do you plan on making different types of good and evil altars for different good and evil gods?

Nope. Just the Adventurer and Cave Minion Equipment Company (A.C.M.E.) Model #327 Polytheistic, Universally Compatible Stone Altar.

Look for other items by A.C.M.E. in the The Dungeon, too!
 
Nope. Just the Adventurer and Cave Minion Equipment Company (A.C.M.E.) Model #327 Polytheistic, Universally Compatible Stone Altar.

Look for other items by A.C.M.E. in the The Dungeon, too!

:lol::lol::lol:
 
You mentioned that doors close after a unit leaves the tile, but earlier you said that Acheron can only leave his room when the door is open, which would never happen if it closes automatically. Will all doors have a one time lock on them that only applies to monsters, that is permanently removed until a spell or other ability relocks them? Or will Acheron's Door be a special door that cannot be closed, and cannot be reclosed?

Also, might I suggest upgrading to the ACME Model #328 Polytheistic, Universally Compatible Stone Altar with built in Wi-Fi hotspot? It would make exploring the dungeon far more enjoyable for those adventurers who enjoy downloading music while fighting monsters.
 
You mentioned that doors close after a unit leaves the tile, but earlier you said that Acheron can only leave his room when the door is open, which would never happen if it closes automatically. Will all doors have a one time lock on them that only applies to monsters, that is permanently removed until a spell or other ability relocks them? Or will Acheron's Door be a special door that cannot be closed, and cannot be reclosed?

About Archeron's room -- The dragon doesn't necessarily appear in every Dungeon. Those earlier screen shots were just examples of what is possible.

At first, I thought that the door mechanism would be the best way to keep an otherwise mobile Archeron confined until the Adventurers approach him. As the doors have matured from concept to reality, however, this looks less workable. Instead, I will likely implement either a special door, as you have suggested, or some other way to keep Archeron confined.

I will probably use a permutation of a lock. Since doors are currently terrain features, I am planning improvements for doors called "locked" and "jammed." (Sort of like the Arcanum system.) There are various ways to try to unlock a locked door. Critical failure may result in a jammed door, which can then only be removed by destroying the door (which is really, really hard to do!). Both locks and jams keep players from moving onto the door tile until the lock or jam has been dealt with.

So, under this system, Archeron could have free run of his room, but be confined there by a locked door (and not have the special abilities needed to unlock the door). Lesson to Adventurers: There is probably a good reason why that door is locked!

Also, might I suggest upgrading to the ACME Model #328 Polytheistic, Universally Compatible Stone Altar with built in Wi-Fi hotspot? It would make exploring the dungeon far more enjoyable for those adventurers who enjoy downloading music while fighting monsters.

:lol: :lol: :lol: This is one of the reasons why I love this forum. But seriously, no upgrade. We're not budgeted for that!
 
it might be nice for some doors not to be able to be picked open and instead you have to find the key, and also make several different keys so one key does not open every door.
 
I would say more having a skill level requirement for picking than having some un-pickable. If it cannot be picked, that should mean it is sealed by Magic, and you have to locate a Rune somewhere to disable the ward holding the door shut. And in that case it could be appropriate to allow the door to be opened forcibly with magic.
 
Yes, but it is kinda lame for a scenario maker if they have a really long and hard path to get the key to a special room and anyone can simply pick it open. It may not make much sense flavorwise, but it is required from a mechanical standpoint.
 
Back
Top Bottom