Home » MODDING HQ 1.13 » v1.13 General Development Talk » Any introduction to the code?
Re: Any introduction to the code?[message #357781 is a reply to message #357774] Mon, 05 August 2019 10:36 Go to previous messageGo to previous message
MH17 is currently offline MH17

 
Messages:46
Registered:November 2018
Location: Antarctica
silversurfer wrote on Sun, 04 August 2019 12:54
When someone presses Alt + O the code block from line 4040 in "Tactical\Turn Based Input.cpp" is used. The function "ObliterateSector" will kill anything in the sector including zombies.
Thank you very much, comrade! happy

Exploring the function "ObliterateSector" I see that it doesnt update the number of hostile units in sector (troops, tanks, creatures and so on) after applying the cheat code Alt+O to the game. In other words the variable:

std::vector<SECTORINFO> SectorInfo (256); 

declared in the file "Strategic\Queen Command.cpp" (line 75) after the cheat code Alt+O can hold a non-zero number of the creatures in its fields "ubNumCreatures" and "ubCreaturesInBattle".

Having this if I will try to send my troops out of the sector the function "NumHostilesInSector" will block my attempt, cause the sector is considered to remain hostile.

This is looks a bit strange to me because the number of enemies in similar functions "NumEnemiesInAnySector" (file "Strategic\Queen Command.cpp", line 192) or "NumNonPlayerTeamMembersInSector" (line 237) doesnt take into account the value "ubNumCreatures" in the vector "SectorInfo".

Moreover: in my opinion the functions "NumEnemiesInAnySector" and "NumHostilesInSector" are almost identical. May be it makes sense to get rid one of them?

Are there any ideas about the best way to fix it?

[Updated on: Mon, 05 August 2019 10:56]

Report message to a moderator

Corporal
 
Read Message icon12.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message icon9.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message film28.png
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: An easy way of editing the XML files in dev builds (XML Editor broken?)
Next Topic: How to change loading screens?
Goto Forum:
  


Current Time: Wed Feb 12 17:40:21 GMT+2 2025

Total time taken to generate the page: 0.01138 seconds