"Middle" version of station variables 40/41

Got an idea for a new feature in TTDPatch? Post it here.

Moderator: TTDPatch Moderators

Post Reply
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

"Middle" version of station variables 40/41

Post by Oracle »

Quite often when coding stations, I want to put something at the middle of the station. At the moment this involves checking the station length and then coding quite a few different pseudosprites depending on length.
Would it be possible to have versions of C and P that have the middle tile as 0? The other tiles could then be specified by a signed 4-bit variable, e.g. with F (=1111) meaning -7, which still gives 15 possible values. Obviously the middle would have to be chosen arbitrarily for even-length stations, but c and p could have these definitions reversed.
I think this would be quite useful for reducing the difficulty of coding some stations.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

Actually you'd have 1000=-8 through 1111=-1, then 0000=0 to 0111=7. Currenty I plan to have var. 46/47 do this, with the format 0TNL00CP, but where C and P are counted from the middle (which is platform/position (N or L + 1)/2. This way you can test for the middle in both length and platforms with one action 2.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

It's a bit of a late reply but thanks for doing this :].

On a different note, is there any chance of random station triggers triggering callback 14? I like to use callback 14 to determine my station layouts rather than varying the graphics (because it's easier to code) but random action 2s never change when you are using callback 14. It would be nice to have this feature if it's not too difficult or CPU heavy.
Patchman
Tycoon
Tycoon
Posts: 7575
Joined: 02 Oct 2002 18:57
Location: Ithaca, New York
Contact:

Post by Patchman »

It's not trivial, or I would've done it already. It's also not obvious how it should work... should it be constant for the entire station, or change with each platform, or with each tile?

The big problem is that this callback is used for so many different things, vehicles, track type and stations so far, which makes it difficult to figure out a way of generating random numbers that work for all of these.
Josef Drexler

TTDPatch main | alpha/beta | nightly | manual | FAQ | tracker
No private messages please, you'll only get the answering machine there. Send email instead.
User avatar
Oracle
Tycoon
Tycoon
Posts: 2138
Joined: 22 May 2003 09:59

Post by Oracle »

I see - as usual, it's more complicated than I first thought. I'd guess that you'd probably want the callback to occur for the whole station, but I'm not at all sure. Maybe the platform would be more appropriate.
Anyway, if it's difficult then I'm sure there are things more worthy of your time than trying to improve eye-candy a little bit - this type of randomness for stations isn't often used, I think.
Post Reply

Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 5 guests