Recent content by dilandau

  1. D

    [LUA] IO Functions

    string and type are also bad names. But I found Firaxis used them as variable names. Though it didn't bring problems. Moreover, it seems some coder from Firaxis didn't understand lua's numeric for thoroughly. I saw stupid code, for example: local unitCount = plot:GetNumUnits(); for i = 0...
  2. D

    [LUA] IO Functions

    I guess you meant table.concat. Since there is no string.concat in lua. I found table.contac is nil in Civ5 too. I don't know why Firaxis blocked this function. This function seems harmless. To concatenate strings, using ''.join(sequence) is better than in Python. So I tried to use...
  3. D

    [LUA] IO Functions

    obviously, Firaxis kicked it out. I guess it's due to safety consideration. getfenv was kicked out too. those functions or tables, such as _G, getfenv, io, only exist in Main State. lua_state plays like a real sandbox. In python, it's quite hard to achieve it. I always think Civ4's modding is...
  4. D

    [UI] More Unit Information

    Thank you for the info. Firaxis cheated me. In military overview, air units are put under the seperator line. namely, they belong to civilian category. I'll fix it in next version. btw, besides Naval Units, Air Units, Ranged Units filters, HP, level, Exp, what kind of info do you think that...
  5. D

    [UI] More Unit Information

    Thank you for your advice. I didn't konw code can be nested in spoiler. What do you mean? Perhaps my post was not clear. I've got no problem. In contrast, I thought there is a issue in Firaxis' code. This issue causes the unit selection doesn't work in Military Overview. IMO, function...
  6. D

    [UI] More Unit Information

    This mod aims to provide more and better organized information on Units. Vesion 1 Features: - A new screen: Units Overview, provides enhanced unit sorting and filtering. You can access it via Military Overview. - Display a unit's level and experience in Unit Panel. - Display unit information...
  7. D

    Specific Bug Reports

    It shouldn't be regarded as an issue. For western languages, sprintf/swprintf with %S brings us no problem, basically no problem. Considering there are tons of format strings and lots of them contain %S, I thought it's unnecessary to adopt the new way. Though, if I were the author of...
  8. D

    Specific Bug Reports

    %S != %s using %s to format output, yes, no problem. But using %S to convert chars/wchars, that's another story. For example, the following is the method Firaxis used. class CvString : public std::string { public: ...... explicit CvString(const std::wstring& s) { Copy(s.c_str())...
  9. D

    Specific Bug Reports

    r580 CvGame.cpp Line 7335 logBBAI(" Vote for assigning %S to %d (%S) passes", pCity->getName(), GET_PLAYER(kData.kVoteOption.eOtherPlayer).getTeam(), GET_PLAYER(kData.kVoteOption.eOtherPlayer).getCivilizationDescription(0) ); The second argument should be...
  10. D

    Bug reports

    2010_04_25_dune-wars-1-8-final.exe DuneWars.py line342-349 # Remove several terrains which may be added by mapscripts for iPlotLoop in range(CyMap().numPlots()): pPlot = CyMap().plotByIndex(iPlotLoop) iType = pPlot.getTerrainType() if iType == self.iTTGrass...
  11. D

    xml text mistake

    BUG 4.4 CIV4GameText_Events_BTS.xml <TEXT> <Tag>TXT_KEY_EVENT_CIV_GAME_1</Tag> <English>Send congratulations to the developers. Our people should enjoy this game.</English> <French>Envoyez nos felicitations aux developpeurs. Notre bon peuple devrait apprecier ce jeu.</French>...
  12. D

    regenerate map

    I noticed this problem with BUG 4.3 I found it was caused by Module: Reminders. During Reminders' initialization, it invoked SdToolKit.sdModInit('Reminders'). Namely, {'Reminders':{}} would be dumped into CyGame's scriptdata. It means !GC.getGameINLINE().getScriptData().empty() is true...
  13. D

    Undocumented Python APIs

    The most popular Civ4 Python API reference online http://civ4bug.sourceforge.net/PythonAPI/index.html gives us a very good introduction to module CvPythonExtensions. Unfortunately, not all of Python objects brought by CvPythonExtensions are mentioned in that reference. I guess that reference...
  14. D

    A bug in CvPlayerAI::AI_counterPropose

    BTS319, CvPlayerAI.cpp Line 5914 5904 int iGoldWeight = iAIDealWeight - iHumanDealWeight; if (iGoldWeight > 0) { if (pGoldNode) { iGoldData = iGoldWeight * 100; iGoldData /= iGoldValuePercent; 5914 if...
  15. D

    Civ4 Universal Map Finder

    I use CreateRemoteThread to inject a dll to Civ4's process. Actually, this program acts like a virus, it will hijack CvGame::regenerateMap. This is why it can work with all version of Civ4 and almost all mods. Hence, it 's very common that the antivirus software might regard it as a virus...
Top Bottom