Multiplayer Game Longer time between intro date and such

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 04 Jun 2010 12:59

Hi

I want to make a Openttd server cause most of the time I doesnt have time when one of friends has and vica versa. So now I want to make a server so everybody can log in when they want to.
I've set up the server and everything is working.

Now one year is about 15 minutes. So from 1950 to 2050 is about 25 hours. Now because I want to leave the server running for a couple of weeks it would be fun if I could change introduction dates of the trains and such, so when you log in after a week you still cant build all trains.

I've tried to change introduction dates with Grfmaker, but you can only change them in the range of 1920 to 2070.

So my question, is there an other way to do this? Or is there a way to let a year take more time (instead of 15 minutes, like 3 hours or something) (ofcourse while everything moves at normal speed)

User avatar
Drury
Tycoon
Tycoon
Posts: 2151
Joined: 09 Dec 2008 16:20
Skype: yes
Location: Slovakia
Contact:

Re: Multiplayer Game Longer time between intro date and such

Post by Drury » 04 Jun 2010 13:04

Advanced settings - Vehicles - Vehicles never expire.

EDIT: Sorry, I don't read carefully :oops: It's not possible to change time speed in OpenTTD without fast time button.
Image

Only dumb people quote themselves, and only the truest retards put such quotes in their forum signatures
-Drury

User avatar
Chrill
Moderator
Moderator
Posts: 15273
Joined: 18 Dec 2004 17:35
Location: Stockholm, Sweden
Contact:

Re: Multiplayer Game Longer time between intro date and such

Post by Chrill » 04 Jun 2010 17:01

There are daylength patches around, but to use this online would mean that all clients would need the same patch
Image
Newest screenshots published January 9, 2019
Chrill's scenarios:
Archipiélago Hermoso
(Latest Release: Version 3.2)
Turnpike Falls (Latest Release: Version 0.91)

Eddi
Tycoon
Tycoon
Posts: 7411
Joined: 17 Jan 2007 00:14

Re: Multiplayer Game Longer time between intro date and such

Post by Eddi » 05 Jun 2010 10:53

kamikaze_fish wrote: I've tried to change introduction dates with Grfmaker, but you can only change them in the range of 1920 to 2070.
what you need here is the Long format introduction date which can handle dates up to year 5.000.000
You might not exactly be interested in Ferion, but if you are, have fun :)

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 07 Jun 2010 10:36

Eddi wrote:
kamikaze_fish wrote: I've tried to change introduction dates with Grfmaker, but you can only change them in the range of 1920 to 2070.
what you need here is the Long format introduction date which can handle dates up to year 5.000.000
Ok now I've tried to make this work.

I've made a grf using grfmaker with only a grfID and an action 0.
I have left the grfID as it is only changed the action 0

Now for to test if it works I tried to get the maglev lev 4 chimaera in 1920.

action 0 : 2 * 11 00 00 01 01 57 00 2a 51 B3 0A 00

But now when I use the GRF the introduction date is 1976. When I put two 00 between the vehicleID and the prop (2a), the date is 1949.

What am I doing wrong?

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9282
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Multiplayer Game Longer time between intro date and such

Post by planetmaker » 07 Jun 2010 10:48

kamikaze_fish wrote:
Eddi wrote:
kamikaze_fish wrote: I've tried to change introduction dates with Grfmaker, but you can only change them in the range of 1920 to 2070.
what you need here is the Long format introduction date which can handle dates up to year 5.000.000
Ok now I've tried to make this work.

I've made a grf using grfmaker with only a grfID and an action 0.
I have left the grfID as it is only changed the action 0

Now for to test if it works I tried to get the maglev lev 4 chimaera in 1920.

action 0 : 2 * 11 00 00 01 01 57 00 2a 51 B3 0A 00

But now when I use the GRF the introduction date is 1976. When I put two 00 between the vehicleID and the prop (2a), the date is 1949.

What am I doing wrong?
Uhm... the property value always follows the property byte. And the property value for a long introduction date is a double word value, thus the four bytes following the 2A (51 B3 0A 00). Further I do recommend to use the proper escape sequences for dates:
-1 * 11 00 00 01 01 57 00 2A \date1920-01-01
http://wiki.ttdpatch.net/tiki-index.php ... nsDetailed

Eddi
Tycoon
Tycoon
Posts: 7411
Joined: 17 Jan 2007 00:14

Re: Multiplayer Game Longer time between intro date and such

Post by Eddi » 07 Jun 2010 10:53

likely the 00 before the 2a is wrong...
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9282
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Multiplayer Game Longer time between intro date and such

Post by planetmaker » 07 Jun 2010 13:26

For simplicity's sake I anyway would propose to code such simple thing using NML (download, link totrain properties in absense of proper documentation, line 35ff) and have a look at OpenGFX+ for a brief view how such thing looks like: grf initialization and vehicle properties. Easily readable and no need to worry about property sizes, sprite length etc pp.

And Eddi might be right, I didn't check the bytes before 2A.

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 07 Jun 2010 19:55

I put in the 00 because it gave a pseudo sprite error in openttd.

"Long format introduction date (2A)

Set the vehicle introduction date, in days since the year 0. This takes account of leap years; dividable by 4, but not 100 unless 400. A start date of 1920-01-01 is obtained with a value of 701265 (51 B3 0A 00). This property must be set after property 00 to take effect. In TTDPatch, dates after 2044 will be limited to 2044."

I'll look at the program and doc tomorrow planetmaker, thx for the reply anyway!

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9282
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Multiplayer Game Longer time between intro date and such

Post by planetmaker » 07 Jun 2010 20:18

Setting a property also means assigning a value to it:

Code: Select all

-1 * 0 00 00 \b02 \b01 57 // train: 2 properties for one ID, starting with ID 0x57
00 \w0                    // short introduction date: days since January 1 1920
2A \date1920-01-01        // long introduction date: 1920
You can assign any (word) value to the short introduction date as it will be over-written by the long introduction date defined in property 2A

Eddi
Tycoon
Tycoon
Posts: 7411
Joined: 17 Jan 2007 00:14

Re: Multiplayer Game Longer time between intro date and such

Post by Eddi » 07 Jun 2010 22:23

kamikaze_fish wrote:This property must be set after property 00 to take effect
yes, but then you must assign an actual value to property 00, not leave it simply blank... Property 00 takes 2 bytes, so in your example it consumes the bytes "2A 51" [which explains your 1976], then you have another property "B3" whatever that means, which consumes the bytes "04 00". so you need to add another two bytes so it reads "00 00 00 2A ..."
You might not exactly be interested in Ferion, but if you are, have fun :)

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 08 Jun 2010 11:33

Ok!:D I got it to work.

I got the maglev in the year 3800 now.

Code I used:

action 0
2 * 13 00 00 02 01 57 00 00 00 2a ae 2d 15 00

First it didnt work, but I had to set that I changed 2 props, so now it works. Thx for all the help!

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 08 Jun 2010 12:12

I've also managed to get the escape values working. I had the wrong version of grfcodec (0.9.10).
But I still havent figured out how many bytes such an escape value is.

I used

2 * 16 00 00 02 01 57 00 00 00 2a \d1-1-3800

Is it of no importance the value you give for the amount of bytes? (16 in this case)

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9282
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Multiplayer Game Longer time between intro date and such

Post by planetmaker » 08 Jun 2010 14:30

kamikaze_fish wrote:I've also managed to get the escape values working. I had the wrong version of grfcodec (0.9.10).
But I still havent figured out how many bytes such an escape value is.

I used

2 * 16 00 00 02 01 57 00 00 00 2a \d1-1-3800

Is it of no importance the value you give for the amount of bytes? (16 in this case)
It depends. If you use nforenum to check the grf for sanity it doesn't matter - simply for the reason that nforenum writes the proper value there. But if you don't use it (against recommendation), you must put the correct value. Or you most probably would get something like "read beyond end of sprite" or alike.

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 08 Jun 2010 18:59

Ok I made my grf to change introduction dates. Also all trains ingame are available. Last train is introduced in the year 4223:P

Thx eddi and planetmaker for all the advice to get this grf working!
Attachments
Long Vehicle Introduction Datew v1.grf
(996 Bytes) Downloaded 230 times

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Multiplayer Game Longer time between intro date and such

Post by Zuu » 08 Jun 2010 21:51

If you want to make it available through the in-game content service you can do that here: http://bananas.openttd.org/

Go to manage, create an account, log-in (you'll get a page that says that the page does not exist. Ignore that and then go to http://bananas.openttd.org/ again and click on the manage button and follow the on-screen instructions)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Eddi
Tycoon
Tycoon
Posts: 7411
Joined: 17 Jan 2007 00:14

Re: Multiplayer Game Longer time between intro date and such

Post by Eddi » 09 Jun 2010 00:47

kamikaze_fish wrote: But I still havent figured out how many bytes such an escape value is.
that's easy... "b" is one byte, "w" is two byte, and "d" is four byte... occasionally, you have "b*", which may be 1 or 3 bytes...
You might not exactly be interested in Ferion, but if you are, have fun :)

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 11 Jun 2010 13:55

Uploaded it to bananas:D

kamikaze_fish
Engineer
Engineer
Posts: 33
Joined: 17 Dec 2009 13:34

Re: Multiplayer Game Longer time between intro date and such

Post by kamikaze_fish » 20 Apr 2012 07:09

In version 1.5 the grf is working fine. But in version 1.2 it sais the grf is not compatible with this version of openttd. How can I fix this and still use version 1.2?

In the wiki it sais it isn't supported, did the devs take it out of the supported attributes?
Wiki long format introduction date
(in the top of the page is sais it IS supported)

Eddi
Tycoon
Tycoon
Posts: 7411
Joined: 17 Jan 2007 00:14

Re: Multiplayer Game Longer time between intro date and such

Post by Eddi » 20 Apr 2012 08:32

that message usually means that you screwed up the reported language (NOT YOUR GRF!!!) version in the action 8.
You might not exactly be interested in Ferion, but if you are, have fun :)

Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 4 guests