makotech222
Warlord
- Joined
- Mar 18, 2012
- Messages
- 240
I like how you did it.@Toffer90 Updated the dll to allow bActual from python. Did it slightly different than you specced out, because C++ compiler freaked out a bit. Should still work.
You're probably right, though I wonder why it wasn't simply designed so that if "City is Null" then "bActual is False" else "bActual is True".I tihnk the problem was that it was a DLLExport function, and can't be messed with or else the game engine ****s up.
Edit: @makotech222
Your change works fine, though there is a problem. the function argument default values does not really work.
So all instances of python calling getBuildingHelp() in core C2C will now get an error about giving too few arguments because they don't give the bActual argument in the function call.'
If we can't figure out why the default values don't work we need to update the SVN adding in False as a last argument to all instances (there are eight) of getBuildingHelp(...) in python code.
Unit action buttons are still handled like it is in core C2C, by the dll. I'll get around to working on those buttons eventually, a lot of python code must be written to be able to change what happens when those buttons are interacted with is what I'm saying.It would be nice if unit actions, that results in creating building in city were right-clickable - that is pedia would open on that building.
It's designed that way atm, not a bug.build list in city doesn't always move when clicking on icons (buildings and wonders) - sometimes they leave empty space.
K, an oversight, will fix asap.Edit: Serious bug happens when hovering over building to demolish.
Odd, there are a few examples of python functions that are set up with defaults in the dll where it is also used without all the arguments in python.The python exports which are called from python don't have default parameters. If a function export is changed the python where it is used must be changed as well.
It's designed that way atm, not a bug.
I'm aware of it, though it's not inconsistent, it follows strict rules.I meant it is inconsistent - sometimes icons move to beginning when clicking on them.
Odd, there are a few examples of python functions that are set up with defaults in the dll where it is also used without all the arguments in python.
Here's two examples:
1. changeInvisibleVisibilityCount
Used two times in CvWorldBuilderScreen.py without all argument given.
pPlot.changeInvisibleVisibilityCount(self.m_iCurrentTeam, self.m_iRevealMode, 1) # 3 ArgumentsCyPlot.h
void changeInvisibleVisibilityCount(int /*TeamTypes*/ eTeam, int /*InvisibleTypes*/ eInvisible, int iChange, int iIntensity = 0); \\ 4 arguments
2. setForcedAIAutoPlay
Used once in AIAutoPlay.py without all argument given.
game.setForcedAIAutoPlay(idx, 0) # 2 ArgumentsCyGame.h
void setForcedAIAutoPlay(int iPlayer, int iNewValue, bool bForced = false); \\ 3 Arguments
I'm pretty sure the python code in these cases actually is processed in-game, and that they don't throw a python error about too few arguments given.
If so, what makes these functions different?
Ok, so default value for the last two parameters is not possible, only for the last one.But those functions only have a default value used at their last parameter and not for multiple parameters.
This one happened when selling building.
Traceback (most recent call last):
File "BugEventManager", line 313, in _handleDefaultEvent
File "CvEventManager", line 411, in onModNetMessage
TypeError: buildCityListLeft() takes exactly 3 arguments (1 given)
By the way tooltip doesn't disappear when pressing esc after hovering over icons.