armoha / euddraft

System for pluginizing eudplib codes.
Other
29 stars 4 forks source link

CamMove plugin needs updating #30

Closed Chromowolf closed 3 years ago

Chromowolf commented 3 years ago

Part of code in cammove.py:

cammoveLoc = GetLocationIndex('cammoveLoc')
inertia = int(settings.get('inertia', 5))
maxspeed = int(settings.get('maxspeed', 48))
target = GetLocationIndex(settings['targetloc'])

def onPluginStart():
    DoActions([
        SetMemory(0x58DC60 + 20 * cammoveLoc + 0x0, SetTo, 0),
        SetMemory(0x58DC60 + 20 * cammoveLoc + 0x4, SetTo, 0),
        SetMemory(0x58DC60 + 20 * cammoveLoc + 0x8, SetTo, 640),
        SetMemory(0x58DC60 + 20 * cammoveLoc + 0xC, SetTo, 384),
    ])

This "set location" actions are outdated after euddraft0.9.0.0. Should be:

f_setloc(cammoveLoc, 0, 0, 640, 384)

or

DoActions([
        SetMemory(0x58DC60 + 20 * (cammoveLoc - 1) + 0x0, SetTo, 0),
        SetMemory(0x58DC60 + 20 * (cammoveLoc - 1)+ 0x4, SetTo, 0),
        SetMemory(0x58DC60 + 20 * (cammoveLoc - 1)+ 0x8, SetTo, 640),
        SetMemory(0x58DC60 + 20 * (cammoveLoc - 1)+ 0xC, SetTo, 384),
    ])
armoha commented 3 years ago

Fixed, thanks!

https://github.com/armoha/euddraft/blob/ca58e30797a7fd2aa624f3f4d3ce6d26ff9284a0/plugins/cammove.py#L20-L21 https://github.com/armoha/euddraft/blob/ca58e30797a7fd2aa624f3f4d3ce6d26ff9284a0/plugins/cammove.py#L52-L53 https://github.com/armoha/euddraft/blob/ca58e30797a7fd2aa624f3f4d3ce6d26ff9284a0/plugins/cammove.py#L106-L115