1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Requesting following features

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

  1. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I actually have a clever question: Should the Pictic ability be limited to the Bristish Isles? North West Europe? Because it helps if the code only needs to check a limited portion of the game map.

    Give me some coordinates!
     
  2. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    do you think you can do gaul as well though?

    also what about the forest chop!:lol:
     
  3. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    @ post 61

    That is a good point! as soon as the picts leave england they would have better food sources (check out the screenshot of their starting position :lol:)

    I say the british isles only (possibly northern france as they do seem to like there in the mod :D)

    Do you need the co-ordinates of britain?
     
  4. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I'll look into other Civs later. I'm all about the Picts right now.

    Yeah, give me the coordinates. Bottom left tile and top right tile, please.
     
  5. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    This may take a bit of figuring... Please hold...
     
  6. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Enable cheat mode and hover the tiles in question while holding shift key. The tile coordinates are shown in the lower left part of the game interface.
     
  7. Asaf

    Asaf Sleep Deprived

    Joined:
    Mar 22, 2010
    Messages:
    1,326
    Amm... NOT being an experienced modder myself, but a C++ programmer, which I've noticed you need.

    If you need some minor SDK programming, I don't mind doing it.
    I suggest exposing some missing events or methods to the python API (to CyPlot, for example). Minimum work for me, maximum flexibility for you :D

    You should set USE_CAN_DO_CIVIC_CALLBACK in PythonCallbackDefines.xml to 1.
     
  8. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I'm pretty much done with the improvements solution for the Picts at this point, but I guess that if tile yields could be changed properly with Python by including a custom DLL file to the mod, then I'd say we should go for it... I can wait.

    But ask j_mie6 before doing any actual work!

    j_mie6: Are you following?
     
  9. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Asaf, actually, if you could expose some stuff from the SDK to Python I would probably be able to do a great many of j_mie6's requests... Lets see - something along these lines would be very helpful:

    CyCity.setExtraUnhappiness()
    CyCity.setRevoltChance()
    CyCity.setDomainExtraYield()
    CyPlayer.setCityExtraDefense()
    CyPlayer.changeWarWearinessPercent()
    CyPlayer.setMaintenanceDiscount()

    ...or something. :p I actually have no idea what is currently available in the C++ and what would have to be written from scratch. :rolleyes:
     
  10. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    x=0,y=40 is the bottom left (there is land directly above it at 0,43 this is Ireland)

    now there are two options

    Britain only - x=10,y=51
    Britain and Norway 'Blob' - x=19,y=51

    I'm not sure which I want

    Btw the carthagian works now!
     
  11. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Map tiles are actually counted bottom-up, so tile 0/0 is the lower left corner of the map. But you don't actually have to count individual tiles to get the coordinates. See above.

    Try again? And I'll make it really easy for you to tweak the coordinates once my work is done. :goodjob: So practically any valid coordinates should do for testing purposes - even if it means that the code will process the whole map... :rolleyes:
     
  12. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    sorry was Butchering an octopus :D

    I don't really understand the convo...
     
  13. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    I worked it out in 2 mins lol anyway I think I will take Britain only...

    ANYWAY I don't really know what asaf was saying elaborate?
     
  14. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I'm not sure what you don't understand...

    1. enable cheat mode in CivilizationIV.ini
    2. start your scenario
    3. decide on a rectangular map area that is the area of effect for the Pictic ability
    4. hover the lower left corner of this map area with the mouse arrow while holding down the shift key
    5. repeat #4 with the upper right corder of the area
    6. write down the map coordinates displayed in the information field in the lower left corner of the game interface while looking them up

    So what I need are the map coordinates of two map tiles, like 23/34 and 45/56, or whatever. Either that or I need to know how many tiles the map spans on the X and Y axis respectively. (Don't count! Look it up in the WBS.)
     
  15. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    I didn't count I used my senario file... The two co-ordinates are:

    x=0,y=40
    x=10,y=51

    I don't understand the asaf convo :lol:
     
  16. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    No you didn't. See above. :rolleyes:

    The CivIV Python is basically mirroring the C++ code in the SDK. But not everything is available for the Python modder - tons of things seem not to have been "exposed" to Python. But this is something that obviously can be done in the SDK - add functions, methods and constants to the Python API. Which opens up new possibilities not available before.

    BTW - did you get the Greek ability working yet? Because Asaf explained that you need to enable a Python callback in the XML. Look if you can't find the file and the entry for canDoCivic. Please?
     
  17. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    I don't know what convo means. :confused:
     
  18. j_mie6

    j_mie6 Chieftain

    Joined:
    Dec 20, 2009
    Messages:
    2,958
    Location:
    Bristol (uni)/Swindon (home)
    Ok, What I did was decided in game and put a battleship where I wanted it and then opened a new WBS and looked for the battleships :D

    Have not checked the XML... What does the Callback do?

    Convo is short for Conversation
     
  19. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    It runs the custom script I supplied. Just set it to 1 as Asaf said. Because it seems to be disabled by default to avoid endless callbacks with no actual code to run.

    And thanks of the coords.
     
  20. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    This is what the tile settings look like in the code:
    Code:
    iBritainTL = Map.plotNum(0, 40)
    iBritainBR = Map.plotNum(10, 51)
    Easy enough to edit, eh? :D
     

Share This Page