On Sun, Feb 19, 2012 at 11:08 AM, Per Inge Mathisen <> wrote:
> On Fri, Feb 17, 2012 at 3:10 AM, buginator <> wrote:
>>> Because we have lots of events being called (and more being added all
>>> the time) that not every script should be forced to implement just to
>>> make the warnings disappear.
>>
>> Eh ? You are inviting bugs then, as can be seen by 001ef35faf1.
>
> I've fixed up the lint tool, and will be adding code to detect such
> errors in it.

Are you talking about be00eb4577603c56416005380d017177075130a4 ?
While testing like that is good, it don't really work unless you use it...

>> The codebase is still firing off events and if it isn't in the script
>> then it should be yelling that it can't find it, otherwise you open up
>> a can of worms, making pretty much all bug reports much, much harder
>> to see if the problem is in the codebase, or if it just happens to be
>> a script that didn't implement said "missing" function.
>
> What? Surely the bug reports will be harder to read when they are full
> of meaningless warnings.

LOG_WARNING only displays when compiled in debug builds, not release.
That means we can have instant feedback, not waiting for a separate
tool to be run.
When we make builds for release, then those are not shown.

>> If the script writer wants to ignore said "missing" function, then
>> they can NOP the function in question.
>
> This slows down processing of events *significantly*. And then I add a
> new event, and all old scripts start to produce warnings.

How would it be significantly slower, all the function does is NOP,
and there shouldn't be any major overhead in that.
Adding it to the 'list of functions that are not used in game' is
hardly more trouble than remembering to update the external tool to
check for the new event/trigger.

> Some scripts will then contain a few functions of real code, and
> dozens of no-op functions. Ugly.

You can put the ones that aren't used in one (or more files, perhaps
splitting them on what they are used for, like attack, defense,
structures, and so on...) file and just include that in any script
that don't need to override that.

>> We definitely should be warning/throwing out errors on all "missing"
>> triggers or events.
>
> Triggers, yes. Events, no.
>

Events are equally as important as triggers.  In both cases, the game
fires / calls it, and if not found, it means  that it was either a bug
(which the LOG_WARNING would have found in real-time, not wait for
reports from the field or using the external utility which may or may
not find the issue), or expected behavior, since it is unused.

_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to