RE: [GD-General] Scripting Systems
Brought to you by:
vexxed72
From: Richard <ri...@cc...> - 2004-01-30 21:45:11
|
> From: gam...@li... > [mailto:gam...@li...]On Behalf Of > Brian Hook >=20 > Do other languages handle this any better? JavaScript suffers from=20 > the same problems since it is also prototype-based (a la SELF et.=20 > al.). =20 We use Python which is not any better. Like yourself and Brett, we can also update things on the fly to make things easier although we don't pause the game under a debugger to do it although I can see how being able to freeze the game state and modify the logic without the state changing in the meantime would make it even easier to=20 rearrange the code to take advantage of the state. If there is an error in one of our scripts I can usually change the script and save it. The game hooks into the Windows and catches the file event and reloads the script replacing the designated elements in the script in their relevant namespaces. If the script was a service that ran and was called on by other game logic, all the objects that call on it would use the new version automatically. If the script was a class that was used by some logic or other, sometimes it is easier to kill the game and to restart it. For the most part however, I can generally just cause a new instance to be created and test that. Depending on what it is an instance of, if use of the functionality related to it in-game creates a new instance everytime, then its pretty straightforward. If not, then some selected statements in the console or the relevant web page can force it to be used and/or can ascertain that the new version no longer has the old problems. If the class changed is used by sub-classes of which there are instances of, it may error when these instances try to use methods on their inherited class (not 100% since it doesn't happen that often). Its a very nice environment to work in. But when I think of it, its not that different from the environment I used to use when I programmed in LPC under MudOS, the only real difference is that we didn't have scripts reloading automatically when the file was changed and that MudOS had no problems (that I remember) with instances that inherited classes which had since been replaced with changed versions. Richard. |