Page 1 of 4

[Patch] Watch Other Companies GUI

Posted: 20 Sep 2009 17:16
by Muxy
Hello,

Watch Company patch has been removed from here. You will able to find it else where.

Re: Patch: Console Watch Command

Posted: 20 Sep 2009 17:31
by Rubidium
Based on the implementation you're looking at other companies. It could also work for AIs in single player.

Re: Patch: Console Watch Command

Posted: 20 Sep 2009 17:34
by Muxy
[..]

Re: Patch: Console Watch Command

Posted: 21 Sep 2009 07:06
by dihedral
opening a viewport may be more interesting.... then one could also watch multiple companies

Re: Patch: Console Watch Command

Posted: 21 Sep 2009 09:26
by Muxy
[..]

Re: Patch: Console Watch Command

Posted: 21 Sep 2009 18:46
by dihedral
might get a bit jumpy when 2 people are in one company and building like crazy!

Re: Patch: Console Watch Command

Posted: 27 Sep 2009 14:24
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:

Re: Patch: Console Watch Command

Posted: 27 Sep 2009 14:59
by Benny
Planetmaker had a patch like this once I think.

Re: Patch: Console Watch Command

Posted: 27 Sep 2009 15:00
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.

Re: Patch: Console Watch Command

Posted: 28 Sep 2009 08:29
by dihedral
then it might be better to also transmit the client id, and watch clients instead of companies!

Re: Patch: Console Watch Command

Posted: 28 Sep 2009 19:40
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 497 times
Binary:

Re: Patch: Console Watch Command

Posted: 30 Sep 2009 19:51
by Muxy
[..]

Re: Patch: Console Watch Command

Posted: 01 Oct 2009 20:45
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.

Re: Patch: Console Watch Command

Posted: 01 Oct 2009 21:07
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.

Re: Patch: Console Watch Command

Posted: 03 Oct 2009 19:04
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.

Re: Patch: Console Watch Command

Posted: 04 Oct 2009 22:14
by petert
Updated to 0.7.3:
watch_cmd_073_revised.patch
(3.77 KiB) Downloaded 391 times
Binary:
watch_cmd_073_revised.zip
(3.96 MiB) Downloaded 331 times

Re: Patch: Console Watch Command

Posted: 06 Oct 2009 13:56
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.

Re: Patch: Console Watch Command

Posted: 06 Oct 2009 21:14
by Bilbo
Ok, I am attaching the patch with these problems fixed. By default you don't watch anyone and watching can be stopped.

Re: Patch: Console Watch Command

Posted: 06 Oct 2009 23:36
by Muxy
[..]

Re: Patch: Console Watch Command

Posted: 06 Oct 2009 23:42
by Yexo
_current_company is a CompanyID, not a CompanyByte.