Mystic Star: Transferred when flying over town, village, etc. #1051

Closed
kakurasan opened this Issue Oct 5, 2016 · 11 comments

Comments

Projects
None yet
3 participants
@kakurasan
Contributor

kakurasan commented Oct 5, 2016

Name of the game:

Mystic Star

Player platform:

Ubuntu (Linux) x86_64

Attach files (as a .zip archive or link them)

MysticStar_Save01.lsd.zip

Describe the issue in detail and how to reproduce it:

mysticstar-airship-issue-1--->mysticstar-airship-issue-2

How to reproduce it:

  1. Place the gamesave
  2. Start game
  3. Load the gamesave
  4. Get into the airship
  5. Move up
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 5, 2016

Member

Okay so the problem is that the Airship triggers an event is shouldn't? We already fixed many of them but looks like we missed some cases >.>

Member

Ghabry commented Oct 5, 2016

Okay so the problem is that the Airship triggers an event is shouldn't? We already fixed many of them but looks like we missed some cases >.>

@Ghabry Ghabry added this to the 0.5.1 milestone Oct 5, 2016

@carstene1ns

This comment has been minimized.

Show comment
Hide comment
@carstene1ns

carstene1ns Oct 5, 2016

Member

Related: #928.

Member

carstene1ns commented Oct 5, 2016

Related: #928.

@kakurasan

This comment has been minimized.

Show comment
Hide comment
@kakurasan

kakurasan Oct 6, 2016

Contributor

Okay so the problem is that the Airship triggers an event is shouldn't?

Exactly. The behavior is unexpected.

Contributor

kakurasan commented Oct 6, 2016

Okay so the problem is that the Airship triggers an event is shouldn't?

Exactly. The behavior is unexpected.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 6, 2016

Member

btw if you want to investigate this on your own. You probably have to change this line to fix it:

if (Main_Data::game_player->InAirship() && GetLayer() == RPG::EventPage::Layers_same) {

Currently only touch events with "Same level as actor" are disabled when on Airship. The problematic event is probably below or above actor.

Member

Ghabry commented Oct 6, 2016

btw if you want to investigate this on your own. You probably have to change this line to fix it:

if (Main_Data::game_player->InAirship() && GetLayer() == RPG::EventPage::Layers_same) {

Currently only touch events with "Same level as actor" are disabled when on Airship. The problematic event is probably below or above actor.

@kakurasan

This comment has been minimized.

Show comment
Hide comment
@kakurasan

kakurasan Oct 6, 2016

Contributor
  • Layers_below ---> transferred
  • Layers_above ---> transferred

I noticed that Game_Event::CheckEventTriggerTouch() is not called when transferred.

game_event.cpp:

...

#include "output.h"
bool Game_Event::CheckEventTriggerTouch(int x, int y) {
    Output::Debug("Game_Event::CheckEventTriggerTouch(%d, %d)", x, y);

    if (Game_Map::GetInterpreter().IsRunning())
        return false;
...

log:

Debug: Loading Save Save01.lsd
Debug: Loading Map Map0015.lmu
Debug: Tree: メニュー < >システム
Debug: Loading Map Map0002.lmu
Debug: Tree: フィールド1 < >フィールド
Debug: Loading Map Map0065.lmu
Debug: Tree: ラウアーの町 < >町
Contributor

kakurasan commented Oct 6, 2016

  • Layers_below ---> transferred
  • Layers_above ---> transferred

I noticed that Game_Event::CheckEventTriggerTouch() is not called when transferred.

game_event.cpp:

...

#include "output.h"
bool Game_Event::CheckEventTriggerTouch(int x, int y) {
    Output::Debug("Game_Event::CheckEventTriggerTouch(%d, %d)", x, y);

    if (Game_Map::GetInterpreter().IsRunning())
        return false;
...

log:

Debug: Loading Save Save01.lsd
Debug: Loading Map Map0015.lmu
Debug: Tree: メニュー < >システム
Debug: Loading Map Map0002.lmu
Debug: Tree: フィールド1 < >フィールド
Debug: Loading Map Map0065.lmu
Debug: Tree: ラウアーの町 < >町
@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 6, 2016

Member

Okay then this is something more complex. Maybe a parallel event that checks for the Player coordinates and invokes the transfer based on his position or something worse... :/

At least something that should not be triggered why in an airship shrug

Member

Ghabry commented Oct 6, 2016

Okay then this is something more complex. Maybe a parallel event that checks for the Player coordinates and invokes the transfer based on his position or something worse... :/

At least something that should not be triggered why in an airship shrug

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 6, 2016

Member

Actually I don't think this is a normal Airship. The start animation is strange.

Member

Ghabry commented Oct 6, 2016

Actually I don't think this is a normal Airship. The start animation is strange.

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 6, 2016

Member

Found the reason: The "Through" flag is enabled. When it is Enabled events with "Same level as hero" are ignored which matches the Airship check we already have btw.

EDIT: That's not the reason but another unrelated bug 👎

Member

Ghabry commented Oct 6, 2016

Found the reason: The "Through" flag is enabled. When it is Enabled events with "Same level as hero" are ignored which matches the Airship check we already have btw.

EDIT: That's not the reason but another unrelated bug 👎

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Oct 6, 2016

Member

CC @Zegeri who is the interpreter/move route expert.

When a move route for the Player is set, which runs every frame through a parallel event and is stuff that ends in one frame like "Animation On" the "Hero Touch" triggers Above & Below the hero are ignored... That's the reason >.>. But how to fix this.

Edit:
Upon further investigation I can generalize this a bit:
Hero Touch Below/Above does not trigger while a Move is executed (doesn't matter which one)
Hero Touch SameLevel does not trigger by a MoveUp & co., just hangs the move
Event Touch Below/Above does not trigger when it is a blocking move, but triggers e.g. for "Animation On"
Event Touch SameLevel behaves as Hero Touch SameLevel

Member

Ghabry commented Oct 6, 2016

CC @Zegeri who is the interpreter/move route expert.

When a move route for the Player is set, which runs every frame through a parallel event and is stuff that ends in one frame like "Animation On" the "Hero Touch" triggers Above & Below the hero are ignored... That's the reason >.>. But how to fix this.

Edit:
Upon further investigation I can generalize this a bit:
Hero Touch Below/Above does not trigger while a Move is executed (doesn't matter which one)
Hero Touch SameLevel does not trigger by a MoveUp & co., just hangs the move
Event Touch Below/Above does not trigger when it is a blocking move, but triggers e.g. for "Animation On"
Event Touch SameLevel behaves as Hero Touch SameLevel

@Ghabry

This comment has been minimized.

Show comment
Hide comment
@Ghabry

Ghabry Mar 4, 2017

Member

The Mystic Star specific problem ("Hero Touch Below/Above does not trigger while a Move is executed") can be fixed via:

bool Game_Player::CheckTouchEvent() {
	if (InAirship())
		return false;

+	if (IsMoveRouteOverwritten())
+		return false;

	return CheckEventTriggerHere({RPG::EventPage::Trigger_touched});
}

Because the Player can't have it's own move route a check for "IsOverwritten" is sufficient.

Member

Ghabry commented Mar 4, 2017

The Mystic Star specific problem ("Hero Touch Below/Above does not trigger while a Move is executed") can be fixed via:

bool Game_Player::CheckTouchEvent() {
	if (InAirship())
		return false;

+	if (IsMoveRouteOverwritten())
+		return false;

	return CheckEventTriggerHere({RPG::EventPage::Trigger_touched});
}

Because the Player can't have it's own move route a check for "IsOverwritten" is sufficient.

@kakurasan

This comment has been minimized.

Show comment
Hide comment
@kakurasan

kakurasan Mar 5, 2017

Contributor

The patch works for me too.

Contributor

kakurasan commented Mar 5, 2017

The patch works for me too.

carstene1ns added a commit that referenced this issue Mar 12, 2017

Ghabry added a commit to Ghabry/easyrpg-player that referenced this issue Apr 1, 2018

Fixed touch handling after a move command that was broken by the fix …
…for #1051.

Added special handling to prevent retouching after end of movement command when no movement happened.

Fixes broken ice physics in the game Grimps.

Ghabry added a commit to libretro/easyrpg-libretro that referenced this issue May 22, 2018

Ghabry pushed a commit to libretro/easyrpg-libretro that referenced this issue May 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment