Bei meinem Jumpnrun Misanthropius habe ich das Problem, dass wenn die Spielfigur den Room wechselt, dass dann die Tastaturabfrage "spinnt". Sie rennt im nächsten Room z.B. nicht mehr weiter, obwohl die Tastatur dafür noch gedrückt ist. Was könnte ich dagegen tun? Ich habe leider keine gefunden, aber gibt es irgendwelche abfragen, die ich bei einem Roomstart einsetzten könnte, damit die Figur noch weiss, welche Tasten noch gedrückt sind?
roomübergänge mit tastenproblemen
Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen
-
-
Wie hast du die Abfrage der Tasten gemacht, Key Event oder KeyPress Event?"Die Erde ist ein Irrenhaus. Dabei könnte das bis heute erreichte Wissen der Menschheit aus ihr ein Paradies machen. Dafür müsste die weltweite Gesellschaft allerdings zur Vernunft kommen."
- Joseph Weizenbaum -
Daran habe ich auch schon gedacht, habe aber alles mit Key Event gemacht....
Das komische ist, dass das Problem nicht jedesmal auftritt. Oder, dass es teilweise nur für eine kurze Zeit auftritt. Kann z.B. sein, dass beim Roomwechsel die figur nicht mehr weiterrennt oder dass sie erst nach einer Verzögerung weiterrennt...Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Belial ()
-
Tust du beim Bewegen noch irgendwo was ändern? Denn der blanke Key Event an sich geht auch direkt weiter nachdem ein Raum gewechselt wird."Die Erde ist ein Irrenhaus. Dabei könnte das bis heute erreichte Wissen der Menschheit aus ihr ein Paradies machen. Dafür müsste die weltweite Gesellschaft allerdings zur Vernunft kommen."
- Joseph Weizenbaum -
Nein. an was hast du da genau gedacht, mit dem Wechseln?
EDIT:
Falls es hilfreich sein könnte, die Daten zum Spielerobjekt:
Information about object: human
Sprite: stand_left
Solid: false
Visible: true
Depth: -2
Persistent: true
Parent: <no parent>
Mask: <same as sprite>
Create Event:
set the gravity to 0.3 in direction 270
set the friction to 0.1
set variable lr to 0
set variable groundimpact to 0
Step Event:
if relative position (0,1) is collision free for Only solid objects
set variable groundimpact to 0
if at relative position (0,0) there is not object swimblock
set the gravity to 0.3 in direction 270
else
set the gravity to 0 in direction 0
if lr is equal to 0
set the sprite to jump_left with scale factor 1
else
set the sprite to jump_right with scale factor 1
else
set the gravity to 0 in direction 0
if at relative position (0,0) there is object leim
set variable image_speed to 0.5
else
set variable image_speed to 1
if relative position (-4,0) is not collision free for Only solid objects
if lr is equal to 0
set the horizontal speed to 0
if relative position (4,0) is not collision free for Only solid objects
if lr is equal to 1
set the horizontal speed to 0
Collision Event with object block:
move in direction direction at most -1 till a contact with solid objects
if relative position (0,1) is not collision free for Only solid objects
if groundimpact is equal to 0
set variable groundimpact to 1
play sound little_tab; looping: false
set the vertical speed to 0
if lr is equal to 0
set the sprite to stand_left with scale factor 1
else
set the sprite to stand_right with scale factor 1
if relative position (0,-1) is not collision free for Only solid objects
set the vertical speed to 0
if relative position (-4,0) is not collision free for Only solid objects
set the horizontal speed to 0
move in direction 180 at most -1 till a contact with solid objects
if relative position (4,0) is not collision free for Only solid objects
set the horizontal speed to 0
move in direction 0 at most -1 till a contact with solid objects
Collision Event with object jump:
if vspeed is larger than 0
set the vertical speed to -8
for other object: set variable image_single to 1
play sound tub; looping: false
play sound zzzz; looping: false
move in direction 270 at most -6 till a contact with solid objects
Collision Event with object leim:
if speed is larger than 0
create instance of object darkyellowparticle1 at relative position (0,0)
if sound little_tab is playing
stop sound little_tab
play sound saft; looping: false
Collision Event with object swimblock:
if speed is larger than 1
set variable speed to speed/1.2
Keyboard Event for <Left> Key:
set variable lr to 0
if relative position (-4,0) is collision free for Only solid objects
set the sprite to run_left with scale factor 1
if at relative position (0,0) there is object leim
set the horizontal speed to -1
else
if at relative position (0,0) there is object swimblock
set the horizontal speed to -1
else
set the horizontal speed to -3
else
set the horizontal speed to 0
if relative position (0,1) is not collision free for Only solid objects
if at relative position (-3,0) there is object box
set the sprite to runwall_left with scale factor 1
else
set the sprite to wall_left with scale factor 1
move in direction 180 at most -1 till a contact with solid objects
if relative position (0,1) is not collision free for Only solid objects
if image_index is equal to 2
play sound little_tab; looping: false
if image_index is equal to 8
play sound little_tab; looping: false
Keyboard Event for <Up> Key:
if at relative position (0,0) there is object swimblock
set the vertical speed to -1
Keyboard Event for <Right> Key:
set variable lr to 1
if relative position (4,0) is collision free for Only solid objects
set the sprite to run_right with scale factor 1
if at relative position (0,0) there is object leim
set the horizontal speed to 1
else
if at relative position (0,0) there is object swimblock
set the horizontal speed to 1
else
set the horizontal speed to 3
else
set the horizontal speed to 0
if relative position (0,1) is not collision free for Only solid objects
if at relative position (3,0) there is object box
set the sprite to runwall_right with scale factor 1
else
set the sprite to wall_right with scale factor 1
move in direction 0 at most 0 till a contact with solid objects
if relative position (0,1) is not collision free for Only solid objects
if image_index is equal to 2
play sound little_tab; looping: false
if image_index is equal to 8
play sound little_tab; looping: false
Keyboard Event for <Down> Key:
if at relative position (0,0) there is object swimblock
set the vertical speed to 1
Key Press Event for <Escape> Key:
go to room menu with transition effect <no effect>
Key Press Event for <Up> Key:
if relative position (0,1) is not collision free for Only solid objects
if at relative position (0,0) there is object leim
set the vertical speed to 0
repeat next action (block) 11 times
create instance of object darkyellowparticle1 at relative position (0,0)
else
set the vertical speed to -5
play sound little_tab; looping: false
Key Release Event for <Left> Key:
if relative position (0,1) is not collision free for Only solid objects
set the sprite to stand_left with scale factor 1
if at relative position (0,0) there is not object swimblock
set variable hspeed to hspeed/3
Key Release Event for <Up> Key:
if at relative position (0,0) there is not object swimblock
set the vertical speed to vspeed/2
Key Release Event for <Right> Key:
if relative position (0,1) is not collision free for Only solid objects
set the sprite to stand_right with scale factor 1
if at relative position (0,0) there is not object swimblock
set variable hspeed to hspeed/3
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Belial ()
-
Könnte ja sein das da irgendwelche Variablen umgestellt werden die beim Raum wechsel wieder zurückgestellt werden oder sowas."Die Erde ist ein Irrenhaus. Dabei könnte das bis heute erreichte Wissen der Menschheit aus ihr ein Paradies machen. Dafür müsste die weltweite Gesellschaft allerdings zur Vernunft kommen."
- Joseph Weizenbaum -
Ne, glaub daran liegts nicht. Das Objekt ist ja "persistent".
-
Also, ich hab jetzt mal eine Anzeige eingebaut, die anzeigt, ob eine Taste gedrückt ist oder nicht. Und wenn ich jetzt den Room wechsle, wird manchmal angezeigt, dass eine Taste gar nicht gedrückt sei, obwohl sie es in wirklichkeit ist... Was kann man zum Teufel dagegen machen?
-
Könnte es am Buffer liegen?
Vllt. wird er beim Verlassen eines raumes gelöscht.
Weiß aber nicht genau.Face in the wind, we're riding the storm
We'll stay our course whatever will come
~~ Stay (Running) Wild ~~ -
Haben denn andere Leute hier dieses Problem nicht? Ist das speziell ein Problem des GM 5.0? Das komische ist ja, dass es manchmal garnicht auftritt, aber eben die meisste Zeit schon. Und wenn man in einem Sprung den Room wechselt, besteht das Problem ohne ausnahme.
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von Belial ()
-
-
nein, ist mir zu englisch. ich kann zwar n bisschen englisch, finde es aber unglaublisch streng es zu lesen...
-
Es gibt da eine abfrage, die du am anfand des Raumes machen kannst. Im Create Event eines Objectes das nur in diesem Raum ist.
die Key Codes kannst du ind der Hilfe nachlesen. Gamemaker Language/Benutzeinteraktion/Die Tastatur.
MFG kabuco -
Das ist tatsächlich ein Bug im Gamemaker der seit Version 6 mitgeschliffen wird. Ich hab das selbe problem bei meinem Projekt auch gehabt, letzendlich hab ichs nur mit einem Halbherzigen Workaround gelöst. (Tasten Manuell speichern, im nächsten Raum wieder setzen)...
-
ach so. also, ich werd das dann mal mit der manuellen lösung versuchen. gibts da eine abfrage, um festzustellen, dass ein neuer room gestartet wurde?
-
-
Ist ja nicht so als würde man den Raum randommäßig wechseln. Häng eine Routine die das Tastaturbuffer Problem handelt einfach hinter die Routinen die den Raum wechseln....
-
danke, aber das half alles auch nix...
und einen tastendruck simulieren, hat auch nichts gebracht...
@ kabuco: dein skript merkt ja gar nicht, wenn der room wechselt... habs bei mir eingebaut und als auslöser einfach mal ein sound gespielt. aber nicht mal der kommt...
-
Die Reihenfolge ist falsch, die Variable darf erst wieder gesetzt werden, wenn geprüft wurde.
Demnach in den Create Event folgendes:
Und im Step Event sowas:
"Die Erde ist ein Irrenhaus. Dabei könnte das bis heute erreichte Wissen der Menschheit aus ihr ein Paradies machen. Dafür müsste die weltweite Gesellschaft allerdings zur Vernunft kommen."
- Joseph Weizenbaum -
@Windapple: Wie machst du das denn, ein Objekt kann ja nicht Raumübergreifend gemacht werden.
Kann da nur sagen: Speichere den Tastencode in eine globale Variable und rufe sie im nächsten Raum wieder auf!