Closed Chromowolf closed 3 years ago
All entries in EPDCUnitOffsetMap
: https://github.com/armoha/eudplib/blob/cb0ea1f7d7b86267ab65eb8db1ebe4fabdcf2d75/eudplib/eudlib/epdoffsetmap.py#L83
Missing attribute flingyTurnRadius?
Yeah, flingyTurnRadius
(0x22, 1) seems missing.
Attribute current_speed is actually current_speedX, which is CUnitAddr+0x40 Missing current_speedY, i.e. no attribute corresponds to CUnitAddr+0x44 The same bug also goes for halt. halt and current_speed are both dword pairs (8 byte each).
point
type CUnit members look incorrect.
("halt", 0x02C, 4),
("current_speed", 0x040, 4),
They should be
("haltX", 0x02C, 4),
("haltY", 0x030, 4),
("current_speedX", 0x040, 4),
("current_speedY", 0x044, 4),
.
Besides, to be consistent, more attributes could be added for 4-byte coordinate variables, like positionX, positionY. There are moveTargetPosition (4-byte), moveTargetX (2-byte), moveTargetY (2-byte) But there is only position, but no positionX, positionY Same for targetResource.
Using f_posread_epd
would be best for reading those positional data.
e.g. let u.position
be a pair of (x, y)
so const x, y = u.position;
and add u.positionXY
as dword value.
Missing attribute
flingyTurnRadius
?[Error] 'flingyTurnRadius' Traceback (most recent call last): File xxx, line xxx, in afterTriggerExec const fl = u.flingyTurnRadius; File "C:\Py\lib\site-packages\eudplib-0.64.0-py3.8-win32.egg\eudplib\eudlib\epdoffsetmap.py", line 49, in getattr KeyError: 'flingyTurnRadius'
Attribute
current_speed
is actuallycurrent_speedX
, which is CUnitAddr+0x40 Missingcurrent_speedY
, i.e. no attribute corresponds to CUnitAddr+0x44The same bug also goes for
halt
.halt
andcurrent_speed
are both dword pairs (8 byte each).Besides, to be consistent, more attributes could be added for 4-byte coordinate variables, like positionX, positionY. There are
moveTargetPosition
(4-byte),moveTargetX
(2-byte),moveTargetY
(2-byte) But there is onlyposition
, but nopositionX, positionY
Same fortargetResource
.There may also be other potential bug in
class EPDCUnitMap
that I haven't found yet.