Script Errors and Design Etiquette
Author | Topic: Script Errors and Design Etiquette |
---|---|
...b10010b...
Member # 869
|
written Wednesday, January 26 2005 14:53
Profile
Homepage
In a particular town, I call a relatively large number of town special states, pretty much all of which involve NPC interaction. If the town is hostile, none of these make sense and I don't want them to occur. Now, the *easiest* way for me to handle this, rather than have each state individually check the crime level, would be to have the START_STATE check the crime level, and if it's enough to make the town hostile, run code that contains an intentional syntax error (thus unloading the town script as soon as it's loaded). Apart from one unsightly error message when the party commits a crime and every time the town is loaded after that, there should be no other harmful side effects. Is it bad form to deliberately cause a scripting error to save myself a little work? Should I do it the right way (that is, manually put the check into every state) just to avoid the error message? Are there any problems with unloading the town script that I'm unaware of? [ Wednesday, January 26, 2005 14:54: Message edited by: Thuryl ] -------------------- The Empire Always Loses: This Time For Sure! Posts: 9973 | Registered: Saturday, March 30 2002 08:00 |
The Establishment
Member # 6
|
written Wednesday, January 26 2005 15:02
Profile
You should always try to prevent errors. Do it the right way. -------------------- Your flower power is no match for my glower power! Posts: 3726 | Registered: Tuesday, September 18 2001 07:00 |
...b10010b...
Member # 869
|
written Wednesday, January 26 2005 15:46
Profile
Homepage
You're right, of course. It'll save me work later if I do need to call a state even if the town is hostile, in which case I'll have to rewrite things the right way in any case. I was just throwing around an idea that came to mind, really. -------------------- The Empire Always Loses: This Time For Sure! Posts: 9973 | Registered: Saturday, March 30 2002 08:00 |