View Full Version : [PYTHON] Action Buttons Utilities


talchas
Jan 05, 2006, 03:44 PM
Edit:
This is now (sort of) obseleted by a new version that uses the SDK. Look in my sig for the link.

This set of utilities allows you to add buttons to the list of actions in the bottom center of the main interface. However, you cannot add any sort of tooltip to your button. AFAIK it is hardcoded with the relevant linkups in Units/CIV4MissionInfos.xml and the text in one of the Text/* xml files. It works like this:


All of this code would have to be in the same file, and should be at a place that is run at the beginning of the game. This would include any file imported by one of the EntryPonts/Cv*Interface classes.
Make your handlers - what python code you want to execute when a button is pushed:

import ActionButtons
gc = CyGlobalContext()
...
def hurtUnit(unit):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))
def healUnit(unit):
unit.changeDamage(-10,gc.getGame().getActivePlayer())


Make your buttons:

...
hurt = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/SplitUnitGroup.dds",hurtUnit)
heal = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/CreateUnitGroup.dds",healUnit)


Make a function that returns a list of buttons you want to appear for a given unit. Use setEnabled(false) to make the button appear greyed-out. If you do, you will have to call setEnabled(true) when you want it to be enabled again.

...
def buttons(unit):
heal.setEnabled(unit.getDamage()>20) # you can only heal up to 80%
if(unit.firstStrikes()>0):
return [heal,hurt]
return [heal]

This would let you heal units up to 80%, and hurt units that have first strikes. The heal ability would always appear and just change being enabled/disabled, but the hurt one would only appear if that unit had first strikes.

Then tell this mod's code about it:

ActionButtons.setButtonsFunction(buttons)


The mod using this would also have to have all the python files in its Assets/Python folder. If you need to edit CvScreensInterface, edit mine instead or change yours to import and use CvActionButtonsMainInterface instead of CvMainInterface. The only other thing is CvGameInterface, which you could do anything you want with as long as you copy into your CvGameUtils subclass my cannotHandleAction function and the "import ActionButtons" statement. If you need to edit CvMainInterface, mine has markers everywhere I changed the original (v. 1.52).

The zip file contains a Python folder with all the .py files.

This stuff is just the modularized version of what I was using in my Magic/Square Selection demo.

Edit:
1.01: Updated version that repaints the ui.
1.02: Only repaints the necessary parts of the ui. Also put in a possible workaround for the occasional MemoryError/Unidentified C++ Exception thing.

The Great Apple
Jan 11, 2006, 05:37 AM
Missed this one. Managed to catch a link from another thread.

Hmmm - I suppose you could set mouseover info if it was of a set type, could you not? For example, if I wanted to put an upgrade button in so that a unit could upgrade where it could not normally upgrade could I not set the widget to the new unit widget?

EDIT: Another question -

About the code you've shown as an example. Are you saying that you have to put it in a file which is ran by one of the EntryPoints files? So if I make a new file called "CustomButtons.py", and copy-paste that code you've put there (as well as sort out all the files) will I get the hurt/heal buttons?

EDIT 2: Okies - I tried to get it to work and failed... bah! Any chance you could post an example file with working code which I can base my fiddlings off?

talchas
Jan 11, 2006, 03:55 PM
Hmmm - I suppose you could set mouseover info if it was of a set type, could you not? For example, if I wanted to put an upgrade button in so that a unit could upgrade where it could not normally upgrade could I not set the widget to the new unit widget?

However, if you did that, then you couldn't respond to it in the python. The python function is only called if the game can't handle the button itself.


About the code you've shown as an example. Are you saying that you have to put it in a file which is ran by one of the EntryPoints files? So if I make a new file called "CustomButtons.py", and copy-paste that code you've put there (as well as sort out all the files) will I get the hurt/heal buttons?

Yes, that should work. For example, stick it in the bottom of the CvActionButtonsGameUtils.py (not indented) and it should work.

There was also a bug with the buttons function in my example.
So CvActionButtonsGameUtils.py would be:
import CvUtil
from CvPythonExtensions import *
import CvGameUtils
import CvEventInterface
import ActionButtons
# globals
gc = CyGlobalContext()

class CvActionButtonsGameUtils(CvGameUtils.CvGameUtils):
def cannotHandleAction(self,argsList): # this is the only place I've found that you can respond to the action buttons
pPlot = argsList[0]
iAction = argsList[1] # iAction is data1 from the appendMultiListButton command - it is always negative so that civ4 doesn't deal with it itself
bTestVisible = argsList[2]

button = ActionButtons._getButtonFromAction(iAction)
if(button==None):
return False
button.getHandler()(CyInterface().getHeadSelectedU nit())
return True
def hurtUnit(unit):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))
def healUnit(unit):
unit.changeDamage(-10,gc.getGame().getActivePlayer())
hurt = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/SplitUnitGroup.dds",hurtUnit)
heal = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/CreateUnitGroup.dds",healUnit)
def buttons(unit):
heal.setEnabled(unit.getDamage()>20) # you can only heal up to 80%
if(unit.firstStrikes()>0):
return [heal,hurt]
return [heal]
ActionButtons.setButtonsFunction(buttons)

The Great Apple
Jan 11, 2006, 04:27 PM
Well, it works :)

It doesn't however update the iterface after you press the button, which is a bit weird, and the button stays enabled until you flick between units. I turned the heal to hurt for testing purposes (and flipped the > to a < on the damage check), and was able to kill my own units because the button didn't grey out until I flicked back to the units. Also the damage didn't show up in the interface (although the multi-units had people disappearing). Basically, I doesn't seem that the interface is getting updated until you select a new object.

Thinking about it the interface *does* get updated when you select a promotion. Hmmm.

talchas
Jan 12, 2006, 05:18 AM
I just uploaded a new version, but I haven't had time to test it. It calls CyInterface().makeInterfaceDirty() to make it repaint, but I'm not sure that that is enough for the enabled/disabled thing. Could you check it out?

The Great Apple
Jan 12, 2006, 06:20 AM
I just uploaded a new version, but I haven't had time to test it. It calls CyInterface().makeInterfaceDirty() to make it repaint, but I'm not sure that that is enough for the enabled/disabled thing. Could you check it out?It works fine, however the game has a brief pause while the whole interface is redrawn, which is a bit annoying.

After a bit of testing, it seems that it's only a change in damage that doesn't update the screens (rather odd). I've tried changing movement, and promotions, and both seem to update both the info panel on the left, and the bit in the middle, without any slowdown.

talchas
Jan 12, 2006, 11:24 AM
I expect that it is only needs to be repainting part of the ui instead of the whole screen. When I get home I will take a look.

talchas
Jan 20, 2006, 02:59 PM
Ok, I changed it to just mark the buttons and the info pane as dirty, and it works fine.

Shqype
Feb 02, 2006, 06:09 PM
Thanks Talchas, this will help me alot :)

def hurtUnit(unit):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))
def healUnit(unit):
unit.changeDamage(-10,gc.getGame().getActivePlayer())

This is nice, but what if I wanted to hurt or heal other units on the same plot? For example, if I had a "medic" unit that can automatically give a damaged unit some strength back. Or, more particularly, if I had a unit that could only heal other units/unit types?

talchas
Feb 02, 2006, 06:32 PM
Thanks Talchas, this will help me alot :)
This is nice, but what if I wanted to hurt or heal other units on the same plot? For example, if I had a "medic" unit that can automatically give a damaged unit some strength back. Or, more particularly, if I had a unit that could only heal other units/unit types?
Well, to hurt/heal all units on a plot do this:

for i in range(targetPlot.getNumUnits()):
targetPlot.getUnit(i).changeDamage(amount,gc.getGa me().getActivePlayer())

where targetPlot is the probably the plot of the selected unit (unit.plot()), amount is the amount of damage to deal, negative to heal and gc is the global context.

If you wanted to only do stuff to certain types of units you would do something like this:

for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(gc.getUnitInfo(unit.getUnitType()).getType()=="MY_SPECIAL_UNIT"):
unit.changeDamage(amount,gc.getGame().getActivePla yer())

If you wanted a whole unitclass then replace getUnitInfo/getUnitType with getUnitClassInfo/getUnitClassType.

Shqype
Feb 02, 2006, 11:24 PM
Thanks, I made the changes, but what this does is make that particular button/action available to all units. I only want to make it available to one unit, like a Medic. What code would accomplish this?

talchas
Feb 03, 2006, 04:51 AM
Thanks, I made the changes, but what this does is make that particular button/action available to all units. I only want to make it available to one unit, like a Medic. What code would accomplish this?
Oh, right. Instead of

def buttons(unit):
heal.setEnabled(unit.getDamage()>20) # you can only heal up to 80%
return [heal]

Do this:

def buttons(unit):
heal.setEnabled(unit.getDamage()>20) # you can only heal up to 80%
if(gc.getUnitInfo(unit.getUnitType()).getType()=="MY_SPECIAL_UNIT"):
return [heal]
return []

Of course you probably would want to do a more complex check for heal.setEnabled - something like looping through all the units on that square and only disabling if none of the units can be healed. Something like this:

def buttons(unit):
heal.setEnabled(false)
targetPlot=unit.plot()
for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(unit.getDamage()>20):
heal.setEnabled(true)
break
if(gc.getUnitInfo(unit.getUnitType()).getType()=="MY_SPECIAL_UNIT"):
return [heal]
return []

Also you would then need to check each unit in the heal function, something like this:

for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(unit.getDamage()>20):
unit.changeDamage(-10,gc.getGame().getActivePlayer())

Shqype
Feb 03, 2006, 11:01 AM
Alright, I have the following code, and have observed a few bugs.
Code:
def healUnit(unit):
for i in range(targetPlot.getNumUnits()):
unit = targetPlot.getUnit(i)
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_INJURED"):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))

hurt = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/SplitUnitGroup.dds",hurtUnit)
heal = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/CreateUnitGroup.dds",healUnit)
def buttons(unit):
heal.setEnabled(false)
targetPlot=unit.plot()
for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(unit.getDamage()>0):
heal.setEnabled(true)
break
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_MEDIC"):
return [heal]
return []

Bugs:
-Each turn the injured unit heals 10 strength by itself, without any button actions being pushed/performed.
-The Medic unit, supposed to be the only one to heal, has a grayed out button when on any plot NOT containing the unit it is supposed to be able to heal. Once you step on a plot containing the injured unit, the button simply disappears.

What I need is for there to be 2 units: Medic and Injured. The medic unit should be the ONLY unit with the "heal" button. Also, the ONLY unit it can heal is the unit "Injured," ONLY when it has less than 100% strength.

The Great Apple
Feb 03, 2006, 11:08 AM
Yeah, that code is buggy. You've used "unit" to define two separate things. Change this: for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(unit.getDamage()>0):
heal.setEnabled(true)
break to this: for i in range(targetPlot.getNumUnits()):
unit2 =targetPlot.getUnit(i)
if(unit2.getDamage()>0):
heal.setEnabled(true)
break and I think it should work.

About the unit healing itself - are you sure this isn't just how the game works? Units healing at the end of turns? Maybe you have a medic promotion?

talchas
Feb 03, 2006, 01:54 PM
Oops, I forgot that unit was being used already when I posted that code.

Shqype
Feb 03, 2006, 05:33 PM
Thanks TGA. I made the change and got the button to appear at the correct time, however there are still bugs:

-Apparently each unit will heal automatically at the end of each turn, even if you skip its turn by pressing [space]. I feel that makes the "Fortify Until Healed" button redundant. In any case, there were 3 INJURED units, one at full strength (100), one at 55% strength, and another at 61% strength. I skipped to the next turn and their new strengths were 100, 75, and 81, respectively. It seems there is 10 strength gain from the injured unit (once) and then there is a natural 10% strength gain that all units recieve from the game at the end of the turn/beginning of next turn.
-When I used the "medic" to heal the injured unit, pressing the newly created button gives me the following error:

http://img143.imageshack.us/img143/8968/pythonhealerror2cu.jpg

I believe the problem has to do with this code:
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_INJURED"):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))

As it is it gives the INJURED unit the ability to heal itself IF it is damaged. Not only should this not happen, but I also want to remove the INJURED unit's ability to even be healed completely (except for the medic). In other words, the method that heals each injured unit after each turn needs to be overriden so that all INJURED units do not get healed. The only way they should be healed is by the medic.

The Great Apple
Feb 03, 2006, 05:44 PM
Okies, your new error comes from you having not defined targetplot. Now, as targetplot is going to be the plot of the unit, you can simply change this: def healUnit(unit):
for i in range(targetPlot.getNumUnits()):
unit = targetPlot.getUnit(i)
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_INJURED"):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))to this:def healUnit(unit):
targetplot = unit.plot()
for i in range(targetPlot.getNumUnits()):
unit = targetPlot.getUnit(i)
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_INJURED"):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))
This is still pretty poor code, as you have unit used twice for two separate things, but it'll work...

To remove the ability of units to heal normally, just edit GlobalDefines.xml - change all the heal rates (city/friendly/neutral/enemy) to 0.

Just to warn you the AI won't know how to heal units if you do this.

Shqype
Feb 03, 2006, 06:29 PM
Alright, 1 problem down, 1 to go.

The units no longer heal themselves, the only healing is the kind that occurs each turn as defined in GlobalDefines.xml. By the way, couldn't this be overriden in python by something like:
if (pPlayer.isHuman()):
#All heal rates set to 0 for INJURED
Sure, the computer will get a slight advantage, being able to heal INJURED units 15% on its own for free (without medics), but I guess it's fair since we have an advantage over the computer called conscious intelligence :p

Now, the problem that still persists:
http://img300.imageshack.us/img300/5706/pythonhealerror21vi.jpg

It says targetPlot is not defined.

talchas
Feb 03, 2006, 06:41 PM
Make that targetPlot -python is case-sensitive
def healUnit(unit):
targetPlot = unit.plot()
for i in range(targetPlot.getNumUnits()):
unit = targetPlot.getUnit(i)
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_INJURED"):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))


Of course you probably want to just heal all units on your team, so then do:
def healUnit(healer):
targetPlot = healer.plot()
for i in range(targetPlot.getNumUnits()):
unit = targetPlot.getUnit(i)
if(unit.getTeam()==healer.getTeam()):
unit.changeDamage(10,gc.getGame().getActivePlayer( ))

Shqype
Feb 03, 2006, 07:23 PM
Thanks Talchas. Thank you and TGA both for helping me. Now I have a better idea of how it works.

The only other bug I've got to report is that you can heal with injured unit until it regains all its health. There is no restriction on how many times the button can be pressed. Would it be easier to only allow the button to function if the unit has 1+ movement left?

PS- somehow throughout all this code the heal was 10 instead of -10 ... so I actually pressed it repeatedly and killed my units, haha, until I went back and changed it.

talchas
Feb 03, 2006, 08:16 PM
I designed this mod so that you can do whatever you want with it - I didn't include any restrictions like that for this reason. You could add a restriction in several ways:
1. You could just set the moves on the unit to 0 when you click heal and then require 1+ moves left or it is disabled.
2. You could allow only 1 healing per unit per turn by recording the fact that the heal ability has been used in the scriptData and then clearing this flag for all of a player's units in CvEventManager.onBeginPlayerTurn (or whatever its called). Then check this flag in the scriptData.
3. Similar to 2, but instead just record the turn number each time it heals and only let it work if the turn number is different.

Shqype
Feb 03, 2006, 10:47 PM
Thanks for the suggestion. I found this looking through Kael's python files:
pUnit.finishMoves()
It should (by its name) finish a unit's moves ... the problem is where to put it. I've tried a couple of different things which all broke the code :(

talchas
Feb 04, 2006, 05:57 AM
Use
def healUnit(healer):
targetPlot = healer.plot()
healer.finishMoves()
...

and

def buttons(selectedUnit):
heal.setEnabled(false)
targetPlot=selectedUnit.plot()
if(selectedUnit.getMoves()>0):
for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(unit.getDamage()>0):
heal.setEnabled(true)
break
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_MEDIC"):
return [heal]
return []

RED DIAMOND
Feb 04, 2006, 12:24 PM
OK Talchas, yes I am a fan:D This is really a great thing that you are doing here. You and The Great Apple are really nice people for helping us all out here. Thank you again.:goodjob:

Shqype
Feb 04, 2006, 08:34 PM
I agree with you RED DIAMOND, by walking us through this code we get to borrow the confidence and expertise they possess and use it to learn the code and how it works ourselves :)

Thanks for the fix talchas, but still buggy:
def healUnit(healer):
targetPlot = healer.plot()
healer.finishMoves()
for i in range(targetPlot.getNumUnits()):
unit = targetPlot.getUnit(i)
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_INJURED"):
unit.changeDamage(-10,gc.getGame().getActivePlayer())

hurt = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/SplitUnitGroup.dds",hurtUnit)
heal = ActionButtons.ActionButton("Art/Interface/Buttons/Actions/CreateUnitGroup.dds",healUnit)

def buttons(selectedUnit):
heal.setEnabled(false)
targetPlot=selectedUnit.plot()
if(selectedUnit.getMoves()>0):
for i in range(targetPlot.getNumUnits()):
unit =targetPlot.getUnit(i)
if(unit.getDamage()>0):
heal.setEnabled(true)
break
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_MEDIC"):
return [heal]
return []

I tested out the code and came with up with the following results:
-Medic never has the heal button available (not visible) on its first turn (when it has 2 moves left).
-The icon ONLY appears when the medic has <2 turns.
-Even with <2 turns remaining, the medic cannot heal an injured unit with <100 strength (full strength).

So I went in and changed the if statement according to what I thought was the problem, an issue with the move amount. Just experimentation:
if(selectedUnit.getMoves()<2):
Then I got new results:
-The medic has the heal button appear every turn BEFORE it moves, once it moves then it disappears again.
-Even if on its first turn with 2 moves, on a plot with the injured unit with <100 strength, the icon is still "grayed out" and the medic cannot heal the unit.

Whoever thought this stuff could be so difficult?

The Great Apple
Feb 05, 2006, 05:25 AM
You still have the bug where you are using "unit" to define two separate things.
if(gc.getUnitInfo(unit.getUnitType()).getType()=="UNIT_MEDIC"): should read: if(gc.getUnitInfo(selectedUnit.getUnitType()).getT ype()=="UNIT_MEDIC"): The way it is at the moment if there is a unit that requires healing, that is the unit that would be checked to see if it was a medic, but not otherwise.

As for the moving stuff - if you useif (selectedUnit.canMove()): I think it should work out fine. There are some weird counter-intuative things that go on with movement...

Shqype
Feb 05, 2006, 06:52 PM
Beautiful! Works perfectly! Thanks alot TGA :D

The only thing left to do now is to restrict the "INJURED" unit from healing itself... I need to "delete" the Fortify until Healed button that all units have ... I want the medic to be the only source of health replenishment for this unit. If you know what python file this is handled in (the actions of the buttons), can you direct me to it? I believe it should be within my abilities to check for the unit type, and if it is INJURED, then to disable the self-heal button.

talchas, do you have any tutorials or tips or sample code available for providing text for these newly created buttons? If not titles and descriptions like the normal game buttons, at least some sort of text that appears when the mouse pointer is over the button. That would improve the quality of the experience. Do you know in which python file such information would be set?

talchas
Feb 05, 2006, 08:24 PM
Beautiful! Works perfectly! Thanks alot TGA :D

The only thing left to do now is to restrict the "INJURED" unit from healing itself... I need to "delete" the Fortify until Healed button that all units have ... I want the medic to be the only source of health replenishment for this unit. If you know what python file this is handled in (the actions of the buttons), can you direct me to it? I believe it should be within my abilities to check for the unit type, and if it is INJURED, then to disable the self-heal button.
The regular buttons are not handled at all in python. There are some definitions in various places in the XML, go see if deleting/disabling one is possible without a crash.

talchas, do you have any tutorials or tips or sample code available for providing text for these newly created buttons? If not titles and descriptions like the normal game buttons, at least some sort of text that appears when the mouse pointer is over the button. That would improve the quality of the experience. Do you know in which python file such information would be set?
You cannot do this with the normal help tooltips without the SDK (at least not that I've found). It definitely is not in the python though.

However, you might be able to guess when the mouse pointer is over the correct button and activate the tooltip then.

Shqype
Feb 05, 2006, 08:42 PM
Aww man :(

Thanks for your answers.

Thalassicus
Feb 06, 2006, 08:47 AM
Is it possible to give units existing orders, and have it functional? For example, can you give a non-air domain unit the Air Strike ability without requiring a custom script to handle it (which the AI wouldn't know how to use)?

talchas
Feb 06, 2006, 10:33 AM
You could certainly give it the button - loop through gc.getActionInfo(n)/getNumActionInfos and find which one is of the right type. Then use the same code used in CvMainInterface to add the normal buttons - its something like screen.addMultiListButton("BOTTOM something", ...). I'm not at a computer with Civ4 right now.

theSeby
Feb 12, 2006, 06:22 AM
I've used this "tutorial" to add the steal-tech ability to the spy, and it's working.
But now, how can I have Mouse-Over information, like for the other missions ?

The Great Apple
Feb 12, 2006, 07:06 AM
I've used this "tutorial" to add the steal-tech ability to the spy, and it's working.
But now, how can I have Mouse-Over information, like for the other missions ?Nope - we aren't able to add mouseover info yet. You possably could make a system which mimiced the current mouse-over info... but I don't know how hard it would be.

RED DIAMOND
Feb 12, 2006, 09:17 AM
I've used this "tutorial" to add the steal-tech ability to the spy, and it's working.


Hmm, that's of interest. How'd you do that?

theSeby
Feb 13, 2006, 01:30 AM
Nope - we aren't able to add mouseover info yet. You possably could make a system which mimiced the current mouse-over info... but I don't know how hard it would be.
Well... I'll look how I can do that (Have you any idea ?)

>RED_DIAMOND
I've "mixed" this add-a-button-tutorial and the TechConquest Mod.
I'll probably release it this week.

talchas
Feb 13, 2006, 06:52 AM
You could try to guess where the buttons are on the screen by keeping a counter recording the number of times addMultiListButton has been called and figuring out what each position corresponds to ingame in terms of x,y coordinates. Then you could override onUpdate in CvEventManager and check the mouse position each frame. If it has been over one of your buttons for a certain amount of time, draw your own tooltip. You could do that by using addImage or something for the background and addText for the text.

Also, do remember that the AI will not use any of these buttons. If you want the AI to do stuff, wait for the SDK or override CvGameUtils.AI_update and try to work with that.

talchas
Apr 14, 2006, 11:59 AM
This is now somewhat obselete.

Edit: See the top for more info.

TheLopez
Apr 14, 2006, 12:00 PM
Why is this now obsolete???

EDIT: There might be people who don't know how to write C++ code or merge C++ code to effectively use your 2.0 version.

talchas
Apr 14, 2006, 12:13 PM
Well, I guess thats true, its just that the other version does every thing this one does and more, and does it without relying on C++'s lazy array bounds checking. I didn't think of having problems merging C++ mods.

TheLopez
Apr 14, 2006, 12:18 PM
Well, I guess thats true, its just that the other version does every thing this one does and more, and does it without relying on C++'s lazy array bounds checking. I didn't think of having problems merging C++ mods.

I agree, I don't think either of us would have problems merging C++ mods, I'm just thinking about everyone else that could.

davidlallen
May 27, 2008, 08:03 PM
I am not sure anybody but me cares. But I have merged this into the BTS code so I can add action buttons with python, no SDK required. See more details in this thread (http://forums.civfanatics.com/showthread.php?p=6862964). All that was really needed is to find the active portion of CyMainInterface.py and merge it into the appropriate place in the BTS version of the file.