Maniac
Apolyton Sage
The unmodded Dawn of Man screen has this rather straightforward code:
I want another sound than the diplo music to play. Therefore I tested this code:
Unfortunately for Lal and Miriam no sound plays at all during Dawn of Man. For the other leaders the diplo sound still plays.
Does anyone have an idea why 'setSound()' doesn't work here? It works in the Era screen for instance.
That commented out Justinian code doesn't work either. It creates a python exception because the content is a string instead of an int. Is it possible to somehow turn that string into an int perhaps?
Code:
pActivePlayer = gc.getPlayer(CyGame().getActivePlayer())
pLeaderHeadInfo = gc.getLeaderHeadInfo(pActivePlayer.getLeaderType())
screen.setSoundId(CyAudioGame().Play2DSoundWithId(pLeaderHeadInfo.getDiploPeaceMusicScriptIds(0)))
I want another sound than the diplo music to play. Therefore I tested this code:
Code:
pActivePlayer = gc.getPlayer(CyGame().getActivePlayer())
pLeaderHeadInfo = gc.getLeaderHeadInfo(pActivePlayer.getLeaderType())
pLeaderHead = pActivePlayer.getLeaderType()
if pLeaderHead == gc.getInfoTypeForString('LEADER_PRAVIN_LAL'):
screen.setSound("AS2D_PEACE")
elif pLeaderHead == gc.getInfoTypeForString('LEADER_MIRIAM_GODWINSON'):
screen.setSound("AS2D_DIPLO_JUSTINIANI_LATE")
##screen.setSoundId(CyAudioGame().Play2DSoundWithId("AS2D_DIPLO_JUSTINIANI_LATE"))
else:
screen.setSoundId(CyAudioGame().Play2DSoundWithId(pLeaderHeadInfo.getDiploPeaceMusicScriptIds(0)))
Unfortunately for Lal and Miriam no sound plays at all during Dawn of Man. For the other leaders the diplo sound still plays.
Does anyone have an idea why 'setSound()' doesn't work here? It works in the Era screen for instance.
That commented out Justinian code doesn't work either. It creates a python exception because the content is a string instead of an int. Is it possible to somehow turn that string into an int perhaps?