Oh.. seems like he's built a system that allows you to teleport to locations stored in a file?
Pimp! I did something like this for Assassin's Creed 1 to collect all flags in a region
But yeah, sometimes teleporting to waypoint might get buggy if you don't disable collisions.
Code: Select all
[ENABLE]
alloc( KeyHandlerThread, 0x1000, AssassinsCreed_Dx10.exe )
registersymbol( KeyHandlerThread )
CreateThread( KeyHandlerThread )
label( KeyHandlerOff )
registersymbol( KeyHandlerOff )
label( pBuffer )
registersymbol( pBuffer )
KeyHandlerThread:
push A
call kernel32.Sleep
cmp [KeyHandlerOff],1
jne short @f
mov [KeyHandlerOff],2
ret
@@:
push 65 // VK_NUMPAD5
call user32.GetAsyncKeyState
test ax,ax
je short @f
call TeleportToCoords
push C8
call kernel32.Sleep
@@:
jmp KeyHandlerThread
db CC CC CC CC
TeleportToCoords:
push pBuffer // buffer must be 16-byte aligned address (xxxxxxx0)
mov ecx,[g_CollisionPtr]
call AssassinsCreed_Dx10.exe+1B9210 //call WriteMe //call AssassinsCreed_Dx10.exe+1B9210
//mov ecx,[g_CollisionPtr]
//call AssassinsCreed_Dx10.exe+1BC6F0
mov ecx,[g_CollisionPtr]
mov ecx,[ecx+B8]
mov ecx,[ecx+18]
push ecx
mov ecx,[g_CollisionPtr]
call AssassinsCreed_Dx10.exe+2323B0
mov ecx,[g_CollisionPtr]
mov ecx,[ecx+B8]
mov ecx,[ecx+18]
push 1
push ecx
mov ecx,[g_CollisionPtr]
mov ecx,[ecx+8]
call AssassinsCreed_Dx10.exe+84270
mov ecx,[g_CollisionPtr]
call AssassinsCreed_Dx10.exe+1B8DA0
mov ecx,[g_MenuObj]
mov ecx,[ecx+14]
lea ecx,[ecx+140]
call AssassinsCreed_Dx10.exe+127D10 // Anim:SkeletonUpdate
ret
KeyHandlerOff:
dd 0
KeyHandlerThread+100:
pBuffer:
dd 3F800000 37180D79 80000000 00000000
dd B7180D79 3F800000 00000000 00000000
dd 00000000 00000000 3F800000 00000000
dd C0BFD591 429E152E 42037341 3F800000
[DISABLE]
{$lua}
if( syntaxcheck == false ) then --actual execution
local starttime = getTickCount()
if readInteger( "KeyHandlerOff" ) == 0 then --could be 2 already
writeInteger( "KeyHandlerOff", 1 ) --tell the thread to kill itself
end
while( getTickCount() < starttime + 1000 ) and ( readInteger( "KeyHandlerOff" ) ~= 2 ) do --wait till it has finished
sleep( 20 )
end
if( getTickCount() > starttime + 1000 ) then --could happen when the window is shown
showMessage( 'Disabling the thread failed!' )
error( 'Thread disabling failed!' )
end
sleep( 1 )
end
{$asm}
unregistersymbol( pBuffer )
unregistersymbol( KeyHandlerOff )
unregistersymbol( KeyHandlerThread )
dealloc( KeyHandlerThread )
@
aSwedishMagyar: See if some ideas in the above prove helpful. Then I had something like this to work with the script:
Note that I also included orientation/facing in the teleport, not just coordinates. Check in Valhalla -0x10 and -0x20 from XYZ, those should be the vectors for orientation, pitch, facing, etc.
The idea is this: go to some location, facing the object you want to teleport to. Dump -0x20, -0x10 from XYZ and XYZ. Store to a file. Then in your code load that block in movups (or Lua) and write them to Player XYZ - 0x20, -0x10, 0x00. That will teleport you instantly to the location of your choice, but will also face Eivor towards the object you want the user to look at when you're teleporting there
@
public: The script above is NOT for Valhalla!