[Patch] Watch Other Companies GUI

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

[Patch] Watch Other Companies GUI

Post by Muxy » 20 Sep 2009 17:16

Hello,

Watch Company patch has been removed from here. You will able to find it else where.
Last edited by Muxy on 19 Sep 2010 15:17, edited 33 times in total.
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum

Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Patch: Console Watch Command

Post by Rubidium » 20 Sep 2009 17:31

Based on the implementation you're looking at other companies. It could also work for AIs in single player.

User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Re: Patch: Console Watch Command

Post by Muxy » 20 Sep 2009 17:34

[..]
Last edited by Muxy on 19 Sep 2010 15:18, edited 1 time in total.
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum

dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: Console Watch Command

Post by dihedral » 21 Sep 2009 07:06

opening a viewport may be more interesting.... then one could also watch multiple companies

User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Re: Patch: Console Watch Command

Post by Muxy » 21 Sep 2009 09:26

[..]
Last edited by Muxy on 19 Sep 2010 15:18, edited 1 time in total.
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum

dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: Console Watch Command

Post by dihedral » 21 Sep 2009 18:46

might get a bit jumpy when 2 people are in one company and building like crazy!

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1501
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Patch: Console Watch Command

Post by SirkoZ » 27 Sep 2009 14:24

dihedral wrote:opening a viewport may be more interesting.... then one could also watch multiple companies
I have thought about this from time to time not in the form of a viewport but just "follow other company's viewing area" and it is nice to see the idea being discussed here.
I wish you success on this endeavour, Muxy. :wink:

User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Patch: Console Watch Command

Post by Benny » 27 Sep 2009 14:59

Planetmaker had a patch like this once I think.
Image

User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Patch: Console Watch Command

Post by Benny » 27 Sep 2009 15:00

dihedral wrote:might get a bit jumpy when 2 people are in one company and building like crazy!
Or in an OTTDcoop game.
Image

dihedral
Tycoon
Tycoon
Posts: 1053
Joined: 14 Feb 2007 17:48

Re: Patch: Console Watch Command

Post by dihedral » 28 Sep 2009 08:29

then it might be better to also transmit the client id, and watch clients instead of companies!

petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Patch: Console Watch Command

Post by petert » 28 Sep 2009 19:40

Really great patch, which could be used for servers, making enforcing the rules easy!
I would seriously reconsider the wording for some of the command help, etc. (Yes, I can tell English isn't your mother tongue), Like so:
watch_cmd_072_revised.patch
Revised Language, Tested and working
(3.77 KiB) Downloaded 259 times
Binary:
Attachments
watch_cmd_072_revised.zip
Binary for revised language
(3.95 MiB) Downloaded 186 times
Last edited by petert on 04 Oct 2009 21:59, edited 2 times in total.

User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Re: Patch: Console Watch Command

Post by Muxy » 30 Sep 2009 19:51

[..]
Last edited by Muxy on 19 Sep 2010 15:19, edited 1 time in total.
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum

petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Patch: Console Watch Command

Post by petert » 01 Oct 2009 20:45

You're very welcome, this is such a great tool, I hope it makes trunk. You should post on bugs.openttd.org as a patch.

SmatZ
OpenTTD Developer
OpenTTD Developer
Posts: 351
Joined: 03 Oct 2006 18:26
Location: Prague, Czech Republic
Contact:

Re: Patch: Console Watch Command

Post by SmatZ » 01 Oct 2009 21:07

I had a patch similiar to this one... Updated to current rev, maybe it will be helpful for you :) (maybe won't...) Hope it still works.
Attachments
center_player_r17680.diff
(7.48 KiB) Downloaded 212 times
Image

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Console Watch Command

Post by Bilbo » 03 Oct 2009 19:04

SirkoZ wrote:but just "follow other company's viewing area" and it is nice to see the idea being discussed here.
This is not possible - since when you just move viewport around, nothing is sent to server, only when you actually build something (and you can also use extra viewport windows to build things :). And AI's even don't have anything like viewport at all.

Best you can do is center while something is built. Perhaps make it slightly configurable, like no re-centering if another thing built is still near centre of the viewport to reduce jumping.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Patch: Console Watch Command

Post by petert » 04 Oct 2009 22:14

Updated to 0.7.3:
watch_cmd_073_revised.patch
(3.77 KiB) Downloaded 205 times
Binary:
watch_cmd_073_revised.zip
(3.96 MiB) Downloaded 185 times

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Console Watch Command

Post by Bilbo » 06 Oct 2009 13:56

I added the patch to my patchpack and when testing it, it seems that there is some bug - when I joined a server where I was alone, it seems that by default I am watched. When I tried "watch 0" to turn watching off, it said:
Unknown player. Player range is between 1 and 15. Use 0 to cancel watching

I think the problem arises from "uint8 _watched_player" -> the variable is unsigned 8bit int, therefore it is always >=0, therefore you are always watching someone.

When you compare the index (CompanyID is enum and basically it is also unsigned int) to -1 (in the condition to turn off the watching), it will always be false, since if you specify "watch 0", the index will probably have something like 255 at that point. So you can't turn the watching off ...

Also, by default you should not be watching anyone.
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: Console Watch Command

Post by Bilbo » 06 Oct 2009 21:14

Ok, I am attaching the patch with these problems fixed. By default you don't watch anyone and watching can be stopped.
Attachments
watch_cmd_073_working.patch
Working version for 0.7.3
(3.13 KiB) Downloaded 221 times
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

User avatar
Muxy
Engineer
Engineer
Posts: 80
Joined: 05 Oct 2008 17:06
Location: Goulp, FR
Contact:

Re: Patch: Console Watch Command

Post by Muxy » 06 Oct 2009 23:36

[..]
Last edited by Muxy on 19 Sep 2010 15:19, edited 2 times in total.
Pourquoi faire simple quand on peut faire compliqué ?
KISS - Keep It Simple, Stupid.
Open TTD Goulp Web Service
OpenTTD Goulp Web Forum

Yexo
Tycoon
Tycoon
Posts: 3653
Joined: 20 Dec 2007 12:49

Re: Patch: Console Watch Command

Post by Yexo » 06 Oct 2009 23:42

_current_company is a CompanyID, not a CompanyByte.

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 5 guests