Announcement

Collapse
No announcement yet.

Source Code Question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Source Code Question

    Hi,

    I'm new to the CTPII code and am trying to figure out how a few things work.

    I'd like to be able to alter the beginning of custom scenarios in such a way that I can start out with each civilization having any number cities and units at map locations that I specify.

    So, I was wondering: are there function(s) in the code I can use to place a particular city or a unit at a specified location on the map?

    Thanks.

  • #2
    No I don't see any functions that specifically do that BUT I don't think it'll be too hard (especially if you have C++ experience). Essentially you can do these things:

    Make difficulty option StartingCities (followed by integer)
    then create a function that checks for a "good spot" and a set number of spaces away (there is a city spacing thing in Const.txt)

    then have thecreate city function.

    Adding roads and population might be a bit tougher but you could just give a high starting PW to offset that.

    The one thing I don't know is how to change start data so the startof the game autoatically knows to place cities. I haven't dug around there. But another option would be to d o it in BeginTurn and set a bool flag as to whether or not it was placed but I think its better to find how game start and placing settlers is done.

    oh and welcome!
    Formerly known as "E" on Apolyton

    See me at Civfanatics.com

    Comment

    Working...
    X