j_mie6
Deity
what all of it?!
You did? In that case it must just have slipped my mind. I'll look back and see if I can spot it... (If it was bundled up with some other files you could just post it alone.)I did change the start coordinates and posted them here didn't it?
I trust that you got what you needed in terms of debugging messages, not?I am going to do more rebels testing tommorrow!
I noticed that you've added starting coordinates for the rebel civs... Why exactly is this?It is not an error as such but more of a perminant fixture... the units will spawn on their own as they can't be instantly killed... I tried and it didn't work... (I cant remember the exact problem...)
I'll actually try to kill the units off before the first turn. How that works well know tomorrow...so either your kill off units on the first turn or asaf's adding an alive function...
This is just the thing I need to verify, but thus long the diplo reset seems to be working. (All I had to do was enable it as intended in the event manager.) But you will have to test everything in actual play-testing once I'm done.what about diplo reset? Also is there anything else we needed to do?
I think we should - and if Asaf can diable them in the SDK that would be really convenient for the likes of you or me.did we decide not to remove the death messages in the end? I'm a little confused today![]()
def onGameStart(self, argsList):
'Called at the start of the game'
initiateCustomPython()
[B]Custom.initRebels()[/B]
Rebellion.setup()
def onEndGameTurn(self, argsList):
'Called at the end of the end of each turn'
iGameTurn = argsList[0]
[B]Custom.flipRebelCiv()[/B]
def onSetPlayerAlive(self, argsList):
'Set Player Alive Event'
iPlayerID = argsList[0]
bNewValue = argsList[1]
CvUtil.pyPrint("Player %d's alive status set to: %d" %(iPlayerID, int(bNewValue)))
[B] if not gc.getGame().isFinalInitialized(): return
Custom.manageRebels(iPlayerID, bNewValue)[/B]
def initiateCustomPython():
if gc.getGame().isFinalInitialized():
global Powers, Rebellion, Custom, CC
import Powers, Rebellion, CustomFeatures as Custom, CatapultConstruction as CC
if not Rebellion.getGlobalScriptDict():
Rebellion.setup()
CC.load()
from CvGameUtils import CvGameUtils
CvGameUtils.powers = Powers
[B]CvGameUtils.custom = Custom[/B]
Custom.gameTurn()
def canRazeCity(self,argsList):
iRazingPlayer, pCity = argsList
[B]return self.custom.rebelRaze(*argsList)[/B]
from Dictionaries import *
def program():
exception()
f = open("test.py","w")
f.write(str(shopping))
f.close()
program()
fo = open("test.py", "r")
read = fo.read()
shopping = read
print shopping
print type(shopping)
exception()
dict(shopping)
print type(shopping)
def add(x, n, y):
y[x] = n
def delete(x, y):
del y[x]
def show(y):
print y
def change(x, n, y):
y[x] = n
def new():
print ""
def menu():
print "welcome to Dictionaries.py!"
new()
print "These are your options:"
new()
print "1) Shopping List"
print "2) Phone Book"
print "3) Address Book"
print "4) Quit"
new()
def submenu(n, x, y = ""):
print "What would you like to do in", n,"?"
new()
print "These are your options:"
new()
print "1) View", n
print "2) Add", x
print "3) Delete", x
print "4) Change", x, y
print "5) Exit", n
new()
def selection():
return input("Please select your option: ")
def error():
print "Invalid Option!"
def program():
loop = 1
loop2 = 1
menu()
while loop == 1:
loop2 = 1
option = selection()
if option == 1:
submenu("Shopping List", "Item", "Amount")
while loop2 == 1:
choice = selection()
if choice == 1:
show(shopping)
elif choice == 2:
add(input("What is the name of the item?(add within ''): "), input("How much of the item do you have?: "), shopping)
elif choice == 3:
delete(input("What is the name of the item you wish to delete?(add within '', case sensitive!): "), shopping)
elif choice == 4:
change(input("What is the name of the item?(add within ''): "), input("New amount: "), shopping)
elif choice == 5:
print "Returning to main menu!"
menu()
loop2 = 0
else:
error()
elif option == 2:
submenu("Phone Book", "Number")
while loop2 == 1:
choice = selection()
if choice == 1:
show(phone)
elif choice == 2:
add(input("Enter person's name(add within ''): "), input("Enter Number (add within '' for numbers starting with 0: "), phone)
elif choice == 3:
delete(input("Who's number would you like to delete?(add within '', case sensitive!): "), phone)
elif choice == 4:
change(input("Enter person's name?(add within ''): "), input("New Number: "), phone)
elif choice == 5:
print "Returning to main menu!"
menu()
loop2 = 0
else:
error()
elif option == 3:
submenu("Address Book", "Address")
while loop2 == 1:
choice = selection()
if choice == 1:
show(address)
elif choice == 2:
add(input("Enter person's name(add within ''): "), input("Enter Address: "), address)
elif choice == 3:
delete(input("Who's address would you like to delete?(add within '', case sensitive!): "), address)
elif choice == 4:
change(input("Enter person's name?(add within ''): "), input("New Address: "), address)
elif choice == 5:
print "Returning to main menu!"
menu()
loop2 = 0
else:
error()
elif option == 4:
print "Thanks for using dictionaries.py!"
loop = 0
else:
error()
def exception():
try:
program()
except NameError:
print "You must use the option number!"
print "Returning to main menu!"
exception()
except SyntaxError:
print "You must use the option number!"
print "Returning to main menu!"
exception()
shopping = {}
phone = {}
address = {}
CyGame().setScriptData(pickle.dumps(MyDictionary))
MyDictionary = pickle.loads(CyGame().getScriptData())