[NoGo] GSGoal after bankrupt

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
idioty
Engineer
Engineer
Posts: 59
Joined: 21 Jun 2010 11:54

[NoGo] GSGoal after bankrupt

Post by idioty »

I have a big problem:

I made a script with GSGoal, and all company have specific goals (goal1).
If a company go to bankrupt, then the goal1 automatically destroyed by the OpenTTD.
Then when someone does a new company, this new company was become the goal1.
And I can't remove easy this.
Exist a list what have the all goals?
Sorry my bad english, I don't speak english!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] GSGoal after bankrupt

Post by Zuu »

Currently it is up to GSes to Clean up when a company goes bankrupt. My personal opinion is that it would be better if OpenTTD removed company specific goals when a company goes bankrupt due to the asynchronous behaviour of GSes. Having a new player see old goals etc for a previous company is worse in my opinion than that he/she have to wait some time for them to be created.

I have a patch in preparation to change this in my goal GUI/story book patch queue.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
idioty
Engineer
Engineer
Posts: 59
Joined: 21 Jun 2010 11:54

Re: [NoGo] GSGoal after bankrupt

Post by idioty »

Ok, I solved my problem. I wrote wrong code, with GSEventCompanyBankrupt.

But this is interesting, if I don't remove goal from bankrupted company, the nem company receive this goal. I think the new company receive the old company's ID.

sorry I not found the GSes documentation.
Sorry my bad english, I don't speak english!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] GSGoal after bankrupt

Post by Zuu »

As of r24986, company specific goals will now be removed when a company goes bankrupt. (this also applies to company monitors)

This behaviour have been included in the documentation of GSGoal and GSCargoMonitor, just hold on until the next time the public API docs are updated.

(note that as of writing this, there is no nightly yet that contains this change)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
idioty
Engineer
Engineer
Posts: 59
Joined: 21 Jun 2010 11:54

Re: [NoGo] GSGoal after bankrupt

Post by idioty »

Ok, thanks!
Sorry my bad english, I don't speak english!
Aphid
Traffic Manager
Traffic Manager
Posts: 168
Joined: 16 Dec 2011 17:08

Re: [NoGo] GSGoal after bankrupt

Post by Aphid »

Will r24986 be included in Ver. 1.3?

(It would be nice for me to know, this little change would be a lot of work (saved) for me)
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: [NoGo] GSGoal after bankrupt

Post by Alberth »

yep, there is no 1.3 branch yet
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: [NoGo] GSGoal after bankrupt

Post by Zuu »

Also, see this thread where I've written a bit on this change. Especially, if you plan to support OpenTTD 1.2, its a good idea to read through that post.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests