Implement vehicles #434

Merged
merged 11 commits into from Mar 17, 2015

Projects

None yet

3 participants

@Zegeri
Member
Zegeri commented Mar 15, 2015

This won't compile properly until EasyRPG/liblcf#132 is pulled.

Things that work now:

  • Render vehicles
  • Board, drive and unboard vehicles
  • Ascend, fly and descend airships
  • Teleport vehicles
  • Move events with vehicles
  • Save/Load persistence, even when the vehicle is in a different map

Things that don't work:

  • Shadow under a flying airship (won't fix in this pull request)
  • Board a vehicle outside the borders of the map

Also fixed a bug where messages won't terminate if they're in a parallel interpreter, like in the opening of Ahriman's prophecy.

Closes #219.

@Ghabry

Should be "descension" for consistence

@Ghabry
Member
Ghabry commented Mar 15, 2015

Jenkins: test this please <3

Zegeri added some commits Mar 15, 2015
@Zegeri Zegeri Fix commands SetVehicleLocation and ChangeVehicleGraphic d377919
@Zegeri Zegeri Skip trigger checks while in airship. Fix enter vehicle after a message. d8266b7
@Zegeri Zegeri Fix some issues with passability
On foot, ignore upper tiles that are passable above. In vehicles, if an
upper tile isn't passable above, it is unpassable. A vehicle can't go
through other vehicle.
21b8f09
@scurest scurest commented on the diff Mar 15, 2015
src/spriteset_map.cpp
@@ -40,6 +41,13 @@ Spriteset_Map::Spriteset_Map() {
character_sprites.push_back(EASYRPG_MAKE_SHARED<Sprite_Character>(i->second.get()));
}
+ Game_Vehicle* vehicle;
+ for (int i = 1; i <= 3; ++i) {
+ vehicle = Game_Map::GetVehicle((Game_Vehicle::Type) i);
+ if (vehicle->IsInCurrentMap())
@scurest
scurest Mar 15, 2015 Contributor

The vehicles will only be visible if they're on the map when the spriteset is created then. Since Game_Vehicle::GetVisible checks if they're in the current map, how about just removing this check and pushing them on unconditionally?

@Zegeri
Zegeri Mar 16, 2015 Member

That would be slightly slightly slower, because it would update those sprites each frame even if they're not visible. However, the performance difference would be minimal, but I don't see what harm is this check doing.

@scurest
scurest Mar 17, 2015 Contributor

If the vehicle is off map, and then an event puts it on map with Set Vehicle Location, the vehicle will be invisible (since it has no sprite). You can test it in eg. OFF at a pedalo recovery point: use --start-map-id 53 --start-position 15 9 (you'll be directly below the Elsen), kill him, and call a pedalo.

@Ghabry
Member
Ghabry commented Mar 16, 2015

Scurest makes a valid point.
Entered the boat in Don's Adventure Game and it worked well. Good job.
Nothing to complain from my side functionality and code wise.

@scurest
Contributor
scurest commented Mar 17, 2015

5ccb42b will slow the vehicle's "stepping" speed down. They go between their left-middle-right-middle frames at the same rate as an event at 1/8 move speed, even though they actually move much faster than that.

@Ghabry
Member
Ghabry commented Mar 17, 2015

I think its easier when we just merge it and you submit your patches via another PR @scurest

@scurest
Contributor
scurest commented Mar 17, 2015

Ah, ok.

@Ghabry Ghabry merged commit 6158831 into EasyRPG:master Mar 17, 2015

1 check passed

default Merged build finished.
Details
@scurest scurest referenced this pull request Mar 18, 2015
Merged

Minor vehicle fixes #436

@Zegeri Zegeri deleted the Zegeri:vehicles branch Apr 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment