evanbowman / skyland-beta

SKYLAND gba source code, provided for educational purposes
https://www.skylandgame.io
Other
25 stars 2 forks source link

Stuck on an event? Neutral 2.2 and Neutral 2.3 #21

Closed tolik518 closed 1 year ago

tolik518 commented 1 year ago

Entering the neutral 2.2 and neutral 2.3 no dialog starts their ship is just floating and I can't attack them as it says castle may be friendly. The problem is most probably not exclusive for these two events.

Could it be because I have some cloak blocks or because my isle is max size? I haven't looked to much into it since I really wanted to continue the rounds - so my workaround was to build a drone bay and attack it with a drone (#19).

evanbowman commented 1 year ago

I think it may happen when an island reaches the max size, I'll have to look into it! I previously tried to fix this with a patch in this file https://github.com/evanbowman/skyland-beta/blob/fa4af116606e91462514d9dc7537ef6bfe5d60e6/source/skyland/scene/fadeInScene.cpp#L112

The game invokes a script callback function called on-converge when the opponent's island stops moving towards the player, I think the callback must not have happened. Shouldn't be too hard to fix

evanbowman commented 1 year ago

Fixed in a new release. The issue involved a scene transition bug. The screen fades are handled by a class called FadeInScene, which derives from a WorldScene class. Scenes in the codebase implement state changes by allocating and returning a new scene in their update() function. WorldScene allocates a dialog scene, and then FadeInScene throws it out here: https://github.com/evanbowman/skyland-beta/blob/2793f97d1c600ba63052aa5b3b636494c7e058b0/source/skyland/scene/fadeInScene.cpp#L52 So the dialog never runs. Fixed by telling the WorldScene implementation not to process events and allocate new scenes: https://github.com/evanbowman/skyland-beta/blob/2793f97d1c600ba63052aa5b3b636494c7e058b0/source/skyland/scene/fadeInScene.cpp#L42