Page 1 of 1
(done) default values for exvar when nil
Posted: Fri Nov 16, 2007 12:19 pm
by Joramun
Ok, I often (when using RTSB or other stuff) have the following "trouble" :
- potions/bombs without power
- walltext and scrolls without text
- other item without charge.
I suggest to have default values in the base code, like :
in the scroll subrenderer :
Code: Select all
if not exvar[id].text then
num_lines = 0
else
normal behavior
end
And the same for potions, and other items that require values right now, and will cause the game to crash / report a bug if not set.
I understand it was not implemented in order to report "missing" stuff to the designer,
but it might be intended to have no text in scroll (e.g.) and in any case,
crashing the game because of a small mistake like that or a potion without power is a bit harsh for playtesting.
Posted: Fri Nov 16, 2007 8:47 pm
by Sophia
Joramun wrote:crashing the game because of a small mistake like that or a potion without power is a bit harsh for playtesting.
True.
I wonder, though, should it just completely silently substitute a default value, or should it print a complaint message?
Posted: Fri Nov 16, 2007 8:53 pm
by Joramun
I would say both. In any case, if you don't want the game to crash, you need to provide a healing value to a cure potion (e.g.)
Posted: Fri Nov 16, 2007 8:59 pm
by Remy
If it's oriented towards just getting through playtesting and debugging, it should report it so the designer remembers to fix it. If it's supposed to act as an alternative to setting those values - i.e., a true default value - it shouldn't.
I tend to lean towards the first in the two given examples (potions and scrolls - scrolls can be blanked out by setting 'text' to an empty string, "", in the final release), but I wonder where else this might be a problem.
Posted: Fri Nov 16, 2007 10:06 pm
by Parallax
I think it's a really a case-by-case decisio, depending on items.
A scroll without text is just a blank text, I'm not sure if DSB should even say anything about it. It definitely should not crash.
A potion without a power is a problem, though, to the extent that a function calls for that power. So while I'm not a fan of DSB exiting with an error message, I'd definitely would like one to be displayed in-game, in the ugliest and most mood-breaking color that can be found, as it will motivate the dungeon designer to fix the problem.
Items without charge. Once again, to the extent that a function associated with the item calls for a charge, I'd like an error message displayed, and no charge exvar.
The difference between the scroll and the other two examples is that in the case of a scroll, looking at it to see its text does not imply the game doing anything with the information beyond displaying it, whereas the power of potions and charges of charged items are critical for the game to keep track of.
Posted: Fri Nov 16, 2007 10:53 pm
by Sophia
I think Parallax has the right idea.
There's actually an ugly shade of orange that's not used anywhere in normal DM that I've been using for that kind of stuff, because it stands out immediately... so, now, the game won't just boot you out, but it will complain in the console.
Posted: Sat Nov 17, 2007 5:40 am
by Paul Stevens
What I did in CSBwin in several places
is to shout out an error message the
first time some error occurred and
to quietly apply a default on subsequent
errors of the same general type. This
lets the designer know there is a problem
but does not keep interfering over and over
again.