Many of those things on the list depend on the first half of the second item: "let players have ideologies". Display which one each player has is a separate item. Thus, I would add this first. Once players can have ideologies, add Python functions that allow you to force a player to change ideology a la CyPlayer.convert(). They won't have any effects, but this is the first step in my mind; everything will build from there.
I assume each player will have a single ideology, just like religion? Actually, even before this step you need to define ideologies:
While you could hard-code a few ideologies at the start (like domains), you'll need an info class to do any of the other things on your list, so you may as well start here.
- CvEnum.h:
- IdeologyTypes
- IDEOLOGY_NONE
- Create CvIdeologyInfo
- Define getNumIdeologyInfos()
- Create XML schema
- Create CIV4IdeologyInfos.xml
- Load the infos from CvXMLLoadUtilitySet.cpp
Nope, that's all you need to do. Check, does hitting CTRL + W bring up WorldBuilder? If not, you haven't entered the cheat code correctly. Hitting ` brings up one console and ~ (SHIFT + `) brings up the Python console.
p = gc.getPlayer(0)
p = gc.getPlayer(0)
print p.getName()
print gc.getCivilizationInfo(p.getCivilizationType()).getDescription()
print p.getCity(0).getName()
print p.getIdeology()
eIdeology = gc.getInfoTypeForString("IDEOLOGY_ALTRUISM")
print eIdeology
p.setIdeology(eIdeology)
print p.getIdeology()
Okay, first the two consoles look very similar. The Python console definitely says "Python" and the version # while the other one will be blank. To test it, hit F1 and you should see some code pop up, I think to get player 0:
Code:p = gc.getPlayer(0)
There's a hint on how to use the console: just like the normal game code you'd write in an event or game-utils callback or any screen.
Code:p = gc.getPlayer(0) print p.getName() print gc.getCivilizationInfo(p.getCivilizationType()).getDescription() print p.getCity(0).getName() print p.getIdeology() eIdeology = gc.getInfoTypeForString("IDEOLOGY_ALTRUISM") print eIdeology p.setIdeology(eIdeology) print p.getIdeology()
A NameError means Python is treating your text as a variable instead of as a plain string. "bob" is a string but bob is a variable/function/class name.
Um, to get quote I just hit my quote key. It sounds like you have a foreign laptop, as I have never seen a laptop with the ' and " key (same key on every keyboard I've used) in different locations. You can always copy-n-paste it from outside BTS.
The code to create the screen object and tell it to draw itself is in EntryPoints/CvScreensInterface.py. The code for the button is in CvMainInterface.py. The button has a WidgetType attached to it that tells it to open that screen that is defined in CvEnum.h and works in CvDLLWidgetData.cpp IIRC.
case CONTROL_IDEOLOGY_SCREEN:
case CONTROL_IDEOLOGY_SCREEN:
gDLL->getPythonIFace()->callFunction(PYScreensModule, "showIdeologyScreen");
break;
.value("CONTROL_IDEOLOGY_SCREEN", CONTROL_IDEOLOGY_SCREEN)
for (i=0;i<NUM_CONTROL_TYPES;i++)
{
piIndexList[iTotalActionInfoCount] = i;
[COLOR="Red"]piPriorityList[iTotalActionInfoCount] = GC.getControlInfo((ControlTypes)i).getOrderPriority();[/COLOR]
piActionInfoTypeList[iTotalActionInfoCount] = ACTIONSUBTYPE_CONTROL;
iTotalActionInfoCount++;
}
int CvHotkeyInfo::getOrderPriority() const
{
return m_iOrderPriority;
}
I had to add CONTROL_IDEOLOGY_SCREEN to CvEnums.h to ControlTypes.
So are you saying clicking "rebuild solution" isn't enough, but I have to delete all the objects?Please confirm if you did a *full* rebuild (delete all the object files) after changing a header file. This is a habit you will have to pick up.