Latest Posts

Topic: Set observation mode? (in Debug build)

MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 321
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2020-11-13, 10:36

Is it possible to set the observation mode in the debug version via Lua code or keyboard shortcuts?

Normally, in an endless game without fog, you can see the status (wares) of the AI buildings when you are no longer playing.

Would like to use that to debug my AI without leaving the game myself.


My widelands project: https://github.com/widelands/wl_addons_server/tree/master/addons/europeans_tribe.wad

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2020-11-13, 10:47
wl.Game().players[1].see_all = true

or Ctrl-F3 for even more cheating options (only in versions newer than b21)

Edited: 2020-11-13, 10:48

Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 321
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2020-11-13, 10:49

> *Nordfriese wrote:*
>
> ```
> wl.Game().players.see_all = true
> ```
>
> or Ctrl-F3 for even more cheating options (only in versions newer than b21)

Thx.

function observer_mode(plr_number)
local game = wl.Game()
local player = game.players
player.see_all = true
end

-> addition of my debug.lua

Edited: 2020-11-13, 10:52

My widelands project: https://github.com/widelands/wl_addons_server/tree/master/addons/europeans_tribe.wad

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-11-13, 12:13

MarkMcWire wrote:

Nordfriese wrote:

wl.Game().players[1].see_all = true

or Ctrl-F3 for even more cheating options (only in versions newer than b21)

Thx.

function observer_mode(plr_number) local game = wl.Game() local player = game.players[plr_number] player.see_all = true end

-> addition of my debug.lua

Be aware that with this mode you can't attack any building anymore


Top Quote
the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 967
Ranking
One Elder of Players
Posted at: 2020-11-13, 15:34

MarkMcWire wrote:

Normally, in an endless game without fog, you can see the status (wares) of the AI buildings when you are no longer playing.

I like that Idea - we can watch a game with fog of war from the perspective of a player. Maybe we cann add additional information, that makes it easy to see how the status of economy is and more


Top Quote