Helicopter units

I think you want to look back at azum4roll's post, specifically where he mentions Unit_FreePromotions sql command.

So, if you are using SQL, your mod should have something like
Code:
INSERT INTO Unit_FreePromotions    (UnitType,                     PromotionType)
SELECT                               'UNIT_APACHE_HELICOPTER',    PromotionType
FROM Unit_FreePromotions WHERE UnitType = 'UNIT_HELICOPTER_GUNSHIP';

Alternatively you could manually look at all the entries for helicopter gunship in Unit_FreePromotions table and re-create them for apache in XML. SQL is more efficient alternative, XML easier to understand (though can get very tedious as your mod gets more complex).
 
I think you want to look back at azum4roll's post, specifically where he mentions Unit_FreePromotions sql command.

So, if you are using SQL, your mod should have something like
Code:
INSERT INTO Unit_FreePromotions    (UnitType,                     PromotionType)
SELECT                               'UNIT_APACHE_HELICOPTER',    PromotionType
FROM Unit_FreePromotions WHERE UnitType = 'UNIT_HELICOPTER_GUNSHIP';

Alternatively you could manually look at all the entries for helicopter gunship in Unit_FreePromotions table and re-create them for apache in XML. SQL is more efficient alternative, XML easier to understand (though can get very tedious as your mod gets more complex).
I don't think you understand. What this person wants is to see a promotion tree visible from the helicopter in the "UI". (see his screenshot). This is only possible with LUA. promotiontree.Lua must be modified in the (4) promotion folder.
 
I think you want to look back at azum4roll's post, specifically where he mentions Unit_FreePromotions sql command.

So, if you are using SQL, your mod should have something like
Code:
INSERT INTO Unit_FreePromotions    (UnitType,                     PromotionType)
SELECT                               'UNIT_APACHE_HELICOPTER',    PromotionType
FROM Unit_FreePromotions WHERE UnitType = 'UNIT_HELICOPTER_GUNSHIP';

Alternatively you could manually look at all the entries for helicopter gunship in Unit_FreePromotions table and re-create them for apache in XML. SQL is more efficient alternative, XML easier to understand (though can get very tedious as your mod gets more complex)
I tried what you said with the free promotions that didint work. I found the folder you mentioned @CAYM What do i need to change or add in here?
 
I tried what you said with the free promotions that didint work. I found the folder you mentioned @CAYM What do i need to change or add in here?
- 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

change UNIT_~~~~~*(your UNIT SOURCE)
 
- 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

change UNIT_~~~~~*(your UNIT SOURCE)

ONLY CHANGE RED COLOR/
 
you're right I misunderstood -- the promotion tree ui indeed is another issue altogether. Its completely separate from what you can actually select as promotion, however, keep that in mind. ie its possible to get the tree UI to show up as desired, but still not be able to select the desired promotions in-game. Anyway I assume you have the latter aspect figured out.

edit: I think you may want to use an "or" and add a second condition, rather than change the helicopter reference directly? ...and add another "or" conditional for each additional heli, if you are adding any others. If you just change this, it will only work for the unit you change it to.
 
Last edited:
you're right I misunderstood -- the promotion tree ui indeed is another issue altogether. Its completely separate from what you can actually select as promotion, however, keep that in mind. ie its possible to get the tree UI to show up as desired, but still not be able to select the desired promotions in-game. Anyway I assume you have the latter aspect figured out.

edit: I think you may want to use an "or" and add a second condition, rather than change the helicopter reference directly? ...and add another "or" conditional for each additional heli, if you are adding any others. If you just change this, it will only work for the unit you change it to.
That was my thought exactly. I have 2 other helicopter Units also how would i include them in this change
 
All of these ramblings only emphasize the fact that the Promotion Tree mod needs to be omitted from the VP installation package. I despise it so much, it's just a stupid mod because it's misrepresenting the promotion system in a hacky way.
 
I made this file. change file (4a) promotion folder.

If you replace this file, if you have a "promotion: hovering unit" and are an "archer unit", you will see the helicopter promotion page.

Recently, I was looking at a fix for a VP future bug and needed some work to do it.
 

Attachments

  • (4a) UI - Promotion Tree for VP.zip
    21.3 KB · Views: 8
  • 12222.png
    12222.png
    684.8 KB · Views: 8
Top Bottom