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

Event help needed please

Discussion in 'Civ4 - SDK/Python' started by Tripod, Feb 14, 2010.

  1. Tripod

    Tripod Chieftain

    Joined:
    Dec 9, 2007
    Messages:
    32
    Location:
    Germany
    Hello.
    I try to add a randomevent to the game that can occur everywhere on the map at any time.Thinking of a stormevent that can damage Units and,if possible ,can destroy improvements when hit.It was no real problem to change the tornadoevent do this,but I would like to have an event that could happen on a plot that is not owned by a civ.
    Does anyone can help please?:help:
     
  2. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,123
    Location:
    Germany / Netherlands
    Could you maybe show us the current tornado event?

    And i don't see much sense in it. You'll probably never notice, that it only happens on owned tiles.
     
  3. Tripod

    Tripod Chieftain

    Joined:
    Dec 9, 2007
    Messages:
    32
    Location:
    Germany
    All I did isn`t really my work,I just change the Tornado ModComp by Fierabras,took the Blizzard Feature from FfH Age of Ice so that it more looks like a Storm,make it passable but with a high movement.When it occurs it appears at 4Tiles (I did that because I like to play on huge europe maps) and it destroys the improvement on the triggerd plot and gave a damage/Turn to units on all 4 plots.This were nearly all XML things,so it wasn`t really hard.After that I try to give the feature the chance to move via iDisappearance and iGrowth but it works not really the way I want.
    I allready take a look at the Blizzard ModComp by TC01 but its too much python for me(and it only works for Ffh:( ).I hope I can use the movechance from this modComp but at the moment its even to hard for me to create a trigger that the feature can appear anytime/anywhere.I hope its possible in python but I nearly know anything about it:confused:
    The reason I want to let it happen on a completly random plot is because it should have the chance to move around and I don`t want to hit only one civ :hammer:
     
  4. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,123
    Location:
    Germany / Netherlands
    What does not work there?


    And i thought, the tornado event has some python incorporated.
     
  5. Tripod

    Tripod Chieftain

    Joined:
    Dec 9, 2007
    Messages:
    32
    Location:
    Germany
    Yes,there is some python.But it wasn`t hard to reach what I want.Just copied a few lines I found there and changed the x and y data.

    Spoiler :
    def applyStorm1(argsList):
    iEvent = argsList[0]
    kTriggeredData = argsList[1]

    plot = gc.getMap().plot(kTriggeredData.iPlotX, kTriggeredData.iPlotY)
    plot.setFeatureType(gc.getInfoTypeForString('FEATURE_STORM'), 0)

    plot = gc.getMap().plot(kTriggeredData.iPlotX+1, kTriggeredData.iPlotY)
    plot.setFeatureType(gc.getInfoTypeForString('FEATURE_STORM'), 0)

    plot = gc.getMap().plot(kTriggeredData.iPlotX, kTriggeredData.iPlotY+1)
    plot.setFeatureType(gc.getInfoTypeForString('FEATURE_STORM'), 0)

    plot = gc.getMap().plot(kTriggeredData.iPlotX+1, kTriggeredData.iPlotY+1)
    plot.setFeatureType(gc.getInfoTypeForString('FEATURE_STORM'), 0)

    Changing the Blizzard files unfortunately isn`t so easy,because there are a few things you only find in FfH in there:(
    The problem with Growth/Disappearance is that it only hit tiles where is no Feature and no improvement.
     
  6. The_J

    The_J Say No 2 Net Validations Retired Moderator Supporter

    Joined:
    Oct 22, 2008
    Messages:
    31,123
    Location:
    Germany / Netherlands
    Mmhh...thinking about it...i don't know, if this is doable at all.
    The event has to occur for somebody, so the tile has to be seen by somebody, so somehow a civ must be involved in that.
    Moving the features from an already occured event could be done, but that would be ugly work.

    I'm thinking about a global list, where all the coordinates are stored in for every event, and then per round it must be moved...ugly. Mmmhh...does anybody see a better way?
     
  7. Tripod

    Tripod Chieftain

    Joined:
    Dec 9, 2007
    Messages:
    32
    Location:
    Germany
    Oh,that sounds much harder as I thought/hoped...:sad:
    I don`t really know how python works but while looking at the blizzard modcomp I saw the "onBeginGameTurn"function and I thought it means that this is sometihng the game checks every turn(->'Called at the beginning of the end of each turn').Please do not lough if I understand this totally wrong-never did anything in python before:blush:
    I thought it could be possible to implemt a random function in there that decides if the event is happening or not.And if it happens to find the x and y positions for it with a random function too.Hope that doesn`t sound to stupid...:)
     

Share This Page