Posted: Thu Aug 13, 2020 1:26 am Post subject:
How to make the oil pump capturable
I figured out how to make the TD oil pump civilian building (as seen in the attached image) into something you can capture that will give you credits (like the oil derricks in Red Alert 2 and Red Alert 3).
Changes I made in the source code to make it work:
Changed "Can this building be captured?" and "Is this building un-sellable?" to true in bdata.cpp for building v19.
Added TCountDownTimerClass PumpTime; to BuildingClass to handle the pump time.
Added PumpTime = 0; to the BuildingClass constructor
Added code to BuildingClass::Captured to set the pump time when the building is captured.
Added code to BuildingClass::AI to handle granting the credits.
The time between grants is set by TICKS_PER_SECOND * 10 (10 being how many seconds) and the credits to grant is the 20 in Refund_Money(20)
The same changes should work in Red Alert as well to add capturable oil derricks to that game although you will need to change rules.ini and add "Capturable=true" and "Unsellable=true" to the [V19] section instead of changing bdata.cpp
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum