Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Highly Customized] Simplified unloading for miners #1476

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ This page lists all the individual contributions to the project by their author.
- Fix for sidebar not updating queued unit numbers when on hold
- New Parabola trajectory
- Enhanced Bombard trajectory
- Simplified unloading for miners
- **Ollerus**
- Build limit group enhancement
- Customizable rocker amplitude
Expand All @@ -406,6 +407,7 @@ This page lists all the individual contributions to the project by their author.
- Parasite returning bug fix
- Bunkerable checks dehardcode
- Prevent the units with locomotors that cause problems from entering the tank bunker
- Simplified unloading for miners
- **tyuah8** - Drive/Jumpjet/Ship/Teleport locomotor did not power on when it is un-piggybacked bugfix
- **Aephiex** - initial fix for Ares academy not working on the initial payloads of vehicles built from a war factory
- **Ares developers**
Expand Down
1 change: 1 addition & 0 deletions Phobos.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
<ClCompile Include="src\Ext\TEvent\Body.cpp" />
<ClCompile Include="src\Ext\Trigger\Hooks.cpp" />
<ClCompile Include="src\Ext\Unit\Hooks.Crushing.cpp" />
<ClCompile Include="src\Ext\Unit\Hooks.Harvester.cpp" />
<ClCompile Include="src\Locomotion\TestLocomotionClass.cpp" />
<ClCompile Include="src\Misc\Hooks.Gamespeed.cpp" />
<ClCompile Include="src\Misc\Hooks.Ares.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion YRpp
12 changes: 12 additions & 0 deletions docs/New-or-Enhanced-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1585,6 +1585,18 @@ Convert.HumanToComputer = ; TechnoType
Convert.ComputerToHuman = ; TechnoType
```

### Simplified unloading for miners

- In vanilla, miners must first approach the refinery, then approach the uninstall location, enter the refinery, and finally complete the unloading. When you only have a few miners and the battle is not so urgent, these behaviors work fine and look interesting. But if you have many (say dozens) miners, then they will surround the refinery and cannot unload. Also, for symmetrical maps, there is always a player whose miners have to travel further to unload, thus that player is inherently disadvantaged because of this.
- Now you can change this behavior by setting `HarvesterQuickUnloader` to true on the miner. The new behavior is similar to Warcraft or StarCraft: The miner will travel to the nearest available location around the refinery after collection is complete. When it arrives, the minerals it is loaded with will be unloaded directly, and then the miner will set destination to collection. For the miner with `Teleporter=yes`, we assume it works like a chrono miner in vanilla, and it will teleport directly around the refinery after collection is complete.
- If you order the miner to unload manually, it will process the old unloading behavior.

In `rulesmd.ini`:
```ini
[SOMETECHNO] ; UnitType
HarvesterQuickUnloader=false ; boolean
```

## Terrain

### Destroy animation & sound
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ New:
- Allow infantry to use land sequences in water (by Starkku)
- `<Player @ X>` can now be used as owner for pre-placed objects on skirmish and multiplayer maps (by Starkku)
- Allow customizing charge turret delays per burst on a weapon (by Starkku)
- Simplified unloading for miners (by CrimRecya & TaranDahl)
- Unit `Speed` setting now accepts floating point values (by Starkku)
- Extending `Power` to all TechnoTypes (by Morton)

Expand Down
1 change: 1 addition & 0 deletions src/Ext/House/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ void HouseExt::ExtData::Serialize(T& Stm)
.Process(this->RestrictedFactoryPlants)
.Process(this->LastBuiltNavalVehicleType)
.Process(this->ProducingNavalUnitTypeIndex)
.Process(this->LastRefineryBuildFrame)
.Process(this->CombatAlertTimer)
.Process(this->NumAirpads_NonMFB)
.Process(this->NumBarracks_NonMFB)
Expand Down
3 changes: 3 additions & 0 deletions src/Ext/House/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class HouseExt
int LastBuiltNavalVehicleType;
int ProducingNavalUnitTypeIndex;

int LastRefineryBuildFrame;

// Factories that exist but don't count towards multiple factory bonus.
int NumAirpads_NonMFB;
int NumBarracks_NonMFB;
Expand Down Expand Up @@ -80,6 +82,7 @@ class HouseExt
, RestrictedFactoryPlants {}
, LastBuiltNavalVehicleType { -1 }
, ProducingNavalUnitTypeIndex { -1 }
, LastRefineryBuildFrame { 0 }
, CombatAlertTimer {}
, NumAirpads_NonMFB { 0 }
, NumBarracks_NonMFB { 0 }
Expand Down
5 changes: 5 additions & 0 deletions src/Ext/TechnoType/Body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ void TechnoTypeExt::ExtData::LoadFromINIFile(CCINIClass* const pINI)
this->BuildLimitGroup_ExtraLimit_Nums.Read(exINI, pSection, "BuildLimitGroup.ExtraLimit.Nums");
this->BuildLimitGroup_ExtraLimit_MaxCount.Read(exINI, pSection, "BuildLimitGroup.ExtraLimit.MaxCount");
this->BuildLimitGroup_ExtraLimit_MaxNum.Read(exINI, pSection, "BuildLimitGroup.ExtraLimit.MaxNum");

this->HarvesterQuickUnloader.Read(exINI, pSection, "HarvesterQuickUnloader");

this->Wake.Read(exINI, pSection, "Wake");
this->Wake_Grapple.Read(exINI, pSection, "Wake.Grapple");
this->Wake_Sinking.Read(exINI, pSection, "Wake.Sinking");
Expand Down Expand Up @@ -845,6 +848,8 @@ void TechnoTypeExt::ExtData::Serialize(T& Stm)
.Process(this->BuildLimitGroup_ExtraLimit_MaxCount)
.Process(this->BuildLimitGroup_ExtraLimit_MaxNum)

.Process(this->HarvesterQuickUnloader)

.Process(this->Wake)
.Process(this->Wake_Grapple)
.Process(this->Wake_Sinking)
Expand Down
4 changes: 4 additions & 0 deletions src/Ext/TechnoType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ class TechnoTypeExt
ValueableVector<int> BuildLimitGroup_ExtraLimit_MaxCount;
Valueable<int> BuildLimitGroup_ExtraLimit_MaxNum;

Valueable<bool> HarvesterQuickUnloader;

Nullable<AnimTypeClass*> Wake;
Nullable<AnimTypeClass*> Wake_Grapple;
Nullable<AnimTypeClass*> Wake_Sinking;
Expand Down Expand Up @@ -469,6 +471,8 @@ class TechnoTypeExt
, BuildLimitGroup_ExtraLimit_MaxCount {}
, BuildLimitGroup_ExtraLimit_MaxNum { 0 }

, HarvesterQuickUnloader { false }

, Wake { }
, Wake_Grapple { }
, Wake_Sinking { }
Expand Down
Loading