No more engines - wtf

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

No more engines - wtf

Post by phedon »

Hi,
I added the dbset 0.5 newgrf to my game and removed it, because i wanted to have the sh '30' and sh '40' back
(they were not available when using the dbset).
Now there are no engines available anymore.
I tried 'resetengines', created a new game (no problems here), but nothing worked.
When i click on a train, selecting the 'show details of train' (i don't know the correct english string for it - the button with the memo / directly under the arrow), than 'Information', OpenTTD shows a 'ungültige lokomotive' / 'invalid locomotive'.
Is there a way to reset the trains?

regards phedon
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
Eddi
Tycoon
Tycoon
Posts: 8254
Joined: 17 Jan 2007 00:14

Re: No more engines - wtf

Post by Eddi »

go back to the autosave before you added the grf set.

adding and removing grf sets mid-game is not supported and can cause all kinds of effects like this.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: No more engines - wtf

Post by planetmaker »

Make sure you read the red error messages next time. If they're not understandable please propose a better translation.
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: No more engines - wtf

Post by phedon »

Thx mate, this workaround works.
Any solution for the problem with the lost engines?
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: No more engines - wtf

Post by phedon »

planetmaker wrote:Make sure you read the red error messages next time. If they're not understandable please propose a better translation.
Which red error message? "Invalid locomotive/engine/train"? So whats the better translation for "ungültige Lokomotive"?
:arrow: http://www.dict.cc/?s=lokomotive
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: No more engines - wtf

Post by FooBar »

The one you got after adding DBSet in the NewGRF window and clicking Apply.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: No more engines - wtf

Post by planetmaker »

phedon wrote:
planetmaker wrote:Make sure you read the red error messages next time. If they're not understandable please propose a better translation.
Warning when changing NewGRF on a running game (German) wrote:{YELLOW}Änderungen während eines laufenden Spiels können zum Absturz von OpenTTD führen.{}Trotzdem fortfahren?
I now made it more verbose and extended it to
Änderungen während eines laufenden Spiels können zum Absturz von OpenTTD oder sonstigem, unerwünschten Verhalten führen. Trotzdem fortfahren?
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: No more engines - wtf

Post by FooBar »

Hmmm...
That's not a bad idea, as it can do more than just crash. Crashing is actually not the biggest possible problem when changing newgrf in a running game.
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: No more engines - wtf

Post by phedon »

Okay, i got it.
But I never had the the problem i described in my first post before - only with the DBSet.
I think, the DBSet overwrites the VehicleIDs of the original trains, right? That's why the original engines (sh30,sh40 etc.) disappeared.
So when I remove the DBSet, there are no valid vehicles anymore. This makes sense.
Maybe it could be coded in OpenTTD like that (pseudocode / I'm programming in Object-Pascal, so don't expect to much 8)):

Code: Select all

proc btnRemoveNewGrf(); 
if not assigned(VehicleID)
{
  restoreOriginalVehicle(VehicleID)
}
endp
With this the "missing_engine_anomaly" would never happen.
By the way: because I do develope NewGrfs, I'm using the add/remove newgrf buttons excessively :roll:

regards

phedon
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: No more engines - wtf

Post by Gremnon »

I've found for experimenting with a newgrf, unless you're testing behaviour when it's loaded or unloaded in a running game, the best way to test is with a new game. Set it to a 64x64 map, and don't load anything you don't need to test it, and you'll have what you need in no time.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: No more engines - wtf

Post by planetmaker »

phedon wrote:because I do develope NewGrfs, I'm using the add/remove newgrf buttons excessively :roll:
Then you should be especially aware of the pitfalls. Gremnon's advice is not bad. And when it comes to developing one newgrf, it's easy to just overwrite the development version and have OpenTTD load the compatible, newer version of the newgrf. No need for removal either.
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: No more engines - wtf

Post by phedon »

I usually do it the way Gremnon wrote (I'm also modding the GRFMaker to be more compatible with OpenTTD), but when I find a good NewGrf, I usually don't begin a new game, just to have the NewGrf available.
What about my pseudocode? Wouldn't this prevent the problem this topic is about?
Respectively, what is the worst case, when I add a NewGrf at runtime? Crashing the game?
Why does adding a NewGrf to a running game cause so much trouble?

phedon
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: No more engines - wtf

Post by planetmaker »

phedon wrote:Why does adding a NewGrf to a running game cause so much trouble?
NewGRFs are part of the map. They define the vehicle, industry, houseIDs etc and give the respective numbers on the map array their meaning. If you now come and change the meaning of those numbers, things can break: you suddenly end up with a train on a station tile which has no tracks (meaning of station tile changed), with an engine without power (definition of vehicleID changed) or with industries which have no rule for the layout they find themselves on the map (re-definition of an industry). To different degrees this may impact the game. In the best case, definitions are compatible or only new ones are added, it may happen that just definitions become strange, but in the worst case invalid definitions are found and a crash results when certain pre-conditions are checked.

NewGRF are WAY more than graphics, they are nearly tiny programmes. Adding new ones works more often than not, but removing is unsafe except on the odd occasion. Also your browser wants a re-start (that is a new game in our terms) after you update its active plug-ins.

On the other hand, if you think that you have an easy solution to your problem with OpenTTD newgrf changes: come up with a patch. It's not as trivial as your pseudo code tries to suggest.
phedon
Engineer
Engineer
Posts: 23
Joined: 13 Jun 2010 11:34

Re: No more engines - wtf

Post by phedon »

Alrighty!
Thx for your explanation.
:tipp | hint:
:Alles, was ich schreibe, bezieht sich ausschließlich auf OpenTTD:
:Everything I write solely refers to OpenTTD:
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 4 guests