Page 1 of 1

KeyPress gets stuck

Posted: Tue Dec 22, 2020 12:42 pm
by rrTea

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
  <OnUpdate>
    <KeyPress Keys="1">
      <OnPressed>
        <ZExpression>
          <Expression>
<![CDATA[trace ("Exit");
quit();]]>
          </Expression>
        </ZExpression>
      </OnPressed>
    </KeyPress>
  </OnUpdate>
</ZApplication>
Run it from Preview, press "1" after starting it.
Now try running it again. It'll quit by itself.

This is bad because for example if your game crashes during playtesting, the next time you launch it the KeyPress component will act as if you're still pressing whatever it was you were pressing at the moment of the crash. This can result in some truly bizarre ingame behavior.

The only way to "revive" the KeyPress component is to press the key (that it thinks you're still holding down) again.

Re: KeyPress gets stuck

Posted: Tue Dec 22, 2020 2:26 pm
by VilleK
Hi,

This should now be fixed: http://www.zgameeditor.org/files/ZGameEditor_beta.zip

This version is now built with the latest Delphi 10.4 version so please let me know if anything behaves odd.

About your other thread with the OnClose not calling that is not so easy to fix. The quit() function is a bit special and it executes differently at runtime compared to in the designer.

Hope you have a nice Christmas holidays :)

Re: KeyPress gets stuck

Posted: Tue Dec 22, 2020 6:06 pm
by rrTea
Great, it works – thanks so much!!! Hope you have nice Christmas holidays too :)

I did notice a few things, for example some descriptions are garbled (admittedly this is my fault because I was using Unicode characters) but also some projects that used to run perfectly are now throwing strange errors:
Same project runs perfectly in Preview, but when launched it's not working.
Same project runs perfectly in Preview, but when launched it's not working.
剪贴板图片 (8).png (1.04 KiB) Viewed 15194 times

Re: KeyPress gets stuck

Posted: Wed Dec 23, 2020 9:47 am
by VilleK
Is is with this specific project only? Does it work to launch a simple project?

I'll make a new build later if this is a problem for you.

Re: KeyPress gets stuck

Posted: Wed Dec 23, 2020 6:27 pm
by rrTea
It seems it's affecting quite a few projects, everybody else who tested it (only one person but still :D maybe we'll hear from him later) was also unable to build a working exe. Simple projects seem to work. I noticed some other things, still investigating.

Re: KeyPress gets stuck

Posted: Thu Dec 24, 2020 3:43 pm
by Kjell
Hi guys,

A good number of the example projects also crash immediately ( including CleanseCube, Steering, TripleE, YakYakReader, ZPong ). Here's the error message for ZBlast.zgeproj

Image

K

Re: KeyPress gets stuck

Posted: Thu Dec 24, 2020 8:38 pm
by rrTea
Some projects can't be opened, for example when opening GLES2Demo, I get:
(Haven't tested it on my other computers.)
(Haven't tested it on my other computers.)
剪贴板图片 (9).png (6.45 KiB) Viewed 15157 times
Edit 1: Actually to be precise it can be opened, it just crashes immediately.

Edit 2: While we're at the topic of official example files: the FPS demo (at least the version I have) also doesn't work out of the box, there's an extra ";" in the code.

Re: KeyPress gets stuck

Posted: Fri Dec 25, 2020 9:38 am
by VilleK
Ok I think I know why this is happening. I need to rebuild player.bin. I made some optimizations to how global variables in ZLibraries are accessed and currently that change is in the IDE only and not the runtime. I'll fix it on Monday.

Re: KeyPress gets stuck

Posted: Mon Dec 28, 2020 8:56 am
by VilleK
I rebuilt player.bin and now everything seems to work here again: http://www.zgameeditor.org/files/ZGameEditor_beta.zip

Re: KeyPress gets stuck

Posted: Mon Dec 28, 2020 9:06 am
by rrTea
Works here too (at least the projects I tried), excellent! Thank you :!: :!: :!: