Modmodding Q&A Thread

Spoiler :
Code:
sys.path = ['..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\email', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\encodings', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\build', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\py', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\colourchooser', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\editor', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\floatcanvas', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\masked', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\mixins', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\ogl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\af', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ca', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\cs', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\da', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\de', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\el', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\es', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\eu', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fi', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fr', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hi', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hu', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\id', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\it', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ja', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\lv', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nb', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pt_BR', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ru', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sl', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sv', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\tr', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\uk', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_CN', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_TW', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\af\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ca\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\cs\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\da\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\de\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\el\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\es\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\eu\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fi\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\fr\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hi\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\hu\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\id\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\it\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ja\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\lv\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nb\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\nl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\pt_BR\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\ru\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sl\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\sv\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\tr\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\uk\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_CN\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\locale\\zh_TW\\LC_MESSAGES', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\py\\tests', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed\\src-images', '..\\WARLORDS\\ASSETS\\PYTHON\\SYSTEM']

sys.modules = {'zipimport': <module 'zipimport' (built-in)>, 'signal': <module 'signal' (built-in)>, '__builtin__': <module '__builtin__' (built-in)>, 'sys': <module 'sys' (built-in)>, '__main__': <module '__main__' (built-in)>, 'exceptions': <module 'exceptions' (built-in)>, 'CvPythonExtensions': <module 'CvPythonExtensions' (built-in)>}

sys.builtin_module_names = ('CvPythonExtensions', '__builtin__', '__main__', '_bisect', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', '_codecs_tw', '_csv', '_heapq', '_hotshot', '_locale', '_multibytecodec', '_random', '_sre', '_subprocess', '_symtable', '_weakref', '_winreg', 'array', 'audioop', 'binascii', 'cPickle', 'cStringIO', 'cmath', 'collections', 'datetime', 'errno', 'exceptions', 'gc', 'imageop', 'imp', 'itertools', 'marshal', 'math', 'md5', 'mmap', 'msvcrt', 'nt', 'operator', 'parser', 'regex', 'rgbimg', 'sha', 'signal', 'strop', 'struct', 'sys', 'thread', 'time', 'xxsubtype', 'zipimport')
load_module CvEventInterface
load_module CvUtil
load_module traceback
load_module CvRFCEventManager
load_module CvEventManager
load_module CvScreensInterface
load_module CvMainInterface
load_module ScreenInput
load_module CvScreenEnums
load_module time
load_module Consts
load_module RFCUtils
load_module PyHelpers
load_module Popup
load_module StoredData
load_module cPickle
load_module BugDll
load_module BugOptions
load_module BugConfig
load_module BugCore
load_module BugUtil
load_module ColorUtil
load_module BugInit
load_module BugPath
load_module BugConfigTracker
load_module BugTypes
load_module xmllib
..\WARLORDS\ASSETS\PYTHON\SYSTEM\xmllib.py:9: DeprecationWarning: The xmllib module is obsolete.  Use xml.sax instead.
14:39:04 DEBUG: BugConfig - registering xml handler BugConfig.RootHandler
14:39:04 DEBUG: BugConfig - registering bug handler BugConfig.BugHandler
14:39:04 DEBUG: BugConfig - registering load handler BugConfig.LoadHandler
14:39:04 DEBUG: BugConfig - registering config handler BugConfig.ConfigHandler
14:39:04 DEBUG: BugConfig - registering arg handler BugConfig.ArgHandler
load_module configobj
load_module __future__
load_module codecs
load_module validate
validate import failed
load_module BugOptionsScreen
load_module BugErrorOptionsTab
load_module BugOptionsTab
load_module BugHelp
14:39:04 INFO : BugCore - creating uninitialized mod Core
14:39:04 INFO : BugCore - creating uninitialized mod MainInterface
load_module CityUtil
14:39:04 INFO : BugCore - creating uninitialized mod NJAGC
14:39:04 INFO : BugCore - creating uninitialized mod Scores
14:39:04 INFO : BugCore - creating uninitialized mod CityScreen
load_module ReligionUtil
load_module FontUtil
load_module MonkeyTools
load_module AStarTools
14:39:04 INFO : BugCore - creating uninitialized mod PLE
load_module UnitUtil
load_module PlayerUtil
load_module TradeUtil
load_module DiplomacyUtil
load_module AttitudeUtil
load_module GameUtil
load_module Scoreboard
load_module DealUtil
load_module BugUnitPlot
load_module ReminderEventManager
load_module SdToolKit
load_module BugData
load_module autolog
load_module CvModName
14:39:04 INFO : BugCore - creating uninitialized mod Autolog
14:39:04 INFO : BugCore - creating uninitialized mod Reminder
load_module CvAppInterface
load_module GGUtil
load_module GPUtil
load_module ProgressBarUtil
load_module PLE
load_module RawYields
load_module CvDomesticAdvisor
load_module CvTechChooser
load_module TechPrefs
14:39:04 INFO : BugCore - creating uninitialized mod Advisors
load_module CvForeignAdvisor
load_module math
load_module CvExoticForeignAdvisor
load_module IconGrid_BUG
load_module DomPyHelpers
load_module TechTree
load_module FavoriteCivicDetector
load_module CvMilitaryAdvisor
load_module CvFinanceAdvisor
load_module CvReligionScreen
load_module CvCorporationScreen
load_module CvCivicsScreen
load_module CvVictoryScreen
load_module Victory
load_module heapq
load_module TechUtil
load_module GameSetUpCheck
load_module AutoSave
load_module MapFinder
load_module MapFinderStatusScreen
14:39:04 INFO : BugCore - creating uninitialized mod MapFinder
14:39:04 INFO : BugCore - creating uninitialized mod AutoSave
load_module Buffy
14:39:04 INFO : BugCore - creating uninitialized mod BUFFY
load_module CvEspionageAdvisor
load_module SpyUtil
load_module BugScreen
14:39:04 INFO : BugCore - creating uninitialized mod BetterEspionage
load_module CvOptionsScreen
load_module CvReplayScreen
load_module CvHallOfFameScreen
load_module CvDanQuayle
load_module CvGameUtils
load_module CvUnVictoryScreen
load_module CvDawnOfMan
load_module CvTechSplashScreen
load_module CvTopCivs
load_module random
load_module CvInfoScreen
load_module CvIntroMovieScreen
load_module CvVictoryMovieScreen
load_module CvWonderMovieScreen
load_module CvEraMovieScreen
load_module CvSpaceShipScreen
load_module SevoScreenEnums
load_module CvWorldBuilderScreen
load_module CvWorldBuilderDiplomacyScreen
load_module CvDebugTools
load_module CvDebugInfoScreen
load_module CvMapGeneratorUtil
load_module CvGFCScreen
load_module CvPopupInterface
load_module CvScreenUtilsInterface
load_module CvOverlayScreenUtils
load_module CvDotMapOverlayScreen
load_module CvStrategyOverlay
14:39:04 INFO : BugCore - creating uninitialized mod StrategyOverlay
14:39:04 INFO : BugCore - creating uninitialized mod CustDomAdv
14:39:04 INFO : BugCore - creating uninitialized mod TechWindow
load_module CityNameManager
init-ing world builder screen
load_module CvWBPopups
load_module CvCameraControls
load_module CvAdvisorUtils
load_module CvRFCEventHandler
load_module RiseAndFall
load_module CvTranslator
load_module DynamicCivs
load_module operator
load_module Stability
load_module Barbs
load_module Religions
load_module Resources
load_module UniquePowers
load_module AIWars
load_module Congresses
load_module Plague
load_module Communications
load_module Companies
load_module BugEventManager
load_module InputUtil
14:39:06 DEBUG: BugUtil - extending BugEventManager.preGameStart instead CvAppInterface
14:39:06 DEBUG: BugEventManager - adding event 'PreGameStart'
14:39:06 DEBUG: BugEventManager - adding event 'BeginActivePlayerTurn'
14:39:06 DEBUG: BugEventManager - adding event 'SwitchHotSeatPlayer'
14:39:06 DEBUG: BugEventManager - adding event 'LanguageChanged'
14:39:06 DEBUG: BugEventManager - adding event 'ResolutionChanged'
14:39:06 DEBUG: BugEventManager - adding event 'PythonReloaded'
14:39:06 DEBUG: BugEventManager - adding event 'unitUpgraded'
14:39:06 DEBUG: BugEventManager - adding event 'unitCaptured'
14:39:06 DEBUG: BugEventManager - adding event 'combatWithdrawal'
14:39:06 DEBUG: BugEventManager - adding event 'combatRetreat'
14:39:06 DEBUG: BugEventManager - adding event 'combatLogCollateral'
14:39:06 DEBUG: BugEventManager - adding event 'combatLogFlanking'
14:39:06 DEBUG: BugEventManager - adding event 'playerRevolution'
14:39:06 DEBUG: BugInit - game not fully initialized
PY:OnInit
 
That's also an unhelpful log.

At this point I can only suggest making another custom titled modmod from DoC without any changes and see if it works. Then gradually merging in all of your changes, while always checking along the way. Generally changes should come in small increments.
 
I think the fact that the game crashed while loading the 500 AD Scenario instead of crashing after loading like the rest leads me to think that there's a problem with the 500 AD scenario. I'll go through all of the files that deal with scenarios, but could you list them? It might even be in the WBS.
 
Do the errors in the ingame message log also appear when starting one of the standard scenarios?
 
Do the errors in the ingame message log also appear when starting one of the standard scenarios?

I think you might have misunderstood what I said. The ingame error messages appear only when I select a regular scenario. The game crashes during loading before they can appear in 500 AD.
 
That still suggests there might be something wrong with your mod regardless of whatever is wrong with the 500 AD scenario (the crash leads me to believe it's the C++ code but anyway).

Again, please make a new blank slate copy of DoC and start by slowly adding stuff in. I suggest making the new scenario the last of those things.
 
That still suggests there might be something wrong with your mod regardless of whatever is wrong with the 500 AD scenario (the crash leads me to believe it's the C++ code but anyway).

Again, please make a new blank slate copy of DoC and start by slowly adding stuff in. I suggest making the new scenario the last of those things.

I want to check the WBS and the C++ before I restart. I've gone over the WBS, but do you mind looking at it?
 

Attachments

I wouldn't know what to look for.

Edit: everything looks fine, but I can hardly check every single plot entry. Again, I've outlined the way I would take to figure this out, and I don't know how much I can help you when you try to avoid it.
 
I wouldn't know what to look for.

Edit: everything looks fine, but I can hardly check every single plot entry. Again, I've outlined the way I would take to figure this out, and I don't know how much I can help you when you try to avoid it.

I'm avoiding it because I feel very close to coming to the root of the problem.

I've rebuilt the DLL in both debug and release and there have been no errors. I've checked every Python file and there are no errors. I even downloaded the Civchecker application and found no errors (though I still have a feeling I might not be getting that to work properly). The conclusion I have come to is that the only possible area where there could be a flaw is the WBS.
 
Okay. Then go ahead with your thing.

Just checking, there's no way to debug a WBS besides going through it manually, right? No helpful programs?
 
I wish you could change the culture percentages on a tile using das World Builder.
 
Just checking, there's no way to debug a WBS besides going through it manually, right? No helpful programs?
Not that I know of. Again, here it's probably also a good idea to start with a blank copy of an existing scenario that works and then slowly merge in your changes.



I wish you could change the culture percentages on a tile using das World Builder.
I believe it is "der World Builder" ;)
 
Not that I know of. Again, here it's probably also a good idea to start with a blank copy of an existing scenario that works and then slowly merge in your changes.

Yeah, starting with a blank 600 AD and merging in changes seems reasonable.
 
Not that I know of. Again, here it's probably also a good idea to start with a blank copy of an existing scenario that works and then slowly merge in your changes.




I believe it is "der World Builder" ;)

Die World Builder? Take me through what all the ummm... definate articles are (I think thats the technical term for "the")

Edit: Looked it up. How is World Builder masculine?
 
Die World Builder? Take me through what all the ummm... definate articles are (I think thats the technical term for "the")

Edit: Looked it up. How is World Builder masculine?
The important thing is that grammatical gender and natural gender are two separate things. While words that have a natural male or female gender usually have the corresponding grammatical gender (not always, Mädchen (girl) is famously neuter for ... other reasons), not all objects are grammatically neuter.

Generally the ending -er is associated with masculine words, especially words of the form verb + -er that describe a person performing the action of the verb (as in English) are automatically masculine. This also applies if it's only a person in the abstract sense as with this program.

(It's always interesting how English loan words end up with a grammatical gender.)
 
Oh... that makes a lot of a sense. I agree with Eddie Izzard though that the breakthrough in the English language was realizing "ITS JUST A SPOON! IT DOESN'T HAVE A GENDER".
 
Yeah, this is just one of the random things languages do just like irregular verbs. There's not much sense to it.
 
For WinMerge, is there any way to get the program to ignore indentation? There is weird indentation in your Python and it's driving me nuts.
 
Most of us tend to be disappointed upon winning the game with a late-spawning civ and still get compared to Dan Quayle. However, I saw this page explaining the mechanics behind the scoring system and immediately thought of a way to compensate the latecomers.

So far, RFC and all derivative modmods still rely on the original scoring system in CvUtil.py, and none of them has edited it. Here's my attempt to correct said flaw:

Code:
#import the array containing the spawn dates of individual civs
import Consts as con 
import RFCUtils
utils = RFCUtils.RFCUtils()

Then, at getScoreComponent():

Code:
if bFinal and bVictory:
	[B]iHumanSpawnTurn = getTurnForYear(con.tBirth[utils.getHumanID()])[/B]
	fTurnRatio = float(gc.getGame().getGameTurn() [B]- iHumanSpawnTurn[/B]) / float(gc.getGame().getEstimateEndTurn() [B]- iHumanSpawnTurn[/B])
	if bExponential and (iInitial != 0):
		fRatio = iMax / iInitial
		iMax = iInitial * pow(fRatio, fTurnRatio)
	else:
		iMax = iInitial + fTurnRatio * (iMax - iInitial)

This, however, doesn't get into account starting with different scenarios. In the formula, is the scenario's starting year taken into account when calculating the score, or does it presume 3000 BC as Turn 1 at all times? The calculations could go wrong when playing as a civ that spawned way before the scenario started if scores from 3000 BC games are treated differently from 600 AD games.

Also, since this fix is intended for all RFC-based modmods, this does not take into account playing as reborn civs (Italy, Iran, Colombia and Mexico), which is a concept unique to DoC.
 
Back
Top Bottom