If I made articulated vehicle consists of 10 elements by it:
Code: Select all
switch (FEAT_TRAINS, SELF, rs5q_articulated_part,
extra_callback_info1)
{
1..9: return rs5;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
}
item (FEAT_TRAINS, rs5)
{
property
{
cargo_capacity: 188;
..
}
graphics
{
articulated_part: rs5q_articulated_part;
}
}
and want to the first element to contain 188 units of cargo and others element contain no cargo, I use callback cargo_capacity:
Code: Select all
switch (FEAT_TRAINS, SELF, rs5_cargo_capacity,
position_in_vehid_chain)
{
0: return 188;
return 0;
}
It work when vehicle is purchased. But in purchase menu I see 10 * 188 == 1880 unis of cargo. I want see 188. I define separate purchase_cargo_capacity:
Code: Select all
switch (FEAT_TRAINS, SELF, rs5_purchase_cargo_capacity,
0)
{
return 188;
}
but I see 1880 units of cargo again.
Why it is multiply by count of elements, if I want to return single value in purchase_cargo_capacity callback? It is possible? What am I does wrong?
I can do this:
Code: Select all
switch (FEAT_TRAINS, SELF, rs5q_articulated_part,
extra_callback_info1)
{
1..9: return rs5int;
return CB_RESULT_NO_MORE_ARTICULATED_PARTS;
}
and define another item
Code: Select all
item (FEAT_TRAINS, rs5int)
{
property
{
cargo_capacity: 0;
..
}
}
to it work, but I want to save the identifiers and use one it instead of two.