bug in editor?
#10
Quote:

I encountered similar problems. After I did some testing, I came to the conclusion, that after pressing a key for more than 4.2 seconds, the replay does not preserve the information of the key being active any more.

Here is a simple program, to reproduce the behavior, instead of going right 25 tiles as the character should, it just moves 21 tiles in the replay. To avoid this, you have to release the key, and press it again, as in the loop, where the replay shows the correct amount of movement to the left: Slight smile

Code:
local ffi    = require "ffi"
local socket = require "socket"

ffi.cdef [[
  void keybd_event(unsigned char, unsigned char, unsigned long, unsigned long); ]]

local s = socket.sleep
local a = {r=39,l=37,u=38,d=40}
function p(x)
  ffi.C.keybd_event(x,1,0,0) end
function r(x)
  ffi.C.keybd_event(x,1,2,0) end

s(4)

p(a["r"])
s(5)
r(a["r"])
s(0.1)

for i=1,25 do
  p(a["l"])
  s(0.1)
  r(a["l"])
  s(0.1) end


Thanks for the heads-up and thorough explanation Slight smile

Quote:It ought to work.


As another programmer, I can't count how many times I've told myself this Smiley. I'm running the debug build, maybe it's fixed in the public build Thumbs up.
My levelset: https://forum.bitbusters.club/thread-1491.html
Any feedback is much appreciated! Slight smile
Reply


Messages In This Thread
bug in editor? - by mobius - 13-Jun-2015, 9:56 PM
bug in editor? - by FelixNemis - 13-Jun-2015, 11:51 PM
bug in editor? - by mobius - 14-Jun-2015, 11:53 AM
bug in editor? - by Pulluxx - 27-Jun-2015, 11:48 AM
bug in editor? - by Joshua Bone - 27-Jun-2015, 12:03 PM
bug in editor? - by Pulluxx - 27-Jun-2015, 6:31 PM
bug in editor? - by Pulluxx - 03-Aug-2015, 3:56 AM
bug in editor? - by _H_ - 03-Aug-2015, 9:51 AM
bug in editor? - by breadbox - 03-Aug-2015, 10:59 AM
bug in editor? - by Pulluxx - 03-Aug-2015, 3:42 PM
bug in editor? - by breadbox - 03-Aug-2015, 8:30 PM
bug in editor? - by chipster1059 - 10-Sep-2015, 7:25 PM
bug in editor? - by Flareon350 - 11-Sep-2015, 1:08 AM
bug in editor? - by geodave - 11-Sep-2015, 11:59 AM
bug in editor? - by quiznos00 - 11-Sep-2015, 5:04 PM
bug in editor? - by Flareon350 - 11-Sep-2015, 6:10 PM
bug in editor? - by chipster1059 - 11-Sep-2015, 6:11 PM
bug in editor? - by Eric119 - 11-Sep-2015, 8:34 PM
bug in editor? - by chipster1059 - 12-Sep-2015, 10:54 AM
bug in editor? - by random 8 - 12-Sep-2015, 5:27 PM
bug in editor? - by mobius - 10-Oct-2015, 11:35 AM
bug in editor? - by quiznos00 - 10-Oct-2015, 2:34 PM
bug in editor? - by mobius - 07-Nov-2015, 7:43 PM
bug in editor? - by Ihavenoname248 - 07-Nov-2015, 8:07 PM
bug in editor? - by mobius - 09-Nov-2015, 8:19 PM
bug in editor? - by mobius - 04-Dec-2015, 4:55 PM
bug in editor? - by random 8 - 04-Dec-2015, 5:21 PM
bug in editor? - by mobius - 04-Dec-2015, 9:31 PM
bug in editor? - by random 8 - 07-Dec-2015, 4:50 AM
bug in editor? - by mobius - 08-Dec-2015, 9:53 PM
bug in editor? - by Joshua Bone - 09-Dec-2015, 9:02 PM
bug in editor? - by mobius - 10-Dec-2015, 6:15 PM
bug in editor? - by Joshua Bone - 10-Dec-2015, 7:00 PM
bug in editor? - by Ihavenoname248 - 10-Dec-2015, 8:00 PM
bug in editor? - by Joshua Bone - 10-Dec-2015, 9:00 PM
bug in editor? - by random 8 - 11-Dec-2015, 8:22 PM
bug in editor? - by Joshua Bone - 12-Dec-2015, 10:56 AM
bug in editor? - by mobius - 15-May-2016, 6:42 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)