I need some advise regarding the use of parameters in an NFO. I'd also like to reply on a few posts. The question goes first:
I'm currently working on a scheme to map parameter bits to settings I want to use for SlowRails, but this makes things a bit difficult when checking against values set. I see the following possible answers, but maybe there are options I'm unaware about.
1) the "wastefull" answer: use a full parameter of 32 bits to store each and every setting, even if I'd only need a few bits from it. That would makes things easy of course, but somehow I don't feel good about doing it this way.
2) use testing by going one bit at the time. That would work, but I'm not too impressed by the coding style needed for it. Still, so far it seems to be the best option
3) apply an AND bitmask to the parameter so I only have the bits left I need for my test. This is the way I'd like to do it, but from what I've found out, the only way to do that and be able to use the result would be with an action D. If I understand the consequences of that action correctly, I'd need to reserve a parameter to store the result of any action D I want to use (which would logically best be parameter 0 I guess). I'm also not clear if it's allowed to use a parameter as both a source and a target in the same action D.
Any great advise from someone ?
Now it's time to reply:
supermop wrote:Wouldn't it be easier for the labels to be "slow, medium, fast" rather than specific speeds?
That would actually be rather difficult, because the meaning of "slow", "medium" and "fast" can differ a lot. Let's say I use those labels for the speeds I have now, then what do I do when I decide to add 120 km/h to the mix ? It's also easy to assign a 160 km/h loc to the _160 railtype, but when you label it as "fast", there's no guarantee the railtype is going to be fast enough.
cmoiromain wrote:Something else to consider with your label is the case of an eyecandy rail set, providing only new graphics (concrete based, grassy, etc...) without setting any speed limit.
I agree such rails are possible, but I see no problems introducing labels for them that don't conflict with those I'm using. On the contrary, the use of numbers makes it very unlikely I'll have a conflict with a railtype that isn't essentially the same as what I defined.
cmoiromain wrote:Also, this doesn't take monorail or maglev into account.
True: I didn't add monorail/maglev at the moment for some reasons, not least of them those tracktypes being significantly less popular. If it turns out there's a demand for slower versions of them, I'll look into adding it to SlowRails.
cmoiromain wrote:In my case, I'd love to use standard monorail and maglev along with the concrete based monorail and maglev released as newgrfs, without it affecting speed limit.
As I understand it, all that's needed is for someone to add those 2 extra railtypes you'd like to the game using a newGRF and they'll appear in the list. Since there are 12 slots available for extra railtypes, of which SlowRails currently only uses 6, such newGRF should be usable alongside SlowRails. But it's possible I got that wrong.