[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 »

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 »

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 »

[..]
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 »

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 »

[..]
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 »

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

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

Re: Patch: Console Watch Command

Post by SirkoZ »

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 »

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 »

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 »

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 »

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 351 times
Binary:
Attachments
watch_cmd_072_revised.zip
Binary for revised language
(3.95 MiB) Downloaded 206 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 »

[..]
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 »

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 »

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 240 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 »

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 »

Updated to 0.7.3:
watch_cmd_073_revised.patch
(3.77 KiB) Downloaded 267 times
Binary:
watch_cmd_073_revised.zip
(3.96 MiB) Downloaded 204 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 »

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 »

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 268 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 »

[..]
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 »

_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 2 guests