Michi_cc wrote:In its current state, SquirrelGRF looks mainly like a straight translation of NFO, only with fancy text strings instead of hex numbers. And I can't imagine the benefits of adding an essentially equal second method of doing the same as the NewGRF-system getting even close to outweight the drawbacks.
The problem here is the way OpenTTD organises its data. Spritesets, spritegroups.. you name it, everything was designed to hold data as defined in a NFO file. Doing things differently would require major code restructuring. It's not impossible, but it's difficult in a week and a half.
And, regarding outweighing the drawbacks, this is how you prevent passenger carriages from being attached to a consist in SquirrelGRF:
Code: Select all
function attach (wagon)
{
return (GetCargoType(wagon) == 0) ? 0xFD : 0xFF;
}
SetRailVehicleStats (9, { wagonattach = attach });
Do you think that its NFO counterpart is as legible as this?
maquinista wrote:...
Thank you for your ideas. I'm afraid, however, that some of them may be too advanced for the current state of the patch.
DaleStan wrote:Finally:
cirdan wrote:AndyLandy wrote:The biggest issue here is the frequently-quoted observation from Patchman -- Why not NFO?
From my point of view, that question amounts to: Who needs a C compiler when we have hex editors?
The ELF specs are there, the processor ABI and specs are there, the library APIs are there; so who needs a toolchain?
Ignoring for the moment that you aren't writing a toolchain, NFO is portable. ELF is not.
Oh, I see, it's only a matter of portability. In fact, I now realise that C is chosen over manually writing machine code because of its portability alone. Ease of use has nothing to do with it.
And it was an example. It was there to hint an intelligent person in the right direction, not to be taken literally.
DaleStan wrote:EDIT: Also, I think it's interesting how many times this has been said, and by how many different (not-me) people, in the last three pages. Each quote comes from a separate post. Two people are quoted twice, everyone else is quoted once.
...
Please don't quote me out of context.
What I said, and I stand by my words, is that
cirdan wrote:I agree that a something-to-NFO converter would be the best option, but I disagree with you in that it only has advantages. In fact, I see one big disadvantage: no implementation and no working plan. While this does not, by itself, make it impossible, I do consider it far more difficult than what I'm doing; and the amount of thought that the idea has been given on this forum, without any visible results, reassures me on this idea. Of course, I encourage anyone willing to prove me wrong to do so.
On second thoughts, I now realise that I was wrong. The best option is actually a device that reads your mind and writes the NFO file for you. That makes SquirrelGRF the third best option in my list (but still the only one with an implementation).
I like to speak through my code. I had an idea that (in my opinion) could benefit the community, so I wrote a patch for it and posted it for public review. I'm fine if it's disliked or nobody finds it interesting; I've had far more important patches torn apart to pieces in other projects. What bothers me from the discussion in this thread is that many people are opposing the idea just because they can think of a better option which no one has seen working. Sometimes the best is the enemy of the better. As i said, I like to speak through my code; I wish that those supporting the "best option" did the same.
Korenn wrote:That's nice, but seeing as we've already had the discussion that saying it is useless as long as nobody actually does it (which was your own argument!), there's no reason to stop cirdan from taking a different approach and seeing how far it can go.
I'm glad to see that there are still some people who get the point.
Korenn wrote:So far your predictions on why it can't work have all been proven wrong, so I don't see why it'll fail anytime soon. cirdan, keep at it!
It's funny indeed to see how some people's positions have changed from an initial "you're a moron and what you're trying to do can't be done" to "even if you've done it we still don't want it". And remember Maier's Law: If the facts do not conform to the theory, they must be disposed of.
----------
The only new feature in today's patch is the implementation of the wagon-attach callback. Not much, but it required understanding large parts of the code. Also, NFO uses the same codepath to determine the sprite to be used for a vehicle and to obtain a callback value. Since this is a mess, I had to design something new. (Technical part: The spritegroup defined in an Action 3 is really a multiplexing function that has to decide the real reason why it was invoked. But why do that when you can have multiple entry points?)
The attached sample file won't let you attach passenger carriages to your Ginzu A4s.