| General | Hosted Sites | Civ5 | CivRev | Civ4Col | Civ4 | Civ3 | Civ2 | Civ1 | Misc | Marketplace |
![]() |
|
|
Welcome to Civilization Fanatics' Center. You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support. |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Chieftain
Join Date: Dec 2005
Posts: 39
|
Airport (An Interface Mod without Modding Ingame.lua or Worldview.lua)
This builds off of the thread I started in the Main C&C Forum - however this is a completed version of the Mod, so this forum is more appropriate.
Airport Required Tech: Flight Cost: 600 ![]() Maintenance: 5 ![]() Purpose: When an Airport is built in a city, it allows a unit to be Airlifted to another city that also has an Airport, assuming that destination city does not have a Non-Garrisoned unit already. Late-game War, especially on bigger maps, is bogged-down by moving units great distances. This helps that problem (for the user, anyway.) Compatability: Should be compatable with any Mod that does NOT use the Airlift InterfaceMode. This building makes use of one of the left-over Civ4 stubs, the Airlift "mission" that was not otherwise implemented in Vanilla Civ 5. Included with this Mod, however, are UI treatments and restrictions on the standard Airlift logic when the mission is selected. When a unit is selected for Airlift, hexes under each of the user's Cities are highlighted in Green or Red indicating whether or not the unit can be Airlifted to that destination. Once the user clicks the left-mouse (typically to send the unit to its intended destination city), logic within this mod will determine if the Unit should actually be sent to the destination or not. For example, the vanilla "Airlift" functionality was to allow the Unit to be sent to any of the user's cities, regardless of whether or not the destination had an Airport or already had a non-garissoned unit there. When I first made that other post, I mentioned that it required modifying Ingame.lua and Worldview.lua to achieve the kind of experience I was looking for with a Mod like this. I've since gone and figured out how to get what I wanted without modifying those files - something that I have not seen fully documented here (or much in general), although this post from Omni covers the stuff that I had previously placed into WorldView.lua. The Hex highlighting, which was previously tacked into Ingame.lua, is accomplished by registering my mod with the Events.InterfaceModeChanged event. My mod will check if the InterfaceMode has changed to INTERFACE_AIRLIFT, and if so, it will do the Hex highlights and allow whatever else is registered with InterfaceModeChanged to do what it needs to. If the previous InterfaceMode was for airlift, it will clear all of the Hex highlights. Spoiler:
For the logic that controls whether or not a unit can be sent to the destination City, I used ContextPtr:SetInputHandler and took action on LButtonUp. If the selected Hex allowed for a unit to be airlifted to it, then I did the work required and passed the message into the Game.SelectionListGameNetMessage function (as seen in WorldView.lua in a few places), and returned true from my handler indicicating that the LButtonUp action had been handled. Spoiler:
Issues: - No idea if the AI could make use of this. I would assume not. - Does not create a Trade Route, as much as I would love it to do so. - I can't get my GameSpy account to work, so I can't actually upload the Mod to be grabbed inside of the game. I used the Export function on ModBuddy to create a template and have attached it here. - My kids are clamoring for my attention and my wife is giving me the evil eye, so I don't remember what other issues there might have been. |
|
|
|
|
|
#2 |
|
2nd Legionary Cohort
Join Date: Jul 2005
Location: Earth
Posts: 253
|
Do you think it would be possible to make it so airports give trade routes? Im playing around with the idea of a mod myself and that would be a part of it.
__________________
“May you love like you've never been hurt, dance like no one is watching, sing as if no one were listening, screw like it's being filmed, and drink like a true Irishman” |
|
|
|
|
|
#3 | |
|
Emperor
Join Date: Nov 2003
Posts: 1,702
|
Quote:
__________________
The best intentions are fraught with disappointment
|
|
|
|
|
|
|
#4 |
|
Chieftain
Join Date: Dec 2005
Posts: 39
|
(Traderoutes) I'd played with it before - there isn't an attribute that can be added to a building that would do it, as best I can tell. The Harbor, for example, has the "AllowsWaterRoutes" attribute, but that seems to control whatever mechanism is responsible for calculating whether or not a city is connected to the capital. I think the calculation (of whether or not it's connected to the capital) is not something that can be accessed at the moment.
IF it can, though, it would be ideal - right now, a land-locked city on another contentent cannot possibly be connected via Trade Route, I believe. |
|
|
|
|
|
#5 |
|
Warlord
Join Date: Jan 2004
Posts: 157
|
awesome! thanks
Would it be possible to make it so that this also works with airports that workers build on tiles? (or combine its function with forts instead of adding another tile-improvement - thou i'd prefer a new tile improvement ).
|
|
|
|
|
|
#6 |
|
Le Just Derpin' Around ~
Join Date: Jun 2011
Location: Los Angeles!
Posts: 125
|
Actually, I'm pretty sure that there can be a trade route with a landlocked city on different continent than the capital. If I'm right you just need a city with a harbor on the continent with the landlocked city. Then just build a road between them. I may be wrong, but I'm almost certain you can do this.
|
|
|
|
|
|
#7 |
|
Warlord
Join Date: Sep 2005
Posts: 294
|
how to install it
where i save this in to |
|
|
|
![]() |
| Bookmarks |
|
| Thread Tools | |
|
|