Introducing: PyScenario - easy-to-use scenario event scripting for RFC

Quite hard... It would be easier to script the things you wanna achieve in regular Python, than to convert the application, since that in turn requires programming skill.
 
Luko, I'll get back to you once I get home.
 
I assume that PyScenario is fully compatible with RFCM 1.22?
I actually don't know. It seems like PyScenario is currently for RFCM 1.21 - what has changed in v1.22?

I use "civics()" command and theoretically it works. But the turn after unavailable civics are set back to basic ones. How can I avoid that?
You mean that you can't force civics not available to that player? I'm guessing that's not possible, then. :p You might have to mod CvGameUtils to force-enable those civics.
 
Yeah, exactly. It won't stick, as the game somehow checks the civic choices for validity each turn.

I'm guessing that the Egyptian UP is done in CvGameUtils.py - or it could be done directly in the SDK (which is the faster approach). As far as modding CvGameUtils - I can totally hook you up if you define what you need. (Do you need to enable some civics for some players at start of game? Or is there a starting date for this?)
 
Spoiler :
bool CvPlayer::canDoCivics(CivicTypes eCivic) const
{
PROFILE_FUNC();

if (GC.getGameINLINE().isForceCivicOption((CivicOptionTypes)(GC.getCivicInfo(eCivic).getCivicOptionType())))
{
return GC.getGameINLINE().isForceCivic(eCivic);
}

if(GC.getUSE_CAN_DO_CIVIC_CALLBACK())
{
CyArgsList argsList;
argsList.add(getID());
argsList.add(eCivic);
long lResult=0;
gDLL->getPythonIFace()->callFunction(PYGameModule, "canDoCivic", argsList.makeFunctionArgs(), &lResult);
if (lResult == 1)
{
return true;
}
}
//Rhye - start UP
if (getID() == EGYPT)
if ((eCivic == 1) || (eCivic == 11))
return true;
//Rhye - end UP


if (!isHasCivicOption((CivicOptionTypes)(GC.getCivicInfo(eCivic).getCivicOptionType())) && !(GET_TEAM(getTeam()).isHasTech((TechTypes)(GC.getCivicInfo(eCivic).getTechPrereq()))))
{
return false;
}

if(GC.getUSE_CANNOT_DO_CIVIC_CALLBACK())
{
CyArgsList argsList2; // XXX
argsList2.add(getID());
argsList2.add(eCivic);
long lResult=0;
gDLL->getPythonIFace()->callFunction(PYGameModule, "cannotDoCivic", argsList2.makeFunctionArgs(), &lResult);
if (lResult == 1)
{
return false;
}
}

return true;
}

CvPlayer.cpp. :/ I want to set starting civics for all civs and enable some quest-related shifts (Roman monarchy->republic despite not having any of them available)
 
The DLL is necessary only if you want to assign civics without the necessary technology (like in Egypt's UP), to avoid that they "snap back" in your first turn.

If the civ usually has the necessary civic, all you have to do is edit the scenarios in PublicMaps. Simply mimic what Rhye did for Egypt.
 
Do you wanna edit the SDK or do you require it to be a Python hack?
 
Aha, so you wanna enable and disable this effect, then?

The solution wouldn't be a PyScenario one, but rather a combination of things. I'd need your mod-mod in order to implement it for you though. Plus the complete design work, at least for some "quest" (or whatever) - so that you can simply replicate the solution in order to add more later.

edit:
Spoiler :
It would involve adding new array into the custom values of RFC and connecting the CvGameUtils module to the custom data. Then, make a custom PyScenario method for setting the data.

Or, rig CvGameUtils so that you can enable the desired effect with a custom PyScenario method.

One thing though - I doubt its possible to make Rome have - for instance - HR at spawn while still requiring Monarchy - while they don't have the tech at startup. That would probably have to be tweaked in the SDK.
 
Why not use Rhye's approach when you're editing the DLL anyway?
 
I'm not sure how you're gonna make a SDK solution work with a PyScenario setup. But I guess you could use player scriptData to enable/disable the free civics. :dunno:
 
I can't think of any negative side effects now, but in general I wouldn't mess with methods that are integral to the game's flow. You can never completely now how things are related.
 
Code:
Trigger().player(6).check(None,0).captured("Hannibal Barca").target((49,40),(63,49)).kill().stability(-20)

Why it doesn't kill Carthaginian units in Europe?

[EDIT]: OK, I see- Carthage would need to kill Hannibal by itself.

Is it possible to make some kind of reloading triggers without clearing fired() and once() things?
 
Top Bottom