Case Study: How to make multi-domain units

Many thanks for doing this. Just the other day, I was thinking "We need How To tutorials on specific tasks: that would really help out those less confident". So thanks again. Do you think that you'll be doing any more?
 
sure i'm planning a complete write up of my new-styled gunship, that will fly over water, land on carriers and die at sea (can't land on ocean eh.) No more loading them into transports either, thats kinda bogus.
 
I wish I had seen this thread before doing my <bFlying> mod, although I still would have added a new tag rather than reuse an existing one, just for the epexrience of doing it.

Kael,

There are a few more things I think you need to do that you didn't mention in the tutorial. Did you check combat of your land units over water? You may find some unintended effects. I'm at work now so I don't have the code with me but you can download my flying mod and look at what I did there.
I found that there is a section of the SDK that checks if a unit can defend and if it can't defend it alway loses the battle. Land units, be default, can't defend on a water tile. so, I noticed that my gunships would die to a simple galley 100% of the time. You need to change the canDefend() function in the SDK. Also, are you seeing combat odds when you hold down the alt key before an attack? I remember I had to change something else so that the combat odds would show up. Good work on the tutorial though.

Roger Bacon
 
RogerBacon said:
I wish I had seen this thread before doing my <bFlying> mod, although I still would have added a new tag rather than reuse an existing one, just for the epexrience of doing it.

Kael,

There are a few more things I think you need to do that you didn't mention in the tutorial. Did you check combat of your land units over water? You may find some unintended effects. I'm at work now so I don't have the code with me but you can download my flying mod and look at what I did there.
I found that there is a section of the SDK that checks if a unit can defend and if it can't defend it alway loses the battle. Land units, be default, can't defend on a water tile. so, I noticed that my gunships would die to a simple galley 100% of the time. You need to change the canDefend() function in the SDK. Also, are you seeing combat odds when you hold down the alt key before an attack? I remember I had to change something else so that the combat odds would show up. Good work on the tutorial though.

Roger Bacon

Yeah, its just an example. We canged the canDefend algo too. Nowdays FfH uses a promotion to control if a land unit can travel over water or not. So the ability can be added and removed dynamically.
 
So here's a question from a mod-chieftain to all the mod-deitys out there.

I wouldn't want to start changing any codes myself. Considering my lack of knowledge in this area I'm afraid to "mess thing up". Is there a possibility for you to create a file for me and others to download and replace an old file with? (Thats about how far I would dare to go at the moment.:))

I courious to see if a small boat with a carrying-capacity, that could travel rivertiles and coastal tiles, would be a good adding to the game.
 
Ingvina Freyr said:
So here's a question from a mod-chieftain to all the mod-deitys out there.

I wouldn't want to start changing any codes myself. Considering my lack of knowledge in this area I'm afraid to "mess thing up". Is there a possibility for you to create a file for me and others to download and replace an old file with? (Thats about how far I would dare to go at the moment.:))

I courious to see if a small boat with a carrying-capacity, that could travel rivertiles and coastal tiles, would be a good adding to the game.

Unfortunatly the files contain multiple changes so a modified file will only be helpful against a vanilla civ build. This write-up was done more to help new SDK developers than to be used (the article was released on the same day as the SDK).

If you want just multi-domain units on a vanilla build I would recommend using RogerBacon's bFlying modpack, which gives you all fo this functionality without having to do the programming yourself.
 
Kael said:
Ive been out of america for a few weeks now, did something happen to Atlanta?!? :D

Amy: So, Fry, Atlanta was an American city in your time?

Fry: I think it was just an airport. They had a place where you could buy nuts.

Umbriel: No! Ancient Atlanta was more than just a Delta hub. It was a vibrant metropolis, the equal of Paris or New York.

Fry: That's right, honey! Whatever you say.

Umbriel: Look at these fabulous ruins. Turner Field, the Coca-Cola bottling plant, the, uh, the airport.

Leela: But tell us, how could a city with such a ... fabulous airport end up underwater?

Colonel: Ah, now that's a story that can only rightly be told in a Chamber of Commerce video narrated by folk-rock troubadour Donovan.
 
Hi guys.

I would like to use this for my smac mod to make gravships.

For those of you that know about Alpha Centauri, Would this be the best way to achieve gravships, as well as locusts of chiron?

If anyone would like to help out with this, I would be most grateful.
 
Hi guys.

I would like to use this for my smac mod to make gravships.

For those of you that know about Alpha Centauri, Would this be the best way to achieve gravships, as well as locusts of chiron?

If anyone would like to help out with this, I would be most grateful.

Probably, if you want those ships to be able to cross over land and water tiles this is what you want.
 
Hi Kael!

Thanx for a great tutorial. Have tried to follow exactly the instructions you have given, unfortunately my Gunship is still gunshy! Wanted a Gunship that would take out units along the coast. Have changed the unit specs to canmoveimpassable; however made oceans still impassable. Is there something I am missing, please? Thanx!
 
Did you compile and use the resulting DLL? This is an easy mistake to make.

One way to check this is to pop up a window, write to a file on your hard drive with a time stamp, or otherwise create a visible effect that you can detect.

Can you go over and check each change Kael listed, and make sure it is in the code? Missing one or two could easily make Kael's solution not work.
 
Hi Yakk! Thanx for replying.

You mean that after editing the ccp files, I still need to compile the DLL? Damn! I was hoping to avoid that. I'm no programmer.
 
*laugh*

Tech Support Rule 1: First ask the person if the computer is plugged in!

Yes. .cpp files are simply instructions to the computer on how to build an executable (.exe) or dynamic link library (.dll) or other pile of compiled computer code.
 
Note, this is no longer required with BtS, all you have to do is set the bCanMoveAllTerrain attribute on the unit to do this.
 
Note, this is no longer required with BtS, all you have to do is set the bCanMoveAllTerrain attribute on the unit to do this.

fantastic, now if WE (you) could get them to do the animal to enter territory, we'd be all set!!!:p
 
fantastic, now if WE (you) could get them to do the animal to enter territory, we'd be all set!!!:p

Yeah, I worked around this in AoI by creating a new unitcombat type (UNITCOMBAT_ANIMAL) and switching all the animals from bAnimal to UNITCOMBAT_ANIMAL. Then instead of giving units bonuses against animals they just got bonuses vs the UNITCOMBAT_ANIMAL type (so it worked out the same). And since the animals technically weren't "animals" they don't have any border restrictions.

The only problem is that it also means they won't spawn as animals do in the world. Not a problem if you are making a scenario and can place them manually on the map, but it is a concern for random maps.

In early versions I had a check in the new canmoveinto python function that would stop barbarian owned animals from entering owned tiles, but by the end I remover it just because dangerous threatening animals match the flavor of AoI better.

But the short answer is that your right. I wish that the "border" restriction was only applied to barbarian controlled animals instead of the whole batch.
 
Back
Top Bottom