adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] Adjustments to items.h ?


From: Alexandre Courbot
Subject: Re: [Adonthell-devel] Adjustments to items.h ?
Date: 15 Feb 2002 18:12:06 +0100

> Now I think we might be able to have the generic uses (those that only
> involve calculations on attributes) handled by the game engine. I.e. C++
> side.

Is it worth to write a C++ class just for doing simple arithmetic?
Others games that would use our engine may not want the same system as
us, and since the attributes calculation when using/combining would be
very simple, I don't think it's pertinent to put it on the C++ and make
things more static... I'm not against the idea, far from this, but the
calculation are only a special case of what an object can do. The one
that will be used the most often, but one case anyway.

> However, a python script could be attached to any of the use to handle
> everything that is not done by the generic code. Especially, the python
> scripts should be able to 'override' the normal code, to accomplish
> special behaviours. For example, a cursed foci might make flowers grow at
> the spot it is directed at, instead of roasting the opponent.
> 
> That could be done by checking the return code of the python script. If it
> is not 0, we continue with the normal mechanics, otherwise, we return
> immediately.

You could also check whether the Python method slot for this action is
NULL or not. This would be faster, I think. I plan to turn the schedules
stuff into something like this soon (would need to tune the
python_script class first).

Alex.
-- 
http://www.gnurou.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]