1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

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

Discussion in 'Rhye's and Fall Modmods' started by Baldyr, May 16, 2010.

  1. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    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.
     
  2. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
  3. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Luko, I'll get back to you once I get home.
     
  4. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I actually don't know. It seems like PyScenario is currently for RFCM 1.21 - what has changed in v1.22?

    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.
     
  5. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    I can force that civics. But next turn it is changed back. How Egyptian UP is done?
     
  6. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    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?)
     
  7. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    Spoiler :


    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)
     
  8. Leoreth

    Leoreth 古典部の会員 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,696
    Gender:
    Male
    Location:
    Kamiyama
    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.
     
  9. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    Yeah, I know. But I want to make some civs starting with more historical form of rule. So Rome starts with monarchy, and after conquest of Melpum they get republic. But they can switch back to monarchy only after discovery of monarchy.
     
  10. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Do you wanna edit the SDK or do you require it to be a Python hack?
     
  11. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    I don't want to change anything permanently (as in Roman quest example), so probably Python is needed.
     
  12. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    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.
     
  13. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    Hmmmm... I decided for rather harsh move: " //verifyCivics();" in void CvPlayer::doTurn(). Are there any side effects of that?

    [EDIT]: Perhaps it's not a question belonging to PyScenario but if we started discussing here...
     
  14. Leoreth

    Leoreth 古典部の会員 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,696
    Gender:
    Male
    Location:
    Kamiyama
    Why not use Rhye's approach when you're editing the DLL anyway?
     
  15. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    I don't want to enable republic as a choice for Rome. They get it by quest and if they lose it (like by espionage) they can't reverse it so easily.
     
  16. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    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:
     
  17. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    I do everything by PyScenario. The thing I did in SDK was to remove civic checks so it's not reversing my changes. And everything seems to be working. So now I wonder what for the check was made? I don't want to create a new bug in my already bugged mod :p
     
  18. Leoreth

    Leoreth 古典部の会員 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,696
    Gender:
    Male
    Location:
    Kamiyama
    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.
     
  19. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    ...unless you mess with them :p Yeah, if I would have better idea I use it but just now it seems a good solution.
     
  20. LuKo

    LuKo The Royal Guard

    Joined:
    Aug 28, 2006
    Messages:
    1,501
    Location:
    Poland
    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?
     

Share This Page