Asaf
Sleep Deprived
- Joined
- Mar 22, 2010
- Messages
- 1,326
just need to get asaf to remove them![]()
Remove what?
just need to get asaf to remove them![]()
peace messages![]()
from winsound import *
def playSound(n = 1, name = '[B]TheirMakePeace[/B].wav'):
while n > 0:
PlaySound(name, SND_FILENAME)
n += -1
actaully that's a point... Baldyr we are going to have to use a special method for this! If asaf manages to disable them that will also take away the sound of peace (great) so we are going to have to put it back, however I have already worked on code like this in my own programming
Code:from winsound import * def playSound(n = 1, name = '[B]TheirMakePeace[/B].wav'): while n > 0: PlaySound(name, SND_FILENAME) n += -1
TheirMakePeace.wav needs to be kept in the python folder alongside the code! (unless you know how to link with the vanilla sound folder)
to play the sound once it is called as
playSound()
So I guess my learning has just come in handy!I guess the function should be put in helpers or something I don't know...
from CvPythonExtensions import *
import CvUtil
import Popup as PyPopup
import PyHelpers
import CvEventInterface
import autolog
# GLOBALS
localText = CyTranslator()
PyPlayer = PyHelpers.PyPlayer
gc = CyGlobalContext()
localText = CyTranslator()
game = CyGame()
class JemonHelp:
def addMessageNoIcon(self, iPlayer, message):
"Displays an on-screen message with no popup icon."
self.addMessage(iPlayer, message, None, 0, 0)
def addMessageAtCity(self, iPlayer, message, icon, city):
"Displays an on-screen message with a popup icon that zooms to the given city."
self.addMessage(iPlayer, message, icon, city.getX(), city.getY())
def addMessageAtPlot(self, iPlayer, message, icon, plot):
"Displays an on-screen message with a popup icon that zooms to the given plot."
self.addMessage(iPlayer, message, icon, plot.getX(), plot.getY())
def addMessage(self, iPlayer, szString, szIcon, iFlashX, iFlashY):
"Displays an on-screen message."
eventMessageTimeLong = gc.getDefineINT("EVENT_MESSAGE_TIME_LONG")
CyInterface().addMessage(iPlayer, True, eventMessageTimeLong,
szString, None, 0, szIcon, ColorTypes(-1),
iFlashX, iFlashY, True, True)
import JemonHelp
JemonHelp = JemonHelp.JemonHelp()
JemonHelp.addMessageAtPlot(iPlayer, message, 'Art/plotlistenhancements/medallion_cantmove_gg.dds', pPlot)
from winsound import *
class [COLOR="Red"]YourClassName[/COLOR]:
def playSound(self, n, name):
while n > 0:
PlaySound(name, SND_FILENAME)
n += -1
import YourPythonFile
YourPythonFile = YourPythonFile.YourClassName
YourPythonFile.playSound(1, 'TheirMakePeace.wav')
I totally forgot you could do thatIf I wanted to do that all I would have to do is the exact same thing
playSound(10, 'Alarm.wav')
I have no idea, the file I copied and emptied out for my file had a class, so I thought it'd be a good idea to keep itWhy do you need the class, what benefit is it exactly?
Well, that's goodedit: the n = 1 and name = 'TheirMakePeace.wav' is there so that the function can be called as playSound() meaning it is played once and on Peace sound. however we could make it playSound(2) playing Peace twice or playSound(2, 'Alarm.wav') playing the alarm twice... see?
oh we do have our own file for all our functions aswellbut thanks anyway!
def addMessage(tag, tValues, eColor, tCoords=(-1, -1), [COLOR="Red"]sound=""[/COLOR]):
"""
Adds the tag (string) message to the game in eColor. (The preset pointers to valid
ColorTypes are eRed, eGreen and eWhite. A None value will disable the message.) If
the tag argument requires other values to be included in the message, then these
can be supplied with the tValues (tuple) argument. The optional tCoords (tuple)
argument is set to a pair of default -1 values that indicate that no arrow should
accompany the text message. (Valid map tile coordinates will enable the arrow.)
[COLOR="Red"] The sound argument (string) can point to the location of an optional sound file.[/COLOR]
"""
if eColor == None: return
message = Translator.getText(tag, tValues)
bArrow = tCoords != (-1, -1)
Interface.addMessage(pHumanCiv.get(playerID), True, 20, message, [COLOR="Red"]sound[/COLOR], eMinorEvent, "", eColor, tCoords[0], tCoords[1], bArrow, bArrow)
I'm not doing anything on this until you finish a set of data for us to use. I'm not gonna develop something that has to be completely over-hauled once you figure out what you wanna do with it.while I continue finding names I wanted to know how it is all going
I just don't think that he understood your request. And he might also be too pressed for time at the moment.and whether you can remove the peace messages from ending war asaf (incase you didn't see, look above)
I just don't think that he understood your request. And he might also be too pressed for time at the moment.![]()