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

Random Events

Discussion in 'Civ4 - Caveman 2 Cosmos' started by ori, Sep 26, 2011.

  1. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,418
    In principle I think it is one that can use expressions and I have already planned to rewrite some of it to do so (for now I have started with outcomes to use integer expressions for chance and the like).
     
  2. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    Wow I just experienced a volcano emerging from the sea. It was very cool. But I think it killed off my fish resource. :(
     

    Attached Files:

  3. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    I'll need to go back to that - probably need a python check after all, the xml is actually pretty clear that it should not happen on a resource.
     
  4. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,425
    Location:
    Britain
    I have no objection to the level of Volcanic Event activity in the games I have been playing of late. However I am a little ticked off that the screen zooms to volcanic eruptions that are close to me but still in unexplored territory. When a Volcano errupts in my own territory the screen doesn't zoom to it (if I've left the map centered on a unit out exploring) and unless it destroys some improvements there is no message.

    I know you guys are busy with lots of different things and fixing other issues but this one does seem to contribute to CtD's, at least for me.
     
  5. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    I have a volcano that has been hit by erruption events again and again and again - its basically been active for over 30,000 years. It would be nice if things would spread around a litle more.
     
  6. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    This might be a viewports bug - are you using viewports?
     
  7. PsiCorps

    PsiCorps FF: Babylon 5 mod team

    Joined:
    Dec 30, 2007
    Messages:
    1,425
    Location:
    Britain
    I stopped using the viewports because of the Black Tiles problem it brought with it. Since I stopped using viewports I've had no Black Tiles.
     
  8. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,540
    Gender:
    Male
    Location:
    Canberra, Australia
    I believe that the problem is that the volcano event is triggered for a player but the location of the event may not be inside the player's visibility range. If it is your event you get notified even if it is outside where you have explored. If it is another player's event and it happens inside your explored area then you don't get a message.

    @Ori would you like a second pair of eyes to look at the volcano event? Perhaps one of us could suggest some changes. BTW, I have not seen a volcano event happen on a resource, not even fish. Although I did have one that wiped out four fishing fleets.:)
     
  9. Hydromancerx

    Hydromancerx C2C Modder

    Joined:
    Feb 27, 2008
    Messages:
    16,281
    Location:
    California, USA
    It did not kill the fish resource only the improvement on the fish resource (which I replaced). So no I have not seen it spawn on a resource yet.
     
  10. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    ok - the improvement destruction is as designed.

    @DH: if you like, have a go. I am planning to put in the message fixes that AI_Andy proposed but simply had no time to code currently - I should have some time this weekend or next week - and I regard it as bug fixes so even if I run into the freeze it will go in. This will also ensure that the owner of a volcano tile will get the game centered on an erupting volcano.

    @Koshling: the Volcanos should now be truly random in which one gets chosen to erupt - if its always the same one I'd suspect its the only one on the map. If it just continues erupting and others do as well: volcanos currently have a somewhat higher chance to remain active than to go dormant, so that may very well happen even of there are a few more active volcanos elsewhere.
     
  11. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,418
    Mind that with the Viewport code now Python scripts should not call functions that change the camera vie engine calls directly. Instead you should use the respective methods that are handled by the DLL.
     
  12. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    Fine - so I'll have to find out what those are :p
    Is there a specific file in the DLL where I could have a look?
     
  13. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,540
    Gender:
    Male
    Location:
    Canberra, Australia
    Isn't it a tag on the XML not something that is done in the Python. Or is moving to the plot both? I ask because a number of events don't move to the plot even though it would be really useful.
     
  14. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,418
    I think the right method to use now is
    void bringIntoView(int iX, int iY, bool bDisplayCityScreen);
    in CyMap.
     
  15. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    the xml tag only centers the map for the player triggering the event - if it happens on a tile that someone else owns the owner will nto be notified about it. I would like it to center for the owner and maybe also for the triggering player but having the owner notified about a volcano eruption in his lands is probably the more important thing here...

    Edit: Thanks, AIAndy
     
  16. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    You should probably also check that neither getViewportXFromMapX() nor getViewportYFromMapY() return INVALID_PLOT_COORD and refrain from bringing into view if they do - essentially that would be checking that the plot is in the current viewport, and not forcing a viewport switch if it isn't. Calling bringIntoView on a plot that is not in the current viewport will force a veiwport switch, which seems a bit over the top for an event (the event already gives you a message anyway).

    Edit - not sure how easy it is for the Python to test for INVALID_PLOT_COORD (which is -MAX_INT in the C++). I'll add CyMap.isInViewport() for a simple check - will post on the SVN thread when it's available.
     
  17. ori

    ori Repair Guy Super Moderator

    Joined:
    Dec 17, 2005
    Messages:
    16,561
    Location:
    Baden-Württemberg, Germany
    Just to reiterate: the aim is to have a user who does not trigger the event to be notified of it when it happens in his territory - the user currently does not get a message to that effect.
     
  18. AIAndy

    AIAndy Deity

    Joined:
    Jun 8, 2011
    Messages:
    3,418
    Maybe add a boolean to bringIntoView that if false will only bring it into view if it is within the current viewport?
     
  19. Koshling

    Koshling Vorlon

    Joined:
    Apr 11, 2011
    Messages:
    9,254
    Could do, but it's not really necessary if I expose isInViewport() since the Python can do it easily enough. Easy enough to do though so I may do.
     
  20. strategyonly

    strategyonly C2C Supreme Commander

    Joined:
    Mar 13, 2006
    Messages:
    20,573
    Gender:
    Male
    Location:
    MN
    Just thought I'd remind everyone what it says here . . .
     

Share This Page