Quick Modding Questions Thread

Nope, still not working. But someone suggested this:
Does it need a return true/false statement at the end?

Most of the python I used to use was covered in them!
Do you know what that means?

I really hope we do find out how to get this to work as my mod depends on it.
 
@Civciv5

PHP:
	def onCityAcquired(self, argsList):
		'City Acquired'
		iPreviousOwner,iNewOwner,pCity,bConquest,bTrade = argsList
### Civciv5 START ###
		if bConquest:
			pPlayerNew = gc.getPlayer(iNewOwner)
			if(pCity.getName() == "Berlin" and pPlayerNew.getCivilizationType() == gc.getInfoTypeForString("CIVILIZATION_ZULU")):
				pCity.setName("New-Berlin", True);
### Civciv5 END ###
		CvUtil.pyPrint('City Acquired Event: %s' %(pCity.getName()))
	
	def onCityAcquiredAndKept(self, argsList):
		'City Acquired and Kept'
		iOwner,pCity = argsList
		CvUtil.pyPrint('City Acquired and Kept Event: %s' %(pCity.getName()))
 
Nope, that doesn't work either, sorry.
I got it to work by doing correct tabs or something!:D
Thanks for the help, Zlatko, I will never forget this!
 
There is no sound associated with specific missionaries. When a missionary spreads a religion to city, it simply calls the code that adds the religion to the city, no matter if spread by missionary or from random spread. The sound you hear is always the one associated with the religion.

Are you sure it already works for normal spread? It's the sound file specified in the CIV4ReligionInfos.xml. Buildings do have separate building sounds that are only identical by convention, so it's not sufficient to only check those.

Well I checked everything.
General Religion sound and all building point to the sound file.
When religion spreads it makes proper sound. But when missionary makes spread religion action Hindu sound is played.

Here is what I got in my files

CIV4ReligionInfo:
Spoiler :

<ReligionInfo>
<Type>RELIGION_SOLARCULT</Type>
<Description>TXT_KEY_RELIGION_SOLARCULT</Description>
<Adjective>TXT_KEY_RELIGION_SOLARCULT_ADJECTIVE</Adjective>
<Civilopedia>TXT_KEY_RELIGION_SOLARCULT_PEDIA</Civilopedia>
<TechPrereq>TECH_CALENDAR</TechPrereq>
<FreeUnitClass>UNITCLASS_SOLAR_MISSIONARY</FreeUnitClass>
<iFreeUnits>1</iFreeUnits>
<iSpreadFactor>100</iSpreadFactor>
<GlobalReligionCommerces>
<iGlobalReligionCommerce>1</iGlobalReligionCommerce>
<iGlobalReligionCommerce>0</iGlobalReligionCommerce>
<iGlobalReligionCommerce>0</iGlobalReligionCommerce>
</GlobalReligionCommerces>
<HolyCityCommerces>
<iHolyCityCommerce>0</iHolyCityCommerce>
<iHolyCityCommerce>0</iHolyCityCommerce>
<iHolyCityCommerce>4</iHolyCityCommerce>
</HolyCityCommerces>
<StateReligionCommerces>
<iStateReligionCommerce>0</iStateReligionCommerce>
<iStateReligionCommerce>0</iStateReligionCommerce>
<iStateReligionCommerce>1</iStateReligionCommerce>
</StateReligionCommerces>
<Button>Art/Interface/Buttons/Religions/solar cult.dds</Button>
<TechButton>Art/Interface/Buttons/Religions/solar cult.dds</TechButton>
<GenericTechButton>Art/Interface/Buttons/Religions/solar cult.dds</GenericTechButton>
<MovieFile>Art/Movies/Religion/Solar Cult/generic_found.nif</MovieFile>
<MovieSound>AS2D_BUILD_SOLAR_MOVIE</MovieSound>
<Sound>AS2D_BUILD_SOLAR</Sound>
</ReligionInfo>


Audio2DScripts:
Spoiler :

<Script2DSound>
<ScriptID>AS2D_BUILD_SOLAR</ScriptID>
<SoundID>SND_BUILD_SOLAR</SoundID>
<SoundType>GAME_SFX</SoundType>
<iMinVolume>90</iMinVolume>
<iMaxVolume>90</iMaxVolume>
<iPitchChangeDown>0</iPitchChangeDown>
<iPitchChangeUp>0</iPitchChangeUp>
<iMinLeftPan>-1</iMinLeftPan>
<iMaxLeftPan>-1</iMaxLeftPan>
<iMinRightPan>-1</iMinRightPan>
<iMaxRightPan>-1</iMaxRightPan>
<bLooping>0</bLooping>
<iMinTimeDelay>0</iMinTimeDelay>
<iMaxTimeDelay>0</iMaxTimeDelay>
<bTaperForSoundtracks>0</bTaperForSoundtracks>
<iLengthOfSound>0</iLengthOfSound>
<fMinDryLevel>1.0</fMinDryLevel>
<fMaxDryLevel>1.0</fMaxDryLevel>
<fMinWetLevel>0.0</fMinWetLevel>
<fMaxWetLevel>0.0</fMaxWetLevel>
<iNotPlayPercent>0</iNotPlayPercent>
</Script2DSound>



AudioDefines:
Spoiler :

<SoundData>
<SoundID>SND_BUILD_SOLAR</SoundID>
<Filename>Sounds/Buildings/solar1</Filename>
<LoadType>DYNAMIC_RES</LoadType>
<bIsCompressed>1</bIsCompressed>
<bInGeneric>1</bInGeneric>
</SoundData>



Please tell me if I am missing something else?
 
You're missing an entry in Audio3DScripts.xml (and a sound? - or re-use the one you have).
Code:
	<Script3DSound>
		<ScriptID>AS3D_UN_CHRIST_MISSIONARY_ACTIVATE</ScriptID>
		<SoundID>SND_CHRIST_MISSIONARY_ACTIVATE</SoundID>
and in AudioDefines.xml:
Code:
		<SoundData>
			<SoundID>SND_CHRIST_MISSIONARY_ACTIVATE</SoundID>
			<Filename>Sounds/Units/ChristMissionaryActivate</Filename>
			<LoadType>DYNAMIC_RES</LoadType>
			<bIsCompressed>1</bIsCompressed>
			<bInGeneric>1</bInGeneric>
		</SoundData>
 
I didn't know about that either, interesting. I think I need to look at the code again, sorry for being so assertive when I clearly didn't know everything here.
 
Thinking of it more, I'm not sure it's the end. I wonder where is the code to call this sound and how is it linked to the unit.
 
It's weird though, those sounds are referenced nowhere else in the XML ... so how are they linked to units?
 
hi guys,
maybe the link to the sound you are looking for is the one inside the kf file. for example, i attach an image of the christianmissionary_md_activate.kf file viewed with nifscope :)
 

Attachments

  • christianmissionary_md_activate.kf.PNG
    christianmissionary_md_activate.kf.PNG
    199.2 KB · Views: 62
TIL you can also include sounds in kf files :)
 
You're missing an entry in Audio3DScripts.xml (and a sound? - or re-use the one you have).
Code:
	<Script3DSound>
		<ScriptID>AS3D_UN_CHRIST_MISSIONARY_ACTIVATE</ScriptID>
		<SoundID>SND_CHRIST_MISSIONARY_ACTIVATE</SoundID>
and in AudioDefines.xml:
Code:
		<SoundData>
			<SoundID>SND_CHRIST_MISSIONARY_ACTIVATE</SoundID>
			<Filename>Sounds/Units/ChristMissionaryActivate</Filename>
			<LoadType>DYNAMIC_RES</LoadType>
			<bIsCompressed>1</bIsCompressed>
			<bInGeneric>1</bInGeneric>
		</SoundData>

Ok i done all that - added entries for new missionary - and it didn't help.

More than that how come other missionaries don't have these entrties yet play proper sound? Only Christian has it.


Now, maybe it is related directly to the unit.
This custom unit was made from Hindu unit, and perhaps somewhere in unit file the ACTION calls to Hindu sound.
I looked at kfm, but can't seem to find the path to a sound file.
 
hi Leoreth,
although i haven't tried it to be 100% sure, it looks like you can add a sound via xml and then edit the kf to call that sound when the action is activated :) .
:eek:
Now I'm completely lost when it comes to xml setup. Clearcut xml settings like sounds for a unit is not in xml :crazyeye:
I agree, that seems like a really weird way of setting things up, especially because it breaks with the conventions established by the rest of the game. If anything, the same thing that triggers the animation should also trigger the sound, instead of associating the sound directly with the animation.

The way it is it just leads to the sort of confusion ChaosSlayer and the rest of us ran into.

Now, maybe it is related directly to the unit.
This custom unit was made from Hindu unit, and perhaps somewhere in unit file the ACTION calls to Hindu sound.
I looked at kfm, but can't seem to find the path to a sound file.
That sounds very likely, if you want to verify I suggest changing the Hindu missionary sound and test if it affects your new missionary as well.

ps: thanks for helping me change my thread's title :)
You're welcome!
 
Ok I managed to locate sound entry in kf file under "NiTextKeyExtraData" and changed it to a different audio - should work now ;)

Thank you everyone! ;)


But now I got another question.

I have given a unit custom selection and action sounds, but I don't know how to give it custom death sounds. There doesn't seem to be an entry for that. Any ideas?

Spoiler :
<UnitArtInfo>
<Type>ART_DEF_UNIT_ATTACKSPY</Type>
<Button>,Art/Interface/Buttons/Units/Spy.dds,Art/Interface/Buttons/Unit_Resource_Atlas.dds,1,7</Button>
<fScale>0.44</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<bActAsLand>0</bActAsLand>
<bActAsAir>0</bActAsAir>
<NIF>Art/Units/ATTACKSPY/marines.nif</NIF>
<KFM>Art/Units/ATTACKSPY/Marines.kfm</KFM>
<SHADERNIF>Art/Units/ATTACKSPY/marines_fx.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/UnitShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>1.0</fShadowScale>
</ShadowDef>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.05</fRangedDeathTime>
<bActAsRanged>1</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>

<SelectionSound>AS3D_UN_ATTACKSPY_VOX</SelectionSound>
<ActionSound>AS3D_UN_SPY_SURR_VOX</ActionSound>
</UnitArtInfo>
 
hi guys,
maybe the link to the sound you are looking for is the one inside the kf file. for example, i attach an image of the christianmissionary_md_activate.kf file viewed with nifscope :)

That explains it! I thought it should be coming from that file but, without any experience of working with Nifskope, I couldn't find that specific reference. :goodjob:
 
I have given a unit custom selection and action sounds, but I don't know how to give it custom death sounds. There doesn't seem to be an entry for that. Any ideas?
Did you already look in the "Surrender" or "Die" kf file?
 
Back
Top Bottom