Patch: %5 Shares

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

Post Reply
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Patch: %5 Shares

Post by TheJosh »

This patch makes the shares buy and sell in quantities 5% instead of 25%.
You can still buy and sell by quantities of 25% by ctrl clicking

It is patched against nightly revision 10622

This patch will bump your savegame to v73

There are no known save or load issues. Tested with old and new savegames, and network games.

Revision History:
v3 - fixed a small multiplayer bug
v2 - Added ctrl+click support
v1 - Initial
Attachments
A screenshot showing 2 shareholders (15% and 35%)
A screenshot showing 2 shareholders (15% and 35%)
Screenshot.png (487.79 KiB) Viewed 602 times
shares.3.patch
Version 3, against r10622
(11.22 KiB) Downloaded 189 times
Last edited by TheJosh on 19 Jul 2007 02:31, edited 2 times in total.
Want to make a real difference? Australia HOPE International - Bringing hope to African orphans and widows.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: %5 Shares

Post by Bilbo »

I thought of two things that could be improved:

1. Strings like STR_7077_BUY_25_SHARE_IN_COMPANY should be renamed to STR_7077_BUY_5_SHARE_IN_COMPANY to avoid confusion.

2. You needed 3 clicks to buy max. share of somebody in old system. Now you need 19. Perhaps add a feature that CTRL-clicking on buy/sell will do it in higher increments (like 25% or even "maximum possible")
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)
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Re: Patch: %5 Shares

Post by TheJosh »

I have added the ctrl+click functunality, and cleaned up the strings. See the first post for the new patch
Want to make a real difference? Australia HOPE International - Bringing hope to African orphans and widows.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: %5 Shares

Post by Bilbo »

Well, I have tried it and I've discovered two bugs:

First, since shares can be sold in 5% units, company can be owned by 7 other companies. However, in such case, only first three are shown (first three by ID)

Second - as one company I bought 45% of player 1 shares. As second company, I bought 30%.
When I start clicking to buy by 5% steps, I end up at 50% and not being able to buy more (that is correct, 45%+50%=95%)

But if I used CTRL+click, while having that 30%, I suddenly have 55%! Together with 45% from second company we have 100% of player 1, which should not be possible.
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)
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Re: Patch: %5 Shares

Post by TheJosh »

Neither of these are bugs, I guess you never payed much attention to the old shares.
Bilbo wrote:First, since shares can be sold in 5% units, company can be owned by 7 other companies. However, in such case, only first three are shown (first three by ID)
It only used to show the first 2 companies. I would like to expand this patch so I can put in a full company list, but Ill do that with another patch when I do a but of a bigger overhaul of shares.
Bilbo wrote:But if I used CTRL+click, while having that 30%, I suddenly have 55%! Together with 45% from second company we have 100% of player 1, which should not be possible.
This was possible in the old one too. Two (or more) players could together own 100% of the company.
Want to make a real difference? Australia HOPE International - Bringing hope to African orphans and widows.
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: Patch: %5 Shares

Post by Bilbo »

TheJosh wrote:Neither of these are bugs, I guess you never payed much attention to the old shares.
Bilbo wrote:First, since shares can be sold in 5% units, company can be owned by 7 other companies. However, in such case, only first three are shown (first three by ID)
It only used to show the first 2 companies. I would like to expand this patch so I can put in a full company list, but Ill do that with another patch when I do a but of a bigger overhaul of shares.
You're right, now I see it shows only 2 without your patch ... hmm, a bug :)
Perhaps the code for showing three companies could be separated from the patch and filed at bugs.openttd.org as an enhancement :)
TheJosh wrote:
Bilbo wrote:But if I used CTRL+click, while having that 30%, I suddenly have 55%! Together with 45% from second company we have 100% of player 1, which should not be possible.
This was possible in the old one too. Two (or more) players could together own 100% of the company.
No, it was not possible, at least not without any patches. What is inconsistent, that with normal clicking in your patch I can't buy 100%, but with ctrl+clicking I can.
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)
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Re: Patch: %5 Shares

Post by DaleStan »

Bilbo wrote:
TheJosh wrote:This was possible in the old one too. Two (or more) players could together own 100% of the company.
No, it was not possible, at least not without any patches.
Yes it was. Go play a bit of multiplayer TTD sometime. (not Patch, not Open, just TTD.)
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Re: Patch: %5 Shares

Post by TheJosh »

Fixed another bug, see the first post.

Chow, Josh
Want to make a real difference? Australia HOPE International - Bringing hope to African orphans and widows.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Amazon [Bot], Google [Bot] and 25 guests