[NoGo] CityDomination
Moderator: OpenTTD Developers
[NoGo] CityDomination
This is a game game script which deems people 'owner' of a town based on their station ratings. It is good for demonstrating:
1. SuperLib integration
2. Catching events
3. Placing Signs
4. Using Newsticker
Depends on:
SuperLib for NoGo(v19)
Please tell me if you have a suggestion.
Latest Download:
CityDomination v9
TIP: You can automatically get the latest version of CityDomination on the content download service
EDIT:
CityDomination no longer depends on Text, and added link to latest download
1. SuperLib integration
2. Catching events
3. Placing Signs
4. Using Newsticker
Depends on:
SuperLib for NoGo(v19)
Please tell me if you have a suggestion.
Latest Download:
CityDomination v9
TIP: You can automatically get the latest version of CityDomination on the content download service
EDIT:
CityDomination no longer depends on Text, and added link to latest download
- Attachments
-
- CityDomination-1.tar
- (40 KiB) Downloaded 783 times
Last edited by 11Runner on 15 Apr 2014 02:55, edited 4 times in total.
Re: [NoGo] CityDomination
Use Helper.SetSign(tile, "message", true) in SuperLib. It will look for existing signs on a tile and replace them with the new message. For AIs the case was that it would only see signs owned by its own company. For GS I would guess that it only see the GS/None-owned signs.11Runner wrote:Known Bug:
Signs build over themselves when replaced
I've marked this library obsolete on bananas as GSText now have the functionality that was provided by the library.11Runner wrote:Text (v1)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] CityDomination
CityDomination v2
New Release Improvements:
1. Goals per company added
3. Faster station checking
4. HQ now displays dominated towns
5. Creates news on who is doing the best, etc.
6. Towns grow with competition
Planned improvements:
1. Must dominate town for at least a month before it can be counted as your dominated town (so that the town doesn't switch who dominates so fast)
Also, I have included my english.txt. If you choose to translate, I will be greatful
CityDomination should also be available on bananas
New Release Improvements:
1. Goals per company added
2. Did Zuu's ImprovementsZuu wrote:Use Helper.SetSign(tile, "message", true) in SuperLib. It will look for existing signs on a tile and replace them with the new message. For AIs the case was that it would only see signs owned by its own company. For GS I would guess that it only see the GS/None-owned signs.11Runner wrote:Known Bug:
Signs build over themselves when replaced
I've marked this library obsolete on bananas as GSText now have the functionality that was provided by the library.11Runner wrote:Text (v1)
3. Faster station checking
4. HQ now displays dominated towns
5. Creates news on who is doing the best, etc.
6. Towns grow with competition
Planned improvements:
1. Must dominate town for at least a month before it can be counted as your dominated town (so that the town doesn't switch who dominates so fast)
Also, I have included my english.txt. If you choose to translate, I will be greatful

CityDomination should also be available on bananas

- Attachments
-
- CityDomination-2.tar
- (40 KiB) Downloaded 437 times
-
- english.txt
- For translating
- (664 Bytes) Downloaded 576 times
Re: [NoGo] CityDomination
I fired up 2*CluelessPlus (in town-to-town only mode) and 2*Convoy to test this goal script. Here are some comments:
- If an AI don't build a HQ (Convoy), you can't see how many towns it has dominated. I don't know if this is a problem or not, as I in general think that it is good that this script encourage you to build a HQ.
- If you move the HQ, the old sign is not removed. If you take a look on my TransportGoals script (v2), you'll see that I actually use the API GSSign.BuildSign directly but store the sign id along with the other company specific data. This way I can remove the sign if the HQ has been moved without knowing the old location. (you could of course instead store the previous HQ location and just use Helper.SetSign(old_tile, "", true); to erase the old sign)
- Your script crashes on load when I load a the game after having saved it. It looks like you are executing a DoCommand from inside your Load function. A solution is to just store the table with load data in your main class instance and then actually read and react on the data in the beginning of your Start() function. [you could again take a look on TransportGoals if you want inspiration]
- I get a flood of news messages on a 256*512 game with four AIs.
- The towns grow to large cities quite fast. In just 10 years I got about 20 towns with a size between 3000 and up to 9000 inhabitants. (no town house NewGRF) If this is good or bad is a question of what you want to do with your script. Perhaps there is some other ways to reward players that dominate a town than growing it? (as most towns will have a dominator/owner and thus grow)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] CityDomination
CityDomination v3
Thank you Zuu for your suggestions
. My thoughts about them:
)
An updated version of english.txt has been included if you would like to translate.
Thank you Zuu for your suggestions

In some ways, I suppose it could be a problem. As of right now, there don't appear to be very many good ways to communicate with the user (I will be requesting such features later). Besides, if NoGo is intended for Multiplayer use, there will be less of a chance of having AI's with no ability to build an HQ.If an AI don't build a HQ (Convoy), you can't see how many towns it has dominated. I don't know if this is a problem or not, as I in general think that it is good that this script encourage you to build a HQ.
That was fixed, thank youIf you move the HQ, the old sign is not removed. If you take a look on my TransportGoals script (v2), you'll see that I actually use the API GSSign.BuildSign directly but store the sign id along with the other company specific data. This way I can remove the sign if the HQ has been moved without knowing the old location. (you could of course instead store the previous HQ location and just use Helper.SetSign(old_tile, "", true); to erase the old sign)

That was also fixed (And TransportGoals was my inspiration from the very startYour script crashes on load when I load a the game after having saved it. It looks like you are executing a DoCommand from inside your Load function. A solution is to just store the table with load data in your main class instance and then actually read and react on the data in the beginning of your Start() function. [you could again take a look on TransportGoals if you want inspiration]

I was getting similar floods of messages too, but I was not sure how the community would react. As of now, I have limited some of the news messages to certain companies, depending on their relevance.I get a flood of news messages on a 256*512 game with four AIs.
I am still considering such ideas. For right now, I have lowered the growth speed of towns.The towns grow to large cities quite fast. In just 10 years I got about 20 towns with a size between 3000 and up to 9000 inhabitants. (no town house NewGRF) If this is good or bad is a question of what you want to do with your script. Perhaps there is some other ways to reward players that dominate a town than growing it? (as most towns will have a dominator/owner and thus grow)
An updated version of english.txt has been included if you would like to translate.
- Attachments
-
- CityDomination-3.tar
- (40 KiB) Downloaded 437 times
-
- english.txt
- for translating
- (726 Bytes) Downloaded 532 times
Re: [NoGo] CityDomination
Code: Select all
// Right now we have to find the sign manually...
local signlist = GSSignList();
signlist.Valuate(GSSign.GetLocation);
signlist.KeepValue(company.hq);
GSSign.RemoveSign(signlist.Begin());
Code: Select all
Helper.SetSign(company.hq, "", true)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] CityDomination
Maybe use some capture the flag system? As in, make a counter from x to 0 per company. If you dominate more cities than your opponent, your opponent loses points (depending on the number of towns). If someone reaches 0, he or she loses. Come to think of it, I think many game modes from other games now can directly be "copied" into OpenTTD11Runner wrote:CityDomination v3
I am still considering such ideas. For right now, I have lowered the growth speed of towns.The towns grow to large cities quite fast. In just 10 years I got about 20 towns with a size between 3000 and up to 9000 inhabitants. (no town house NewGRF) If this is good or bad is a question of what you want to do with your script. Perhaps there is some other ways to reward players that dominate a town than growing it? (as most towns will have a dominator/owner and thus grow)

Re: [NoGo] CityDomination
Unfortunately as of now, I do not know if it is possible to deem a player as "looser" well enough for it to impact the game or make players really care, and I dont think it would be very fair either. Every player should get another tryMaybe use some capture the flag system? As in, make a counter from x to 0 per company. If you dominate more cities than your opponent, your opponent loses points (depending on the number of towns). If someone reaches 0, he or she loses. Come to think of it, I think many game modes from other games now can directly be "copied" into OpenTTD


Then again, I may not be understanding your idea clearly enough.
Re: [NoGo] CityDomination
Can't you give a dialog with 'Player x has won. Do you want to quit or keep playing?'.
To explain the system, I've googled for the game which I had in mind, which is Battlefield Vietnam. Source: http://www.gamespot.com/features/battle ... 19/?page=2
To explain the system, I've googled for the game which I had in mind, which is Battlefield Vietnam. Source: http://www.gamespot.com/features/battle ... 19/?page=2
Remove the killing of course, and substitute control points with dominated cities.Each team starts out with a certain number of points (called 'tickets'). Whenever somebody on a team is killed, that team will lose one ticket. Whichever team runs out of tickets first loses the battle. Depending on which type of map you are playing on, having more control points in your team's possession will also cause the enemy's tickets to drain slowly away, even without them dying.
Re: [NoGo] CityDomination
Just some thinking out loud: can this really neat looking script make building transport related objects more expensive for companies that aren't the dominating transport company? Or even cooler: force competing transport companies to buy transportation rights?
Re: [NoGo] CityDomination
Thanks for all of the suggestions!
I have been considering quoting comments like this and placing them on the NoGo thread as suggestions for new features!
As far as I know, the best ways to communicate with the user is only news message or signs. There does not appear to be support (yet) for such a dialog, nor could I force a user out of buisness (you can double check the nogo docs: http://nogo.openttd.org/)Can't you give a dialog with 'Player x has won. Do you want to quit or keep playing?'.
I think the idea in itself is very good! I might modify it a bit (for example, each user starts with a set of towns, and if you loose all of them, you go out of business or similar. I don't think that there is a way to make a company bankrupt in the current API...). I will proboably try to implement that (possibly as a GS Option) in the futureCan't you give a dialog with 'Player x has won. Do you want to quit or keep playing?'.
To explain the system, I've googled for the game which I had in mind, which is Battlefield Vietnam. Source: http://www.gamespot.com/features/battle ... 19/?page=2
Quote:
Each team starts out with a certain number of points (called 'tickets'). Whenever somebody on a team is killed, that team will lose one ticket. Whichever team runs out of tickets first loses the battle. Depending on which type of map you are playing on, having more control points in your team's possession will also cause the enemy's tickets to drain slowly away, even without them dying.
Remove the killing of course, and substitute control points with dominated cities.

I wish! I dont think NoGo supports that either... Forcing exclusive transport rights upon the company is possible, but it would make it much harder for competing companies to have better station ratings. I have been thinking of a way to make the dominator of a town have a greater (or lesser) advantage locally in the town.Just some thinking out loud: can this really neat looking script make building transport related objects more expensive for companies that aren't the dominating transport company? Or even cooler: force competing transport companies to buy transportation rights?
I have been considering quoting comments like this and placing them on the NoGo thread as suggestions for new features!

Re: [NoGo] CityDomination
Kogut contributed a function to SuperLib.Money that will use up all money of the current company. It's called succide or similar. If you use GSCompanyMode around the call to that function you can probably use it, with the assumption that using GSCompanyMode affects how CURRENT_COMPANY is resolved.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [NoGo] CityDomination
I am not sure but really large company may earn money faster than it is possible to spend.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: [NoGo] CityDomination
CityDomination v4:
This is really more like a mini release!
Improvements:
* Fixed Crash on company out of buisness
* Added month delay to confirm "worthiness" for a town domination
english.txt is included for translating if you would like to do so
This is really more like a mini release!
Improvements:
* Fixed Crash on company out of buisness
* Added month delay to confirm "worthiness" for a town domination
english.txt is included for translating if you would like to do so

- Attachments
-
- CityDomination-4.tar
- (40 KiB) Downloaded 415 times
-
- english.txt
- for translating
- (726 Bytes) Downloaded 514 times
Re: [NoGo] CityDomination
Perhaps a possible goal could be trying to achieve a set (though adjustable beforehand obviously) amount of people that is calculated by adding the populations of towns a company dominates?
Re: [NoGo] CityDomination
That sounds like a feasable (and cool) idea. The program might even be able to determine the yearly winner based on that factor rather than number of towns dominatedLSky wrote:Perhaps a possible goal could be trying to achieve a set (though adjustable beforehand obviously) amount of people that is calculated by adding the populations of towns a company dominates?


Re: [NoGo] CityDomination
How can I add this script to dedicated server? I've tried to add this script to cfg:
Next i've copyied .tar file to ~/openttd/content_download/game/ and it's doesn't work. On singleplayer game everything is fine.
Code: Select all
[game_scripts]
CityDomination =
Re: [NoGo] CityDomination
Did you also copy the SuperLib and Text libraries to the proper directories? If you manually install it, you should copy it to ~/.openttd/game/ (and ~/.openttd/game/library/ respectively).mousepl wrote:How can I add this script to dedicated server? I've tried to add this script to cfg:Next i've copyied .tar file to ~/openttd/content_download/game/ and it's doesn't work. On singleplayer game everything is fine.Code: Select all
[game_scripts] CityDomination =
Re: [NoGo] CityDomination
Yexo is right, but the Text library is no longer needed (it is now depracated)Yexo wrote:mousepl wrote:
How can I add this script to dedicated server? I've tried to add this script to cfg:
Code:
[game_scripts]
CityDomination =
Next i've copyied .tar file to ~/openttd/content_download/game/ and it's doesn't work. On singleplayer game everything is fine.
Did you also copy the SuperLib and Text libraries to the proper directories? If you manually install it, you should copy it to ~/.openttd/game/ (and ~/.openttd/game/library/ respectively).
My thoughts if that is not the problem (some of this may be a bit obvious and simple, but it could be the problem):
* Ensure your server is running the OpenTTD trunk or test release of 1.2
* Ensure you are running CityDomination v4 (older versions used a different name which may confuse the configuration)
Otherwise you may want to give me your openttd.cfg
Finally, this is not likely to be an issue, but scripts downloaded or placed manually should be placed in $OPENTTD_ROOT/game, not $OPENTTD_ROOT/content_download/game. You may have to create the directory manually.
Re: [NoGo] CityDomination
CityDomination v5 (also available on bananas)
New Improvements:
* Population related goals, measurments, and winners (thank you LSky)
* Brief bugfixes
Attached is english.txt if you would like to translate
EDIT:
The population goals and measurments are a settable option in the gamescript settings dialog. You must edit the setting before starting the game. It is turned on by default
New Improvements:
* Population related goals, measurments, and winners (thank you LSky)
* Brief bugfixes
Attached is english.txt if you would like to translate
EDIT:
The population goals and measurments are a settable option in the gamescript settings dialog. You must edit the setting before starting the game. It is turned on by default
- Attachments
-
- CityDomination-5.tar
- (50 KiB) Downloaded 507 times
-
- english.txt
- for translating
- (1.13 KiB) Downloaded 546 times
Last edited by 11Runner on 30 Dec 2011 06:42, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 10 guests