Ships should be supported in Lua scripting

Bug #1380287 reported by wl-zocker
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Wishlist
TiborB

Bug Description

For a start, the following functions are desirable:
- plr:get_ships() or plr:get_bobs("ship") which returns an array
- a ship.state that tells what the ship is doing (idle, expedition, transport_wares etc.)

They are needed in the seafaring tutorial.

- sending the ship into a direction

This could be used in emp01.wmf to show the ship driving.

Related branches

wl-zocker (wl-zocker)
description: updated
Revision history for this message
TiborB (tiborb95) wrote :

It seems there is not data structure that keeps info about all ships of the player, or is there?

Revision history for this message
SirVer (sirver) wrote :

no, there is none right now as far as I know of. There are the fleet objects that have knowledge about ships, but I do not know if they are easily accessible from Player.

Changed in widelands:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for widelands because there has been no activity for 60 days.]

Changed in widelands:
status: Incomplete → Expired
SirVer (sirver)
Changed in widelands:
status: Expired → Confirmed
importance: Undecided → Wishlist
Revision history for this message
SirVer (sirver) wrote :

When this is implemented, some regression tests can be simplified to use this functionality (instead of GUI scripting). Also, one more test should be written that checks that ships on expeditions can be properly controlled.

Revision history for this message
TiborB (tiborb95) wrote :

I linked a branch: bug-1380287

See file http://bazaar.launchpad.net/~widelands-dev/widelands/bug-1380287/view/head:/test/maps/expedition.wmf/scripting/test_ship_movement_controls.lua - this test file I added, to see what controls were added.

Probably some explanation will be needed, so feel free to ask...

Changed in widelands:
assignee: nobody → TiborB (tiborb95)
status: Confirmed → In Progress
Revision history for this message
TiborB (tiborb95) wrote :

fixed in rev 7441. Ask me if any question. You can also look into test_ship_movement_controls.lua file for examples.

Changed in widelands:
status: In Progress → Fix Committed
Changed in widelands:
milestone: none → build19-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.