Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Jul 15, 2018 11:06 pm

All times are UTC




Post new topic  Reply to topic  [ 1228 posts ]  Go to page Previous 158 59 60 61 62
Author Message
PostPosted: Thu Sep 07, 2017 5:50 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Oct 31, 2004 12:43 pm
Posts: 35
Location: Slovakia - Bratislava
Actually the #2 is not really what I wanted to achieve.

At the end of WWII many German buses were taken by the armies and these were later distributed by the ministry of transportation. So basically what happened was that the companies got various buses as a compensation for buses that were in desolate condition (during WWII there was not enough tires and spare parts as all were sent to the armies), and as a compensation for buses taken by the German forces at the end of war for evacuation of German families, officers, etc.

So basically the company sent an order to the ministry and they got buses from a certain pool, not really able to decide what capacity, age or producer/type they will be.

I know, that several railway carriages sets have several variations of the same carriage (like several different liveries) and as you buy it will randomly pick the livery. My question was rather if this can be used on road vehicles and if yes, if it can be used to not only pick the livery, but attributes like running costs, # of passengers, top speed, loading speed, etc.

_________________
Woof !


Top
   
PostPosted: Thu Sep 07, 2017 5:53 pm 
Offline
Engineer
Engineer
User avatar

Joined: Sun Oct 31, 2004 12:43 pm
Posts: 35
Location: Slovakia - Bratislava
andythenorth wrote:
No, the vehicle can be built, but can't be given any station orders (vehicles fitted for pax can't route to truck stations and vice versa).


So, a bus station can't load mail? As if you build a bus station next to a train station, you will have mail and passengers there. So the mail is on the station and the bus will stop at the bus station, which contains mail.

_________________
Woof !


Top
   
PostPosted: Thu Sep 07, 2017 6:31 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2608
Location: Kent
Greyfur wrote:
andythenorth wrote:
No, the vehicle can be built, but can't be given any station orders (vehicles fitted for pax can't route to truck stations and vice versa).


So, a bus station can't load mail? As if you build a bus station next to a train station, you will have mail and passengers there. So the mail is on the station and the bus will stop at the bus station, which contains mail.


Yep thats Openttd 101. Buses dont stop at Truck stops and vice versa, regardless of what cargo is waiting

_________________
Image


Top
   
PostPosted: Fri Sep 08, 2017 12:49 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Jan 18, 2014 6:10 pm
Posts: 1074
andythenorth wrote:
Greyfur wrote:
1) Have a bus transport both passengers and mail at once?

No, the vehicle can be built, but can't be given any station orders (vehicles fitted for pax can't route to truck stations and vice versa).
[I tried it once] :)

Of course they can, just build all scheduled stations as universal freight/passenger stops (bus stop adjacent to truck stop). I tried it many times :)

_________________
My experimental openTTD server: 149.156.194.203:3979 non-standard client, now testing: JGRPP http://tiny.pl/ggnch
Projects: Reproducible Map Generation patch, NewGRFs: Manpower industries, PolTrams, Polroad, 600mm narrow gauge, preindustrial houses, wired, ECS industry extension.


Top
   
PostPosted: Fri Sep 15, 2017 9:49 am 
Offline
Engineer
Engineer
User avatar

Joined: Thu Sep 14, 2017 11:59 am
Posts: 10
hello guys,

I recently made an attempt to create my first grf file using the nml language. I am not a good programmer, but with the help of some examples from both the wiki and the forums I succeeded in creating a grf which adds a few fictional planes and other air vehicles for gameplay.

One of these planes is the Arwing from Starfox which has an maximum speed of 5130 km/h. At first I wasn't able to apply this speed to the vehicle, because the maximum speed is 3280 km/h when the property speed is set to 255. After reading several posts of the forums I figured out that this limitation can be lifted with the use of a callback. After applying this to the vehicle I however experienced a problem: due to the enormous speed, the aircraft keeps circling around an airport when trying to land even if the runway is empty.

So my question is: Is there a simple way to make the aircraft slow down when it has reached the airport of destination so that it can land?


Attachments:
ezgif-4-d85d3e9185.gif
ezgif-4-d85d3e9185.gif [ 3.91 MiB | Viewed 777 times ]
Top
   
PostPosted: Thu Apr 26, 2018 12:46 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2325
Location: Virgo Supercluster
I have a question about snow-awareness and animation - I'm always doing it the same way for my tiles:
Code:
spritelayout spritelayout_emptytile_12 {
    ground {
        sprite: 4023;
    }
   building {
        sprite: LOAD_TEMP(1);
      hide_sprite: (terrain_type != TILETYPE_SNOW);
    }
}

So there's the groundtile and if it's above the snowline this switch I copied from somewhere says what other groundtile to draw:
Code:
switch (FEAT_OBJECTS, SELF, switch_emptytile_1_object, [
        //tile slope offset in storage register 0
        STORE_TEMP(slope_to_sprite_offset(tile_slope), 0),
        //terrain type in storage register 1
        STORE_TEMP(GROUNDSPRITE_NORMAL, 1),
      STORE_TEMP( (nearby_tile_terrain_type(0,0) == TILETYPE_DESERT) * GROUNDSPRITE_DESERT, 1),
      STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 1, 0) == TILETYPE_DESERT), 1),
      STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type(-1, 0) == TILETYPE_DESERT), 1),
      STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0, 1) == TILETYPE_DESERT), 1),
      STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0,-1) == TILETYPE_DESERT), 1),
      STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * GROUNDSPRITE_NORMAL, 1),
      STORE_TEMP(terrain_type == TILETYPE_SNOW   ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1),
      STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255),
      STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1),
      STORE_TEMP((LOAD_TEMP(255) ==  0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1),
      STORE_TEMP((LOAD_TEMP(255) ==  1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1)
        ]) {
    switch_emptytile_1_view;
}

(slope isn't actually needed here but whatever). Anyway, this works reliably, as far as I've found.

But when I do the same thing for an animated ground tile:
Code:
spritelayout spritelayout_field_41 {
   ground {
      sprite: 4202 + (animation_frame * 19);
   }
   building {
      sprite: LOAD_TEMP(1);
      hide_sprite: (terrain_type != TILETYPE_SNOW);
   }

It doesn't work and instead always draws the non-snow groundtile.

However, if I just use the "simple" method:
Code:
spritelayout spritelayout_field_41 {
   ground {
      sprite: 4202 + (animation_frame * 19);
   }
   building {
      sprite: GROUNDSPRITE_SNOW;
      hide_sprite: (terrain_type != TILETYPE_SNOW);
   }

and draw the snow-tile like this (disregarding the transitions) ... it does actually work again.

I've tried a bunch of variations and the results are always the same. Can't "hide" the ground sprite 'cause that causes glitches. Reversing the order of groundsprite and animated sprite doesn't help either. I might have overlooked a possible combination of groundsprites, childsprites, buildings, in various orders, but I've fiddled around quite a bit ^^;

So, basically: why does the load_temp-switch method work for non-animated ground tiles but not for animated ones? And why does it still work if the tile in question is directly given? ^^;
Or, heck, I don't care so much about the "why", and I suppose just losing the snowy transitions isn't such a big deal - but if anyone has a solution I'd still be interested (or maybe there's generally a flaw in the method that could be fixed/improved ;) ).


Top
   
PostPosted: Mon Apr 30, 2018 2:52 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Oct 17, 2008 12:17 pm
Posts: 2325
Location: Virgo Supercluster
Alright, an easier(?) question.

I thought about doing a date-aware item, and looked at VAST on how to do that with animations, but it's too incomprehensible. Basically he's made some switch that controls animations and then magic happens and it works.
So I decided to just go with what I know and simply hide sprites:
Code:
building { //FRUIT
      sprite: spriteset_fruit(0);
      xoffset: 8;
      yoffset: -8;
      zoffset: 48;
      xextent: 8;
      yextent: 8;
      zextent: 8;
   }
   childsprite {
      sprite: spriteset_fruit(1);
      hide_sprite: current_month != 3;
   }
   childsprite {
      sprite: spriteset_fruit(2);
      hide_sprite: current_month != 4 && current_month != 5 && current_month != 6 && current_month != 7;
   }
   childsprite {
      sprite: spriteset_fruit(3);
      hide_sprite: current_month != 8 && current_month != 9;
   }

And that works, mostly, except that sprites don't update reliably. That never seemed to be an issue if I do the same thing for example for snow-awareness - as soon as the snow is there, the sprite updates. But here date changes and sometimes something happens and sometimes nothing does, unless I zoom in and out, then it refreshes and works properly.

I guess it has something to do with objects not being redrawn randomly all the time, to help performance or whatever, but is there anything I can do about that? Otherwise I guess I'll have to try and figure out how that animation thing actually works ^^;


Top
   
PostPosted: Wed May 02, 2018 7:51 am 
Offline
Tycoon
Tycoon

Joined: Wed Jan 17, 2007 12:14 am
Posts: 7034
basically, you cannot rely on the sprite being redrawn at a specific time, and you cannot trigger that from your NewGRF. The game redraws the tile every 256 ticks ("tileloop"), or whenever it was invisible due to something else (like a window drawn over it, or a vehicle passing by). this works with snow-awareness, because changing snow levels is also done in the tieloop, so it's redrawn then anyway, but you cannot use "current_month" in your calculation, because that changes at different times.

what you instead could do is put your date calculation into the animation callback, and use the animation frame for drawing

_________________
You might not exactly be interested in Ferion, but if you are, have fun :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1228 posts ]  Go to page Previous 158 59 60 61 62

All times are UTC


Who is online

Users browsing this forum: Kruemelchen and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.