i hereby suggest syntax for procedures:
Code: Select all
CALL(switch_name)
this could automatically expand to NFO: ((var7E & 0) + var1C) to get the full 32-bit result
Moderator: Graphics Moderators
Code: Select all
CALL(switch_name)
That's not needed.Transportman wrote:What is the difference between the various error levels? I want to display a message like with FATAL when certain parameters* are set wrong, but I want to continue loading so that users can still change the parameters and solve it without too much problems. The ERROR level would be fine, but it doesn't give the big warning I want.
*The parameters set the availability of vehicles by changing the climates_available property, so changing during running games is relatively safe.
No. You would need to check for each grf you want to be compatible with explicitly.McZapkie wrote:I created forest replacement newgrf. I did not specified its name, therefore it inherited it from original forest name.
It works fine without another industry newgrf, but if other industry is loaded, there are two different industry with same name.
For a special reasons, I need to have both, but without name disambiguation.
Is it possible (without complicated "if grf status" chains) to keep original industry name without other industry set and change it if other industry sets are present?
Code: Select all
spritelayout logging_camp_slope_road_13_tile_layout {
ground { sprite: GROUNDSPRITE_NORMAL; }
childsprite {
sprite: logging_camp_slope_road_13_sprite ;
always_draw: 1;
}
}
Code: Select all
switch(FEAT_INDUSTRIES, SELF, industry_steel_mill_acceptance_switch_off,
(((waiting_cargo_1 > 2700) ? STORE_PERM(0,0x01) : waiting_cargo_1) *
((waiting_cargo_2 > 1700) ? STORE_PERM(0,0x02) : waiting_cargo_2)
)
) {
0 : return industry_steel_mill_production_wait; //one of waiting cargo == 0
return industry_steel_mill_production_full; // both waiting cargo > 0
}
Code: Select all
switch(FEAT_INDUSTRIES, SELF, industry_steel_mill_acceptance_switch_off,
((waiting_cargo_2 > 1700) ? STORE_PERM(0,0x02) : waiting_cargo_2)
) {
0 : return industry_steel_mill_production_wait; //one of waiting cargo == 0
return industry_steel_mill_production_full; // both waiting cargo > 0
}
Yes, if I haveTransportman wrote:Does it also happen the other way around (cargo 2 triggers storage you associate with 1)?
Code: Select all
switch(FEAT_INDUSTRIES, SELF, industry_steel_mill_acceptance_switch_off,
(((waiting_cargo_1 > 1600) ? STORE_PERM(0,0x01) : waiting_cargo_1) )) {...
Code: Select all
accept_cargo_types: [cargotype("IORE"),cargotype("COAL")];
It is OK, initially both registers have value 1 (set by build_prod_change) and are zeroded if there is huge stockpile, to control industry tile cargo_amount_accept switch.Transportman wrote:Also, are you sure you need > here and not <? I don't know the purpose of what you're coding, but based on the switch you posted I would have expected the other symbol.
Or an array of expressions instead of one big expression:frosch wrote:Use separate switches instead.
Code: Select all
switch(FEAT_INDUSTRIES, SELF, industry_steel_mill_acceptance_switch_off,
[waiting_cargo_1 > 2700 ? STORE_PERM(0,0x01) : STORE_PERM(1,0x01),
waiting_cargo_2 > 1700 ? STORE_PERM(0,0x02) : STORE_PERM(1,0x02),
LOAD_PERM(0x01) && LOAD_PERM(0x02)]
)
I don't recognise any industry set, which is using NML and waiting_cargo_x. ECS is written in pure NFO. FIRS is using cargo delivered data (cargo is consumed instantaneously).Transportman wrote:maybe you can check other industry sets, if they use waiting_cargo_x
Maybe it is an explanation. And these expression arrays looks much more clear than my "jenga" condition statements stylefrosch wrote:I would claim that NML does not short-circuit logical expressions
They might look more clear, but when they are not working, they are kind of useless. And I don't know if they are working as I'm not doing industry sets, but if they work (or not), a short post would be nice.McZapkie wrote:And these expression arrays looks much more clear than my "jenga" condition statements style
That is callback 14C. It is, indeed, called only when the industry is founded. There is no workaround for the 3-in 2-out cargo limitation for industries.McZapkie wrote:How often cargo_output switch is called?
I tried to implement such switch to cycle output cargoes, but seems that it is called only once when industry is founded.
- is it a bitmask of classes of the cargo to which the given vehicle is refitted?cargo_classes variable: class of the currently transported cargo
Code: Select all
switch(FEAT_ROADVEHS, SELF, refit_LCV_valu_check_graphic_switch, cargo_classes & CC_ARMOURED) {
0: return good_amount_spriteset_LCV_graphic_switch;
return valu_spriteset_LCV_graphic;
}
switch(FEAT_ROADVEHS, SELF, refit_LCV_mail_check_graphic_switch, cargo_classes & CC_MAIL) {
0: return refit_LCV_valu_check_graphic_switch;
return mail_spriteset_LCV_graphic;
}
I don't see anything obvious, unless you've got your sprite sheets wrong.McZapkie wrote:Any idea what I've messed up?
Users browsing this forum: No registered users and 5 guests