View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0000460 | Spring engine | General | public | 2007-03-05 17:45 | 2007-03-10 19:31 | ||||
Reporter | yuritch | ||||||||
Assigned To | ILMTitan | ||||||||
Priority | normal | Severity | feature | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0000460: Units with hover movetype cannot be loaded into a transport | ||||||||
Description | Units with hover movetype cannot be loaded into a transport, no matter their size and mass. Looks like an unwanted feature. Digging through the code reveals that this also applies for ships and aircraft. | ||||||||
Additional Information | This is caused by the following code in TransportCAI.cpp: bool CTransportCAI::CanTransport(CUnit* unit) { CTransportUnit* transport=(CTransportUnit*)owner; if(unit->mass>=100000 || unit->beingBuilt) return false; // don't transport cloaked enemies if (unit->isCloaked && !gs->AlliedTeams(unit->team, owner->team)) return false; if(unit->unitDef->canhover || unit->unitDef->floater || unit->unitDef->canfly) return false; if(unit->xsize > owner->unitDef->transportSize*2) return false; if(!transport->CanTransport(unit)) return false; if(unit->mass+transport->transportMassUsed > owner->unitDef->transportMass) return false; return true; } Attached file contains a patch that completely disables movetype check in that function, so that all units can be loaded if their size and mass allow for that. | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
yuritch (reporter) 2007-03-05 17:51 |
I compiled Spring with that change to test it and was able to load/unload hovers and small aircraft with air and sea transports. Haven't tried to load ships as they seem to have enough mass (or too big a size) to not be loadable anyway. |
el_matarife (reporter) 2007-03-06 15:03 |
Apparently air transport for ships used to work in Spring, so this code must have been inserted a while back. Does the transport code check to see if it is dropping off on water which we'd need to check for with transporting sea units/hovers? Also, we may want to make this a mod definable option with the default set to no transport of these units so we don't break any of the current mods. |
yuritch (reporter) 2007-03-08 18:37 Last edited: 2007-03-08 18:43 |
I made a new patch (transportation_diffs2.zip contains it). This one is much more flexible - it allows per-mod control of what unit types are transportable. A new section should be added to modrules.tdf: [TRANSPORTABILITY] { transportGround=1; transportHover=1; transportShip=1; transportAir=1; } Each value controls the transportability of the corresponding unit type. Defaults are 1 for ground and 0 for everything else. I wanted to add buildings also, but that proved a bit too much for me :) Also I changed unload function so that units can be unloaded into water (needed for ships). It checks for ground height and unit's minWaterDepth, so land units won't be unloaded into water and ships won't be dropped on land. Problems found while testing this: if you load an aircraft into an air transport, it will start to accend and will do so indefinitely without a way to stop it or unload the cargo. Loading/unloading aircraft with non-air transport works ok, though. Edit: the first zip (transportation_diffs.zip) contains incomplete path (unloading into water only works for air transports). Look into the second zip (transportation_diffs2.zip) for a complete one (works for all transports). I cannot find a way to delete the first file. |
ILMTitan (reporter) 2007-03-09 06:04 |
I deleted the first zip for you. In the future, unified diffs are the preferred method. I don't know if you are using TortoiseSVN, but you would create the patch by right clicking on base spring source directory. |
yuritch (reporter) 2007-03-09 11:14 Last edited: 2007-03-09 11:17 |
I have modified the patch to be a bit simpler. Now unload position check function just checks for minWaterDepth and maxWaterDepth without special conditions for ships, hovers etc. (min/maxWaterDepth is sufficient, and this also allows to unload TA-style amphibious tanks to the water). Also, it is all in one unified diff now. |
ILMTitan (reporter) 2007-03-10 19:31 |
Revision 0003467: Committed. Thank you. I did add the slope check you wanted to do. You do unit->unitDef->movedata->maxSlope < slope. Thank you for the unified diff. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2007-03-05 17:45 | yuritch | New Issue | |
2007-03-05 17:45 | yuritch | File Added: noMovetypeCheck.diff | |
2007-03-05 17:51 | yuritch | Note Added: 0000758 | |
2007-03-06 15:03 | el_matarife | Note Added: 0000766 | |
2007-03-08 18:23 | yuritch | File Added: transportation_diffs.zip | |
2007-03-08 18:37 | yuritch | Note Added: 0000773 | |
2007-03-08 18:38 | yuritch | File Added: transportation_diffs2.zip | |
2007-03-08 18:42 | yuritch | Note Edited: 0000773 | |
2007-03-08 18:43 | yuritch | Note Edited: 0000773 | |
2007-03-09 05:59 | ILMTitan | Status | new => assigned |
2007-03-09 05:59 | ILMTitan | Assigned To | => ILMTitan |
2007-03-09 06:01 | ILMTitan | File Deleted: transportation_diffs.zip | |
2007-03-09 06:04 | ILMTitan | Note Added: 0000775 | |
2007-03-09 11:12 | yuritch | File Added: transportation_patch.zip | |
2007-03-09 11:14 | yuritch | Note Added: 0000776 | |
2007-03-09 11:17 | yuritch | Note Edited: 0000776 | |
2007-03-10 19:31 | ILMTitan | Status | assigned => resolved |
2007-03-10 19:31 | ILMTitan | Resolution | open => fixed |
2007-03-10 19:31 | ILMTitan | Note Added: 0000777 |