Helicopter units

Murderologist

Warlord
Joined
Jul 14, 2014
Messages
162
I know VP changes helicopters into Archery units. I have a mod that add helicopters to the game. I can edit the combat class and change them to Archery but then they don’t receive the helicopter line of promotions. If I leave them as helicopter combat class they get the promotions but I cannot select them. How do you get the unit to behave as the regular helicopter gunship?
 
It needs "Promotion hovering unit" see the code following this:

INSERT INTO Unit_FreePromotions
(UnitType, PromotionType)
VALUES
('UNIT_FW_APACHE', 'PROMOTION_FLAT_MOVEMENT_COST'),
('UNIT_FW_APACHE', 'PROMOTION_HOVERING_UNIT'),
('UNIT_FW_APACHE', 'PROMOTION_ANTI_TANK'),
('UNIT_FW_APACHE', 'PROMOTION_NO_DEFENSIVE_BONUSES'),
('UNIT_FW_APACHE', 'PROMOTION_NAVAL_MISFIRE'),
('UNIT_FW_APACHE', 'PROMOTION_CAN_MOVE_AFTER_ATTACKING'),
('UNIT_FW_APACHE', 'PROMOTION_ONLY_DEFENSIVE'),
('UNIT_FW_APACHE', 'PROMOTION_HOVER_UNIT'),
 
It already has that in the free promotion. Something is stopping me from being able to select promotions period whether the unit is created by a city or force promoted with IGE, I cannot select any promotions as long as the Combat Class remains HELICOPTER. If I switch it to Combat Class ARCHER i can then select the promotions but its only the promotions your standard archer or composite bowman would get not that of a HELICPOTER unit
 
이미 무료 프로모션에 그런 내용이 있습니다. IGE로 승격된 도시 또는 군대에서 유닛을 생성했는지 여부에 관계없이 승격 기간을 선택할 수 없는 문제가 있습니다. 전투 클래스가 HELICOPTER로 유지되는 한 승급을 선택할 수 없습니다. Combat Class ARCHER로 전환하면 승격을 선택할 수 있지만 표준 궁수 또는 복합 궁수에게만 제공되는 승급은 HELICPOTER 유닛의 승급이 아닙니다.
vp eleminated "unicombat_helicopter" you can see that 4 mods folder.
 
by combat class i assume you mean 'UNITCOMBAT_HELICOPTER'... Its a little unclear to me what exactly you are experiencing, when you say you cannot "select promotions"; are there promotions available in UI that cannot be clicked? Or are there just no promotions visible to be selected?

I would expect the latter; I believe VP deleted all the promotions assigned to UNITCOMBAT_HELICOPTER, so there are simply none to select from.

To use UNITCOMBAT_HELICOPTER with promotions, you would have to add promotions to UnitPromotions_UnitCombats table first; that table controls what promotions are available to each unitcombat type (sometimes referred to as CombatClass, depending which table you are looking at)

If you use UNITCOMBAT_ARCHER then you will get access to the archer promotions, as you described. I think there are some additional workarounds to control promotion access, possibly via other tables, or via lua. However I *think* you'd get what you want if you rebuild a promotion tree for UNITCOMBAT_HELICOPTER and use that one for your mod units

its been a while since I've attempted to do anything with UNITCOMBAT_HELICOPTER but can confirm it did still work in VP as of a few years ago, I don't think the entire unitcombat type was ripped out, just most database entries referring to it...
 
Last edited:
So I changed it to Archer I can now select promotions but again they are not the promotions that the standard Helicopter unit the VP has its missing the likes of March, Coup De Gra, Encirclement, etc. If I leave the combat class as Helicopter it has all the proper promotions but I CANNOT select them. They are there and visible but not selectable. The promotions only become selectable after I change the combat class to ARCHER and then it becomes just that an Archer with the promotion tree resembling that of a composite bowman or regular archer. Not that of the standard new VP Helicopter unit.
 
by combat class i assume you mean 'UNITCOMBAT_HELICOPTER'... Its a little unclear to me what exactly you are experiencing, when you say you cannot "select promotions"; are there promotions available in UI that cannot be clicked? Or are there just no promotions visible to be selected?

I would expect the latter; I believe VP deleted all the promotions assigned to UNITCOMBAT_HELICOPTER, so there are simply none to select from.

To use UNITCOMBAT_HELICOPTER with promotions, you would have to add promotions to UnitPromotions_UnitCombats table first; that table controls what promotions are available to each unitcombat type (sometimes referred to as CombatClass, depending which table you are looking at)

If you use UNITCOMBAT_ARCHER then you will get access to the archer promotions, as you described. I think there are some additional workarounds to control promotion access, possibly via other tables, or via lua. However I *think* you'd get what you want if you rebuild a promotion tree for UNITCOMBAT_HELICOPTER and use that one for your mod units

its been a while since I've attempted to do anything with UNITCOMBAT_HELICOPTER but can confirm it did still work in VP as of a few years ago, I don't think the entire unitcombat type was ripped out, just most database entries referring to it...
Promotions available in the UI but not selectable if I leave it as UNITCOMBAT HELICOPTER. Promotions are selectable but not that of the UNITCOMBAT HELICOPTER if I change the UNITCOMBAT to ARCHER
 
So I changed it to Archer I can now select promotions but again they are not the promotions that the standard Helicopter unit the VP has its missing the likes of March, Coup De Gra, Encirclement, etc. If I leave the combat class as Helicopter it has all the proper promotions but I CANNOT select them. They are there and visible but not selectable. The promotions only become selectable after I change the combat class to ARCHER and then it becomes just that an Archer with the promotion tree resembling that of a composite bowman or regular archer. Not that of the standard new VP Helicopter unit.
yes, promote hovering unit -> Anti tank .. // VP deleted about UNICOMBAT_HELICPOTER. SO you can see only promotion tree (this has not function) open (4) promotion mode.. you can see why can not choice helicopter.
 
Promotions available in the UI but not selectable if I leave it as UNITCOMBAT HELICOPTER. Promotions are selectable but not that of the UNITCOMBAT HELICOPTER if I change the UNITCOMBAT to ARCHER
okay this is unexpected; if you have everything mocked up already, can you post screenshot of unit created via each alternative (ie helicopter vs archer unitcombat)? I might be able to understand it better that way.

Its *possible* VP somehow disabled UNITCOMBAT_HELICOPTER in a way that cannot be used anymore -- I dunno why but devs here chose to break various useful vanilla things just cuz they sat unused in VP mod, rather than leave them available to modders :dunno:. I am still leaning towards UNITCOMBAT_HELICOPTER just needing tables rebuilt to be useable, rather than fully removed though.
 
yes, promote hovering unit -> Anti tank .. // VP deleted about UNICOMBAT_HELICPOTER. SO you can see only promotion tree (this has not function) open (4) promotion mode.. you can see why can not choice helicopter.
I added the promotion you said "hovering unit" changed it to ARCHER same thing it still does not have all of the the helicopter promotions. I understand VP got rid of the HELICOPTER COMBAT class but the promotion line for them is still unique to them. Thats what im after im trying to get that promotion line for my new unit.
 
I added the promotion you said "hovering unit" changed it to ARCHER same thing it still does not have all of the the helicopter promotions. I understand VP got rid of the HELICOPTER COMBAT class but the promotion line for them is still unique to them. Thats what im after im trying to get that promotion line for my new unit.
('PROMOTION_HOVERING_UNIT'),
('PROMOTION_HOVER_UNIT'),

After entering these two codes, use “IGE” to promote. Then, a promotion that makes it "stronger against tanks" will appear. This is an upgrade that symbolizes its function as a helicopter.

and..Using Lua, you can display the helicopter screen on a specific unit.
 
Screenshot (1).png
Screenshot (2).png
Screenshot (3).png
Screenshot (4).png

So you can see now. My Unit the AH-64 Does not have the promotion tree the UNITCOMBAT HELICOPTER in VP has. If I change it to UNITCOMBAT HELICOPTER it will have the same tree as the standard VP Helicopter unit BUT none of the promotions are selectable like the VP UNIT. ONLY if I change the UNIT COMBAT to ARCHER can I select promotions but they are clearly NOT the Helicopter line of promotions. The standard VP Unit has the ARCHER Combat class with the Helicopter promotion line. Hope this helps explain it more.
 
- need to convert the potentially "false" UnitCombat to our correct one using the specific unit type
-- in particular we need to check if we have a "Gunpowder unit" that is really an AA unit and
-- if we have an Archery unit, which could either be a helicopter or a mounted archer (or a regular one)
-- if the unit is a gunpowder unit, we should query if it has a relevant AirInterceptRange
-- if the unit is an archery unit, we should first query if it has the type UNIT_HELICOPTER_GUNSHIP and if not, if it is mounted
if (sDisplayClass == "UNITCOMBAT_GUN" and pUnit:GetAirInterceptRange() > 0) then
sDisplayClass = "UNITCOMBAT_AA"
elseif (sDisplayClass == "UNITCOMBAT_ARCHER") then
if (pUnit:GetUnitType() == GameInfoTypes.UNIT_HELICOPTER_GUNSHIP) then
sDisplayClass = "UNITCOMBAT_HELICOPTER"
elseif (pUnit:IsMounted()) then
sDisplayClass = "UNITCOMBAT_MOUNTED_ARCHER"
end
end
PlacePromotions(pUnit, sDisplayClass, iUnitBoxX + iUnitBoxSizeX, iCentreLine)
end

editing LUA

"promotiontree.lua"
 
View attachment 672072View attachment 672073View attachment 672074View attachment 672075
So you can see now. My Unit the AH-64 Does not have the promotion tree the UNITCOMBAT HELICOPTER in VP has. If I change it to UNITCOMBAT HELICOPTER it will have the same tree as the standard VP Helicopter unit BUT none of the promotions are selectable like the VP UNIT. ONLY if I change the UNIT COMBAT to ARCHER can I select promotions but they are clearly NOT the Helicopter line of promotions. The standard VP Unit has the ARCHER Combat class with the Helicopter promotion line. Hope this helps explain it more.
I also looked into it because of the future mode, and the functions work the same just by adding a promotion, and the parts that require “UI” can be created using LUA. I was lazy so I just didn't do any work on it. If you create a mode by adding the unit code to the file written above as LUA, it will work well.
 
The language you guys are using is somewhat imprecise, I think something's getting lost in the back-and-forth interpretation here:

There are two alternatives:
  1. If you want your unit to receive the exact same promotion tree as helicopter gunship, it must have the correct entries in Unit_FreePromotions table, ie all the same ones as helicopter gunship, you must do this in xml or sql (i'd recommend the latter). It must also be UNITCOMBAT_ARCHER
  2. On the other hand, if you want to give it a separate, unique helicopter-only promotion tree, you must add all the promotions you want it to access to UnitPromotions_UnitCombats and thus rebuild UNITCOMBAT_HELICOPTER promotion tree, then make sure the unit is UNITCOMBAT_HELICOPTER. In this option you still need to configure Unit_FreePromotions table for any promotions you want it to have as soon as its created.
I *think* you want to achieve option 1, from what I am reading....
 
I also looked into it because of the future mode, and the functions work the same just by adding a promotion, and the parts that require “UI” can be created using LUA. I was lazy so I just didn't do any work on it. If you create a mode by adding the unit code to the file written above as LUA, it will work well.
I Have no idea how to do that. Im very very basic with editing XML. I wouldn't even know where to begin with that.
 
The language you guys are using is somewhat imprecise, I think something's getting lost in the back-and-forth interpretation here:

There are two alternatives:
  1. If you want your unit to receive the exact same promotion tree as helicopter gunship, it must have the correct entries in Unit_FreePromotions table, ie all the same ones as helicopter gunship, you must do this in xml or sql (i'd recommend the latter). It must also be UNITCOMBAT_ARCHER
  2. On the other hand, if you want to give it a separate, unique helicopter-only promotion tree, you must add all the promotions you want it to access to UnitPromotions_UnitCombats and thus rebuild UNITCOMBAT_HELICOPTER promotion tree, then make sure the unit is UNITCOMBAT_HELICOPTER. In this option you still need to configure Unit_FreePromotions table for any promotions you want it to have as soon as its created.
I *think* you want to achieve option 1, from what I am reading....
YES! Option 1 lol Ok i will change the promotions to that of the Free promotions from the standard unit
 
Top Bottom