Requesting following features

Discussion in 'Civ4 - SDK/Python' started by j_mie6, Oct 23, 2010.

  1. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    nice! yeah I actually didn't know an a<=b<=c statement could be done :p

    I wrote a form generator program for use in my Engineering class. Pretty good to have programs you can use :p
     
  2. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I'd say that writing programs to help you in your everyday life (or work) is at the heart of programming. And programming is of course what computers (CPUs) were originally designed for (and not updating your Facebook status on your smart phone), even home/personal computers. So what you and me have re-discovered is actually the original purpose of these glorified desk calculators! ;)
     
  3. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    Makes me feel proud :lol:
     
  4. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Its true in any case. Our first family computer didn't "do" anything. You were meant to read the programming manual and make your own programs! Sure, we got it for playing computer games, but it simply wasn't any kind of a substitute for a video gaming console. Loading games was... awkward. So I found myself far more fascinated by programming the machine, rather than playing the games. :lol:
     
  5. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    As far as I know, the predecessor of the Home Computer was used to decrypt ciphers in the wars :p
     
  6. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    ...and IBM delivered the punch-card operated computers used by the Nazis to manage the concentration camps...

    Don't mention the war, eh? ;)
     
  7. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    while I am still in testing I came up with a new idea for the rebellion difficulties (when I get around to it)

    at the start of the game a popup allows the player to choose the level of difficulty of the rebels :p I will look into this when I have time/is finsihed with testing...
     
  8. Nitram15

    Nitram15 Pro Libertate!

    Joined:
    Sep 15, 2009
    Messages:
    1,855
    Location:
    Hungary
    Inform us if you need help. ;)
     
  9. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    right, during testing I found an underlying problem with the slave rebellion... As the slaves are not assigned to a major civ they are at peace with everyone automatically meaning the rebellion can't happen and they just wonder around... will work on fixing that within the code when I get around to it :p

    also as the human I found that my units were stopping and making catapults with the AI construction code. This needs fixing...

    I also need to change those latitudes and some other minor things... I am just hoping that there are no errors in the upcoming code that is on it's way :p (what a pain after playing for 320 turns :rolleyes:) but I can use the change turn turn function that you gave me to test that if it fails on me :p
     
  10. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    bump :p
     
  11. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I don't currently have a computer with a CivIV install, so I can't test anything. But I guess you want me to take a look at some code, at least? What bug is most urgent, you reckon?
     
  12. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    probably the rebels code. Slave rebels can't happen at all because of the reset diplomacy function. They are never at war with anybody and just wonder around aimlessly. Will put the code up here tonight
     
  13. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    AHHHHHHHHHHHHH!!!! I completly forgot :p stupid computer trouble... (btw made a french verb dictionary program in my spare time and my school will be using it when it is all patched up... I can post if you are interested...)

    Code:
    def resetRebelCiv(pCivPlayer):
            pCivPlayer.get(CyPlayer).killAllDeals()
            pTeam = pCivPlayer.get(CyTeam)
            for eRivalTeam in CivPlayer.getPlayers(True, teamID):
                    if eRivalTeam == pCivPlayer.get(teamID): continue
                    elif eRivalTeam == getMajorCiv(pCivPlayer).get(teamID):
                            if not pTeam.isAtWar(eRivalTeam):
                                    pTeam.declareWar(eRivalTeam, False, -1)
                    elif pTeam.isAtWar(eRivalTeam):
                            pTeam.makePeace(eRivalTeam)
    
    this needs to be made so that the slaves are at war with everyone, or that the slaves store the target cities ruler as it's opposition... If you need any more code (like form the rebellion module) to look at just ask!
     
  14. Nitram15

    Nitram15 Pro Libertate!

    Joined:
    Sep 15, 2009
    Messages:
    1,855
    Location:
    Hungary
    Can you give an example what can be the parameter of resetRebelCiv?
    The problem must be somewhere here tough:
     
  15. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Without revisiting the actual code, can't you just skip the resetRebelCiv() call for the slave civ? Or add a escape clause at the top of the function definition?
     
  16. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    So, if *slave*: return?

    @nitram, Yes it is :p the slaves have no opponenets, it's how to deal with that is the problem, the arguement is a player in the game
     
  17. Nitram15

    Nitram15 Pro Libertate!

    Joined:
    Sep 15, 2009
    Messages:
    1,855
    Location:
    Hungary
    No, you should you "pass" instead return.
     
  18. j_mie6

    j_mie6 Deity

    Joined:
    Dec 20, 2009
    Messages:
    2,963
    Location:
    Bristol (uni)/Swindon (home)
    why's that?
     
  19. Nitram15

    Nitram15 Pro Libertate!

    Joined:
    Sep 15, 2009
    Messages:
    1,855
    Location:
    Hungary
    Baldyr suggested to skip this function.
     
  20. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    No, go with return to exit the function. Using pass will allow the rest of the code to execute, but not anything within the body of the conditional statement.
     

Share This Page