Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- itools = dofile('lib_input_tools.lua')
- core = dofile('lib_core.lua')
- N = 25 -- number of input frames to advance before assuming link does not clip out of bounds
- M = 30 -- number of input frames to advance before assuming link does not land out of bounds
- file = io.open("bank_clip_angle_test_eng_2_slash.txt", "w+")
- --file = io.open("test_text.txt", "w+")
- for x = -32768, 32767, 1 do
- print("current iteration" .. x .. " ")
- -- load save state (1)
- itools.load_state(1)
- -- set Angle and Movement Angle equal to x
- memory.write_s16_be(0x3FFE6E,x,'RDRAM')
- memory.write_s16_be(0x400884,x,'RDRAM')
- itools.clear_inputs()
- -- start at input frame 44
- itools.iframe_advance({['R']=true})
- -- now at frame 45
- itools.iframe_advance({['R']=true})
- -- now at frame 46
- itools.iframe_advance({['R']=true})
- -- now at frame 47; clear inputs, then advance frames without any inputs
- itools.clear_inputs()
- itools.iframe_advance()
- -- now at frame 48
- itools.iframe_advance()
- -- now at frame 49
- itools.iframe_advance()
- -- now at frame 50
- itools.iframe_advance()
- -- now at frame 51
- --- Record the values of relevant watches on input frame 51
- De_Facto_Linear_Velocity = core.read_float_be(0x3FFE20,'RDRAM')
- Linear_Velocity = core.read_float_be(0x400880,'RDRAM')
- X_Velocity = core.read_float_be(0x3FFE14,'RDRAM')
- Z_Velocity = core.read_float_be(0x3FFE1C,'RDRAM')
- Y_Velocity = core.read_float_be(0x3FFE18,'RDRAM')
- Movement_Angle = memory.read_s16_be(0x400884,'RDRAM')
- X_Position = core.read_float_be(0x3FFDD4,'RDRAM')
- Z_Position = core.read_float_be(0x3FFDDC,'RDRAM')
- Y_Position = core.read_float_be(0x3FFDD8,'RDRAM')
- Angle = memory.read_s16_be(0x3FFE6E,'RDRAM')
- file:write("Input = " .. x .. "\n")
- file:write("De Facto Linear Velocity: " .. De_Facto_Linear_Velocity .. "\n")
- file:write("Linear Velocity: " .. Linear_Velocity .. "\n")
- file:write("X Velocity: " .. X_Velocity .. "\n")
- file:write("Z Velocity: " .. Z_Velocity .. "\n")
- file:write("Y Velocity: " .. Y_Velocity .. "\n")
- file:write("Movement Angle: " .. Movement_Angle .. "\n")
- file:write("X Position: " .. X_Position .. "\n")
- file:write("Z Position: " .. Z_Position .. "\n")
- file:write("Y Position: " .. Y_Position .. "\n")
- file:write("Angle: " .. Angle .. "\n")
- Clips = false
- Lands = false
- for i = 1, N, 1 do
- itools.iframe_advance()
- -- Check if link's Y Position is less than 60
- if(core.read_float_be(0x3FFDD8,'RDRAM') < 60) then
- Clips = true
- file:write("Clips?: Yes \n")
- break
- end
- if(i == N and Clips == false) then
- file:write("Clips?: No \n")
- file:write("Lands?: No \n")
- file:write("--- \n")
- end
- end
- -- Test if a jumpslash allows you to land on the banker
- if(Clips == true) then
- itools.load_state(1)
- -- set Angle and Movement Angle equal to x
- memory.write_s16_be(0x3FFE6E,x,'RDRAM')
- memory.write_s16_be(0x400884,x,'RDRAM')
- itools.clear_inputs()
- -- start at input frame 44
- itools.iframe_advance({['R']=true})
- -- now at frame 45
- itools.iframe_advance({['R']=true})
- -- now at frame 46
- itools.iframe_advance({['R']=true})
- -- now at frame 47; clear inputs, then advance frames without any inputs
- itools.clear_inputs()
- itools.iframe_advance()
- -- now at frame 48
- itools.iframe_advance()
- -- now at frame 49
- itools.iframe_advance()
- -- now at frame 50
- itools.iframe_advance()
- -- now at frame 51
- itools.iframe_advance()
- -- now at frame 52
- itools.iframe_advance({['X Axis']=-128,['Y Axis']=0,['B']=true})
- for j = 1, M, 1 do
- itools.iframe_advance()
- -- Check if link's Y Position is 133, which is the height of the bank
- if(core.read_float_be(0x3FFDD8,'RDRAM') == 133) then
- Lands = true
- file:write("Lands?: Yes \n")
- file:write("--- \n")
- break
- end
- if(j == M and Lands == false) then
- file:write("Lands?: No \n")
- file:write("--- \n")
- end
- end
- end
- end
- file:close()
Add Comment
Please, Sign In to add comment