Cities acting like units!

What i really need help with is the skd. I looked at the CvCity.h and CvCity.cpp files and all the codding is really intemidating. Does anyone (question targeted @ Grey Fox, TGA, or TheLopez) know where i can get help with the sdk at? I have the ideas i just don't really know where to start in the coding. When my friend comes back from camp im going get him to do most of the stories and entries for the xml so i have that covered... what i need help with is the codding and more specificly the skd (i know how to program in python and am some what familiar with doing that part).
 
Ooh another question, are you going to want a world map based on the conditions discribed in the book, or focus on random maps... Could be interesting designing the great hunting ground, and having Shan Gao (china) with the sheild wall (great wall!)... Lotsa fallout for america! :D
 
Try to do one of Kael's basic SDK changes.

Some things like exposing a function to python, or creating a new Yield, specialist value or such isnt that hard to do once you've done one similar thing.

What I usually do is search for a similar function. Like if I want to add Specialist +Health, I search for the specialist and copy the functions that are related to one of the other Specialist values. And when I'm done I search for Health and add so that the specialist health is added to the health calculations.

Once you have done something like that everything similar is pretty trivial.
 
Haha, for reference
History

Traction Cities were first formed by an engineer from London named Nicholas Quirke. After the devastation of the Sixty Minute War, the world collapsed into a post apocalyptic state, and immense geological upheaval (such as earthquakes, tsunamis, volcanoes and glaciers) threatened the world's surviving cities. In order to survive, urban areas were mobilised into vast vehicles that could evade dangerous areas. Naturally this required vast amounts of fuel, and as the earth became stripped of its natural resources, cities resorted to the practice of Municipal Darwinism and began to consume each other for energy.

The Traction Cities were soon opposed by the Anti-Traction League, based out of Central Asia, which sought to return the Earth to its former state and viewed the inhabitants of the cities as barbarians and savages. Conversely, the Traction Cities also view the Anti-Tractionists as barbarians.

The series takes place roughly 1000 years after London becomes the first Traction City, and it covers the rising tensions between the Traction Cities and the Anti-Traction League, eventually culminating in a war towards the end of the series.

Description

Traction Cities range in size from enormous metropolises (or Urbivores) with populations of millions, to tiny villages and hamlets propelled by small engines or even sails. Airships have become the most common method of transport in this new era, as they are the only way to travel between mobile destinations.

Larger cities are usually built on tiers similar to a wedding cake, with the poorer classes living on the lower tiers among the tracks and engines, and the higher classes living in mansions and villas at the top of the city.

Most cities are carnivourous, and have attachments called "Jaws" to catch prey and drag it into an area of the city called the Gut. Here the prey is stripped, melted down and used as fuel for the predator city. Its inhabitants are integrated into the population of the predator city, or, in less ethical cities, taken as slaves.

Not all cities are predatory, however; some (notably Anchorage and Airhaven) are peaceful and make a living by trading. Smaller towns and hamlets are also often peaceful and survive by trading or mining. Sometimes smaller towns meet in gatherings known as "trading clusters."

There are also aquatic equivalents of Traction Cities called Raft Cities which travel across the oceans hunting smaller raft suburbs and static island settlements. Notable Raft Cities include Puerto Angeles, Grimsby, Brighton and Marseille, most of which are coastal ports in the real world. Some smaller towns are amphibious, utilising inflatable air-tanks to float across water when neccesary.

Habitat

The most common area for Traction Cities to be found is Europe and Northern Asia, which is now a muddy wasteland called the 'Great Hunting Ground'. They are also prevalent in South America (now called Nuevo Maya), the Arctic (now called the Ice Wastes), India, the Sahara Desert, and Antarctica. North America has been reduced to a nuclear wasteland by the Sixty-Minute War and is known as the Dead Continent.

Static settlements, most of which are aligned with the Anti-Traction League, are found across the mountains of Central and South-East Asia, Southern Africa and the Andes.

Australia's condition is never specified. It is notably the only continent in the series that is never mentioned.
Traction cities

* Benghazi
* Chidanagaram
* Cittamotore
* Edinburgh
* Glasgow
* Gorky
* Gutak
* Jagdstadt Magdeburg
* Juggernautpur
* Kom Ombo
* London
* Manchester
* Montpelier
* Motoropolis
* Murnau
* Nizhny Novgorod
* Panzerstadt-Bayreuth
* Pandzerstadt-Linz
* Panzerstadt-Winethur
* Panzerstadt-Weimar
* Paris
* Prague
* Traktiongrad
* Xanne-Sandansky
* Zimbra

Traction towns and suburbs

* Turnbridge Wheels
* Salthook
* Speedwell
* Stayns

Raft Cities

* Brighton
* Grimsby (sunken)
* Marseilles
* Puerto Angeles

Ice Cities

* Anchorage
* Arkangel
* Breidhavik
* Kivitoo
* Wolverinehampton
* Reykjavík

Mag-Lev Cities

* New London
 
Thanks for the list of cities.... i plan on using city-states so i think ill have to pick out 18(?) of them. I also think raft cities would be a good idea too.
To tell the truth im not focusing on the map just right now.... i need to get the dirty work done first before i can start working with the map.
 
Good luck with your mod, would be cool if you got the mobile city thing worked out. :)
 
Ice Cities

* Anchorage
* Arkangel
* Breidhavik
* Kivitoo
* Wolverinehampton
* Reykjavík

I would ike to have these types of cities but wouldn't cant make up my mind on the detials. I was thinking of limiting them to ice, sea, and tundrea tiles. But there are many problems with this:

1) Ice and tundrea tiles won't produce any :food: (limited :hammers: )
2) Maps don't have that much ice
3) Would mean that an airship would have to travel way to fare to trade with other cities.
4) Movement (?)

im still considering this. If i can't find a way to fix the problems (or if i find some more) then i may have to eliminate these cities :(
 
Ok... Ive been away in italy for a week... But guess what i was doing? I read the last book in the series, A Darkling Plain... Is good.

By the way, about the Ice city problem... I thought mabe you could have different types of wheel-ie things, and each city will start with a certain one, but can use others later; some can be combined but others cannot (ill group them into main and auxiliary, each city can have one of each)

Wheels(main): fast speed on grasslands and plains, either reduced or no speed on other terrain... Probably cannot cross rivers.

Tracks(main): Average speed on all land terrain, can cross rivers.

Rails(auxilliary): fast speed on ice and sea-ice, and i dont know how you could do this but probably hard to turn. Does not work on other terrain.

Flotation buoys(auxilliary): can be used to cross rivers without penalty, and also travel in shallow water.

City Raft/paddle wheels(main): can travel on all water tiles... and probably allows construction of more water units, but cannot be combined with any other source of propulsion.

Any thoughts? Like my ideas?
 
Civkid1991 said:
I'm want to mod but theres a small problem with my idea. I want to have cities that move and act like units. I know this seems impossible, but looking at what some of what you all do (like gray fox, kael and the ffh team, TGA, ect) i think with a bit of help from the forum civver/modders i could possible bring my ideas into reality. Im going to download the sdk and fool around with that a bit and hopefull (after i refresh what i know about c++) will have some codes.

If you have any idea on how to make this work please help.... :thanx:

Edit: I decided to put down some basic ideas:
Concepts:
- City-States: All civs will be city states. In the book London was the only thing left to represent England (im guessing?) so what im thinking for right now is all of the civs will end up being city-states unless they make a permanent alliance with someone.
- Culture vs. Fuel : well because this is a Municipal-Darwinist word people invade your cultural boundaries (if they really existed lol) so im going to eliminate culture and replace it with fuel points. In the game workers will be replaced with engineers(?). Besides having the ability to help the mother city (and sacrificing itself to be used as fuel for that city) it could go out and collect various resources to use for fuel (cutting down, trees, retrieving the remains of old tech cities, harvesting coal and other natural resources).
- Some city specalists- Some of the specialists will be replaced or altered. Like the artist could produce +Happy faces or maybe we can have him do hard labor (^_^) and add +hammers (j/k). But im sure historian will be a specialist. If you can think of more or something to alter the please tell.
- Religion: I can't really remember what the religions were, but i do know some where like polytheistic.
- Undead: Will have some units that are living dead (o joy!)
- Barbs!: this is going to be one of the fun parts of the mod... the anti-traction league. The barbarian will be anti-tractionists. I'm not sure however if i should make them playable or barbian so tell me what you think.

If i think of something else ill post an update :)

City-states bit: I dunno where you are from so i dont know if you would have heard of them but there are tons of former english cities in ME;
Brighton, Tunbridge wheels, Manchester, Grimsby, the list goes on... But obviously they all operate seperate from one another so they would be city states.
Specialists: Yeah i like historian... And I think it should provide points for a "great archaeologist" unit that could possibly be sacrificed on some resource to provide a random peice of old-tech; for instance parts required for building stalkers, Armageddon-like weapons such as MEDUSA or ODIN or mabe the "Childermass Engines" hehe
Barbs: I would like to see anti traction as playable... Or how bout this.. Anti-traction barbs, and the Green Storm; their more organised and agressive cousins as a playable faction.
But also, i think it would be a good idea for there to be smaller, barbarian traction cities roaming the map from the start; providing 'food' for the main cities in the earlier game and only later when these start to become scarce, will the cites be forced to turn on each other (they would still have the ability to beforehand obviously).
 
Ok psycadelic_magi... ive been out of town but im back and ready to answer your questions.

I have to say now i've read the books a year or 2 ago and i've got the 3rd one from a friend (and haven't gotten to read it yet because i have some school stuff i have to do) but later i plan on re-reading it (or mooching off of yours and my friends knowledge of the series).

This is what i've come up while i was away:

Techs and Eras:
Rebirth:
Theme: Rise of post-60minWar Civilization
+ Fuel Mining: will allow Engineers to mine coal
+Botanical Adulteration: will allow Engineers to cut down forests
+Municipal Militia: will allow city to produce 3 national units: Municipal Police (alternate names: Social Police, Civil Police)
+ Reconnoiter: Can build Land Scouts
+Terra Firma Intensification: cities can get more fuel and food from land

Growth:
Theme: "Know that we have these moving towns, what next? " - Engineers at the traction lab of Traktiongrad
+Airfaring: Can begin to build airships and AirScouts
+International Linguestics: will allow specific culture buildings
+ Tier2 Expansion: will allow hamlets to become towns
+BioEngineering: prereq for Restless Silence: will city to produce suburban colonies (improvement)

Darwinism:
Theme: City Evolution

+Municuple Darwinism
+
+Tier3 Expansion: will allow towns to become Cities

Traction:
Theme: leading up to the traction golden age
+ Traction rail: Engineers can now lay down traction rails, which allows cities to move over land faster, but has the side effect of downgrading the land (grassland->plain->desert) Note* tile has to be deforested by a Engineer first
+ Airdocking : Allow access to the airdock (or should it be called the Air harbor or Airport ?)

Matalic:
Theme: "We've just triggered the golden age of Traction!" [NEWLINE] -Grand Council of Panzerstadt-Linz
+Tier3 Expansion: Will allow cites to become a metropolis -> allows access to other tiers (tier3+)
+ Lampits: Land-Sea units and allows acces to tier1 lampit dock
+ Air Infantry: Battle Airship
+ Restless Silence : Allows access to stalkers

Green:
Theme: Anti-Traction threat
+Enviromentalism: The begining of the anti-tractionist threat: can replant trees if civs have enviromentalism civic
+ Resettlement: will allow traction cities to settle in one place (hasn't been well developed yet)
+ Advanced Land infantry: Can build AdvLand Infantries

Future:
Theme: "What will the future hold for us...?" - Traction Union of the North Sea
+Traction Union
+ Old tech Revival (may be removed...)

Limited Access Techs:
Theme: Techs that can only be gained through finding them in old tech "goody huts" or sacrificing a historian or archeologist
+ Lasers: will allow founders access to laser infantry? Airships with laser promotion? MEDUSA?

Units:
+Grimsby Lostboy: this will either be a slaveish unit that will be produced if grimsby attacks a city or a early scout
+Grimship(i forgot what the sea-land units they sailed in where called): will be a grimsby only unit that is like a pirate ship (o and grimsby will have the piracy trait). It can steal resources (maybe) from other cities and is invisible.
+Great Historian
+Great Archeologist
+Stalkers (i believe they were called):undead units for those evil militaristic cities :)

well tell me what you think
~Civkid~
Edit: i thought this was a really good pick of anna fang from the book (found it at deviantart):anna fang

if anyone is interested in doing art.... it would be really helpful (not to mention cool) if someone could do a airship (if possible similar to the one in the pic in the link :) )
 
Civkid1991 said:
I have to say now though i read the books a year or 2 ago and i've got the 3rd one from a friend (and haven't gotten to read it yet because i have some school stuff i have to do) but later i play on re-reading it (or mooching off of yours and my friends knowledge of the series).

This is what i've come up while i was away:

Techs and Eras:
Rebirth:
Theme: Rise of post-60minWar Civilization
+ Fuel Mining: will allow Engineers to mine coal
+Botanical Adulteration: will allow Engineers to cut down forests
+Municipal Militia: will allow city to produce 3 national units: Municipal Police (alternate names: Social Police, Civil Police)
+ Reconnoiter: Can build Land Scouts
+Terra Firma Intensification: cities can get more fuel and food from land

Growth:
Theme: "Know that we have these moving towns, what next? " - Engineers at the traction lab of Traktiongrad
+Airfaring: Can begin to build airships and AirScouts
+International Linguestics: will allow specific culture buildings
+ Tier2 Expansion: will allow hamlets to become towns
+BioEngineering: prereq for Restless Silence: will city to produce suburban colonies (improvement)

Darwinism:
Theme: City Evolution

+Municuple Darwinism
+
+Tier3 Expansion: will allow towns to become Cities

Traction:
Theme: leading up to the traction golden age
+ Traction rail: Engineers can now lay down traction rails, which allows cities to move over land faster, but has the side effect of downgrading the land (grassland->plain->desert) Note* tile has to be deforested by a Engineer first
+ Airdocking : Allow access to the airdock (or should it be called the Air harbor or Airport ?)

Matalic:
Theme: "We've just triggered the golden age of Traction!" [NEWLINE] -Grand Council of Panzerstadt-Linz
+Tier3 Expansion: Will allow cites to become a metropolis -> allows access to other tiers (tier3+)
+ Lampits: Land-Sea units and allows acces to tier1 lampit dock
+ Air Infantry: Battle Airship
+ Restless Silence : Allows access to stalkers

Green:
Theme: Anti-Traction threat
+Enviromentalism: The begining of the anti-tractionist threat: can replant trees if civs have enviromentalism civic
+ Resettlement: will allow traction cities to settle in one place (hasn't been well developed yet)
+ Advanced Land infantry: Can build AdvLand Infantries

Future:
Theme: "What will the future hold for us...?" - Traction Union of the North Sea
+Traction Union
+ Old tech Revival (may be removed...)

Limited Access Techs:
Theme: Techs that can only be gained through finding them in old tech "goody huts" or sacrificing a historian or archeologist
+ Lasers: will allow founders access to laser infantry? Airships with laser promotion? MEDUSA?

Units:
+Grimsby Lostboy: this will either be a slaveish unit that will be produced if grimsby attacks a city or a early scout
+Grimship(i forgot what the sea-land units they sailed in where called): will be a grimsby only unit that is like a pirate ship (o and grimsby will have the piracy trait). It can steal resources (maybe) from other cities and is invisible.
+Great Historian
+Great Archeologist
+Stalkers (i believe they were called):undead units for those evil militaristic cities :)

well tell me what you think
~Civkid~
Edit: i thought this was a really good pick of anna fang from the book (found it at deviantart):anna fang

if anyone is interested in doing art.... it would be really helpful (not to mention cool) if someone could do a airship (if possible similar to the one in the pic in the link :) )

Ok first- Yes I have read all 4 books (you know there's four right?) Btw, the last book actually sees the fall of the traction cities completley.

Ok techs- Rebirth... Are we assuming here that traction has already happened, so we start the game on 1 TE? (traction era).
Municipal police eh? I see a UU here- London's Beefeaters.
On land scouts- I think that land units should be kept extremeley scarce for TC's... Remember how disgusted everyone is in the book about travelling on the surface? I suppose in the early game its ok, but im thinking that the bigger your cities get, units travelling on land will expreience rising attrition damamge, Making air-transports essential.

Green- first off, you should note that the Anti-Traction league had existed the whole time the traction cities did... The faction that should emerge/rise to become a threat is the 'Green storm' a fanatical offshoot of it, lead by the ressurected stalker anna fang. I think it is understood that the TC's and the ATL were in a complete stalemate until this point.

On units: The grimship you are thinking of is called the Limpet (should look like a small rusty submarine probably) ...Im assuming this is also what you meant by lampit lol
Raptors(stalker birds) should be in.
It should be noted that by the third book heavier-than-air aircraft have been invented, but they sound like small, crappy biplanes and monoplanes described as being made of 'balsa wood' lol.

On airships- I sent some pics of airships i thought looked good to Woodelf, he said hed see what he could do.

On Municipal Darwinism: I think it is important in the mod to have exaustable resources, since this is the whole reason that cites turn to MD in the first place, and i think that when you eat a city, all its buildings and onboard resources etc should be converted into production (although not neccecarily the same amount of production required to build the consumed cities buildings in the first place) in the late game this should eventually be the only way for a TC to develop.

PS what do you think of my 'city propulsion' ideas a few posts above?
Oh and I asked the folks on the graphics mod section about wether it would be possible to create a modelled base for a city to be mounted on (I.e a chassis) notice how quiet the thread has been since then? lol
 
Ok first- Yes I have read all 4 books (you know there's four right?) Btw, the last book actually sees the fall of the traction cities completley.

:mad: how uncool... i havent read the others

Ok techs- Rebirth... Are we assuming here that traction has already happened, so we start the game on 1 TE? (traction era).
Municipal police eh? I see a UU here- London's Beefeaters.
On land scouts- I think that land units should be kept extremeley scarce for TC's... Remember how disgusted everyone is in the book about travelling on the surface? I suppose in the early game its ok, but im thinking that the bigger your cities get, units travelling on land will expreience rising attrition damamge, Making air-transports essential.

Well rebirth is about 100 years after the 60minWar and traction has been started but this era is like the era like in vanilla where you do some exploreing and resource hunting.

Green- first off, you should note that the Anti-Traction league had existed the whole time the traction cities did... The faction that should emerge/rise to become a threat is the 'Green storm' a fanatical offshoot of it, lead by the ressurected stalker anna fang. I think it is understood that the TC's and the ATL were in a complete stalemate until this point.

the Green era is just the era when enviromentalism spreads to the traction cities and some of the anti-traction/green storm civs become more agressive toward traction cities. During the Metalic era the traction cities will have a slightly better units and building then the anti-tractionists (this is when they build up defences and stuff) and then in the green era is basicly the anti-traction/green storm "matalic" era

On units: The grimship you are thinking of is called the Limpet (should look like a small rusty submarine probably) ...Im assuming this is also what you meant by lampit lol
Raptors(stalker birds) should be in.
It should be noted that by the third book heavier-than-air aircraft have been invented, but they sound like small, crappy biplanes and monoplanes described as being made of 'balsa wood' lol.

On airships- I sent some pics of airships i thought looked good to Woodelf, he said hed see what he could do.
yes thats what i was talking about.. the limpet. Im going to say that all of the raft cities have access to them but grimsby will have the best one. Raptors sound good too. It would be great if woodelf did a airship. Thanks for asking him.

On Municipal Darwinism: I think it is important in the mod to have exaustable resources, since this is the whole reason that cites turn to MD in the first place, and i think that when you eat a city, all its buildings and onboard resources etc should be converted into production (although not neccecarily the same amount of production required to build the consumed cities buildings in the first place) in the late game this should eventually be the only way for a TC to develop.

About resources: I haven't developed this all the way but what im thinking about now is having "resource gathering" units. resource tiles will have diffrent stages of existence. If a gathering unit comes and gathers a resource lets say... about 5 times, then the resource is removed from the map. When the gathering unit comes back to the city it will allow that city access to that resource. Also that city (if it and the city its trading with has a trade office (name?) ) will beable to send like merchant units to trade with the other city.

It may seem confusing now but when i work out the bugs itll be much better. Hopefully i can reconstruct trade. :)

For the buildings and etc being turning into production... it would be hard to do but... my origanle plan was to have the cities literaly act as units. if you attack a city that doesn't mean you destroy it (unless you have a higher strenght of course) but it will lose strenghth like units... the city can heal too. And i was also thinking if a city was attacked slaves would be produced. If i remember correctly in the story if a city was attacked and a few peopel were taken in too they would be turned into slaves. All of the other stuff gotten from the city would then be turned into fuel.

For grimsby i was going to add a lost boy unit... if grimsby attacks another city then they get a lost boy(slave). And one of their other national units lost boy (scout) could steal back some of the lost boys that were taken from their city during an attack. The lost boy, like many of the other grimsby units, will be invisable to most other civs.

PS what do you think of my 'city propulsion' ideas a few posts above?
Oh and I asked the folks on the graphics mod section about wether it would be possible to create a modelled base for a city to be mounted on (I.e a chassis) notice how quiet the thread has been since then? lol

I'm not sure about this... now that i think about it though it would make a good "national wonder" type "building". I was planing on having rails come with one of the techs. I dont think ive mentioned this before but all cities will have movement points so if a city builds say the bouys then they will get an extra movement point.

I do have a friend that is going to do a city graphic for me but if you what to ask around in the forum it would be cool too. I do need diffrent models for diffrent types of civs and city types.

~:king: Civkid~

oh and if anyone whats to do a bit of research that would be helpful too... i know very little about the cities (all except london, grimsby, and maybe anchorage).
 
Question:

What would be the best way to go? -> Using an "invisable" unit to represent the cities movment and strength... it would also have the buttons for attacking other cities, Using the SDK to edit the city, or us Python... Which one of these work the best when playing the mod?
 
Civkid1991 said:
Question:

What would be the best way to go? -> Using an "invisable" unit to represent the cities movment and strength... it would also have the buttons for attacking other cities, Using the SDK to edit the city, or us Python... Which one of these work the best when playing the mod?

By "invisible", do you mean that it would have an INVISIBLE_WHATEVER trait (like how the submarine has a INVISIBLE_SUBMARINE), or do you mean that the unit just would have no model? I'm assuming the second, because I don't think the first will help you out much.

This is a tough challenge, and I'm pretty sure that you're exploring unexplored ground. In Civcraft, I've made a city into a unit to give it HP (although I'm using a different attack and HP scheme, but it's a CvUnit anyway even though I don't let it attack). The actual unit model is just the empty.nif model (I've also removed all the extra little buildings, so the cities look "empty". The only graphics to the plot is literally just the culture coloring). However, because the cities don't move (although I plan on adding the functionality later in the project) I don't really have the same problem you're having.

What I plan on doing is making it so that there is a special order in the city that, when clicked on, "converts" the city into a unit. Basically, it will take the city off the map (but not destroy it, which I believe is possible. If not, I can just make a data structure to store all the data in myself). Then, it will make the actual unit movable. Then, the unit has a little mission icon where it can "settle" down and place it's city in the new spot.

Of course, it sounds like your cities will be more active, so for a player to have to click on the city, put it into moving mode, move the city, than settle it again would be annoying. This would also mean that your movement icons (and any other missions whose icons you'd want the cities unit's to have) wouldn't be visible in the city screen, and likewise, the city icons (building units, buildings, etc.) wouldn't be visible in the unit's screen.

So, I guess one thing to work around is the idea that you are probably going to have to eventually pick either the unit or the city to work as your "base", and all the orders (whether unit or city in nature) must be able to be done with that base. Thus, you need to be able to build units and buildings while still being able to right-click to move or hit fortify. I would recommend taking all the actions you want a city's unit to be able to do, and make them city orders. In the SDK, you can make your own city orders and define what they do. These can simply be a matter of getting the city's unit from the plot it's standing on, and calling the correct function (just like the mission would do).

You could do it the other way, putting all the city functions into the unit, but I think that there's less unit functions, and they're not as varied (unit's typically start and end with the same missions, where as the list of a city's orders grow over time when new unit and building's become available).

Doing it this way, you have two things you'll have to watch out for:

1.) When you select the unit, generally, you'll probably want it to select the city. I haven't tried this, but perhaps there's somewhere in the SDK where you can find out what unit has just been selected, and then call code to select the city for the player. This way, whenever they select the unit, control actually goes to the city. This would be seemless to the user, and make the user feel like the city IS the unit.

2.) When you have a city selected, right-clicking on a plot will not work. You can set up shop somewhere in an event handler to find out if a plot has been right clicked, then push a move_to mission of the unit who's city is selected (but you probably want to make sure that there aren't other things that a person would right-click on with the city selected. For example, I think you hit some buttons + right click to set a rally point).

Hope that gives you some ideas. The moveable-city idea sounds really intersting, I'd love to see it come through!
 
Gerikes said:
Doing it this way, you have two things you'll have to watch out for:

1.) When you select the unit, generally, you'll probably want it to select the city. I haven't tried this, but perhaps there's somewhere in the SDK where you can find out what unit has just been selected, and then call code to select the city for the player. This way, whenever they select the unit, control actually goes to the city. This would be seemless to the user, and make the user feel like the city IS the unit.

2.) When you have a city selected, right-clicking on a plot will not work. You can set up shop somewhere in an event handler to find out if a plot has been right clicked, then push a move_to mission of the unit who's city is selected (but you probably want to make sure that there aren't other things that a person would right-click on with the city selected. For example, I think you hit some buttons + right click to set a rally point).

Hope that gives you some ideas. The moveable-city idea sounds really intersting, I'd love to see it come through!

Ok thanks for this... based on what you said im thinking of taking out all of the city buildings. You said in your mod you have a "city" with just the cultural border showing... for this i could have the city "invisalbe" and place a unit with the city graphic (like maybe a tier 1 city graphic and then have an upgrade button to give it another tier or somthing) on the plot that's were the city would be. This way (if i find out how to solve that click-unit-to-get-cityscreen problem) i can use "spells" (like your spell mod you have or the ones from ffh) to move the city or to attack another city (it would also make attack animation easier too).

ty

~:goodjob: Civkid~

Edit: Im still not sure about saving data though (how would i do this?) but for destroying the city i think theres a function called "kill()" in the city sdk file (haven't checked python yet)

Edit2: I think i can also get the city (which would mean the whole civ) to be distoryed if the "invisible" unit is destoryed
 
Civkid1991 said:
Ok thanks for this... based on what you said im thinking of taking out all of the city buildings. You said in your mod you have a "city" with just the cultural border showing... for this i could have the city "invisalbe" and place a unit with the city graphic (like maybe a tier 1 city graphic and then have an upgrade button to give it another tier or somthing) on the plot that's were the city would be. This way (if i find out how to solve that click-unit-to-get-cityscreen problem) i can use "spells" (like your spell mod you have or the ones from ffh) to move the city or to attack another city (it would also make attack animation easier too).

ty

~:goodjob: Civkid~

Yeah, that sounds like a good idea, it would def. help with the animations. Cities would kinda all look the same, but it's a pretty unnoticable thing.

Edit: Im still not sure about saving data though (how would i do this?) but for destroying the city i think theres a function called "kill()" in the city sdk file (haven't checked python yet)

Destroying the city is the easy part. Taking a city and moving it to another plot might be tough. I bet, though, that if you set a city to an invalid map coordinate (like how units start at coordinate points -34232625 or something before being moved to their actual starting location) you can effectively take it off the screen, so long as you can make sure that the game doesn't try to draw it or do any of the updates on it (which can probably be done by returning early out of specfici CvCity functions).

If that doesn't work, there are probably a dozen other ways to save the data from the city, even if it means making a whole new city object, writing a copy constructor to copy all the data over to it, and deleting the old city. Then, when putting it in it's new place, making a new city, copy all the old cities saved data back into it, then deleting the temporary saved copy of the city.
[/QUOTE]

Edit2: I think i can also get the city (which would mean the whole civ) to be distoryed if the "invisible" unit is destoryed

Yup, that one's no problem. I was able to accomplish this by checking whenever a unit dies if the unit is really the embodyment of a building (in Civcraft, a city is really just one "building"). If it was, then destroy the city that was in it's plot.
 
I also need to find out how to add in fuel... the tiles are supposed to produce fuel and fuel can be gained with resources and special units. keal told me about a mod that has magic as a plot yeild but i haven't look through it yet.

This will effect whither or not the city can move. I'm also considering removing culture (if thats not to hard) and replaceing fuel yeild in the place were culture was displayed.

For the saving... would it be best to save it into an array or dictionary using python or should make a log that "saves" the stuff and recalls it later(would this work?)
 
Back
Top Bottom