vehicle_is_reversed ... or not? AND Subtypes
Posted: 18 Apr 2014 19:08
Hello,
i struggle with the "vehicle_is_reversed"-Variable.
My example: As you can see, the yellow stripe above the door of the first part disappears, because the third part doesn't change livery when the whole train is reversed. First part does change from graphic with yellow stripe to the graphic without the yellow stripe.
But why doesn't it work for the other parts?
i struggle with the "vehicle_is_reversed"-Variable.
My example: As you can see, the yellow stripe above the door of the first part disappears, because the third part doesn't change livery when the whole train is reversed. First part does change from graphic with yellow stripe to the graphic without the yellow stripe.
But why doesn't it work for the other parts?
Code: Select all
//** -------------------- ID108 ZB ABe 130 -------------------- **//
spriteset(gr_abe_130_a, "gfx/schmalspur/emus/ABe130.PNG"){tmpl_32_short(0,20)} // Grafik A
spriteset(gr_abe_130_a_rev, "gfx/schmalspur/emus/ABe130.PNG"){tmpl_32_short(0,60)} // Grafik A backwards
spriteset(gr_abe_130_b, "gfx/schmalspur/emus/ABe130.PNG"){tmpl_32_short(0,100)} // Grafik B
spriteset(gr_abe_130_c, "gfx/schmalspur/emus/ABe130.PNG"){tmpl_32_short(0,140)} // Grafik C
spriteset(gr_abe_130_c_rev, "gfx/schmalspur/emus/ABe130.PNG"){tmpl_32_short(0,180)} // Grafik C backwards
spriteset(gr_abe_130_purch, "gfx/schmalspur/emus/ABe130.PNG"){tmpl_purchase(0)} // Grafik Purchase
switch(FEAT_TRAINS,SELF,sw_abe_130_articulated,extra_callback_info1){
1..2: abe_130;
CB_RESULT_NO_MORE_ARTICULATED_PARTS;
}
switch(FEAT_TRAINS,SELF,sw_gr_abe_130,position_in_consist_from_end % 3){
0: gr_abe_130_c;
1: gr_abe_130_b;
gr_abe_130_a;
}
switch(FEAT_TRAINS,SELF,sw_gr_abe_130_rev,position_in_consist_from_end % 3){
0: gr_abe_130_a_rev;
1: gr_abe_130_b;
gr_abe_130_c_rev;
}
switch (FEAT_TRAINS, SELF, sw_abe_130, vehicle_is_reversed ) {
0: sw_gr_abe_130;
sw_gr_abe_130_rev;
}
switch(FEAT_TRAINS,SELF,sw_abe_130_ve,position_in_consist){
1:visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC,0,ENABLE_WAGON_POWER);
visual_effect_and_powered(VISUAL_EFFECT_DISABLE,2,DISABLE_WAGON_POWER);
}
item (FEAT_TRAINS,abe_130,108) {
property {
sprite_id: SPRITE_ID_NEW_TRAIN;
name: string(STR_NAME_ABE_130);
climates_available: bitmask(CLIMATE_TEMPERATE,CLIMATE_ARCTIC);
introduction_date: date(2004,5,15);
model_life: VEHICLE_NEVER_EXPIRES;
speed: 100 km/h;
cost_factor: 65;
running_cost_factor:60;
bitmask_vehicle_info: bitmask(1);
running_cost_base: RUNNING_COST_ELECTRIC;
engine_class: ENGINE_CLASS_ELECTRIC;
visual_effect_and_powered: visual_effect_and_powered(VISUAL_EFFECT_ELECTRIC,-2,DISABLE_WAGON_POWER);
track_type: RT_ELNG;
power: 1541 hp;
cargo_capacity: 148;
weight: 69 tons;
tractive_effort_coefficient: 1;
refittable_cargo_classes: bitmask(CC_PASSENGERS);
non_refittable_cargo_classes: bitmask();
cargo_allow_refit: [];
}
graphics{
default: sw_abe_130;
articulated_part: sw_abe_130_articulated;
purchase: gr_abe_130_purch;
visual_effect_and_powered: sw_abe_130_ve;
additional_text: return string(STR_ADDITIONAL_TEXT_ABE_130);
}
}