Sense the VM simulates a CPU, also think about a muti-threading approch with Pcode(script) instanceing, parent/child linking, and messageing between those instances.
You could concieveably create a bunch of object scripts...a script for a particular type of gun, another for a particular type of armor, particular type of movement (running, walking, jumping, etc)...and pieceing them together in parent/child relationships under an AI script...and instance them with a particular game character/enemy/whatever...in this way even simular enemies can have different weapons, and effects at thier disposal, and completely customizeable at run time without haveing to generate bloated AI scripts that take all variations into account.
Obviously this would require a little more planning and work in terms of the VM...effectively a bit like writeing a OS for the VM in that you would need the equivelant load utility to get scripts into memory for VM use, a resource/process manager to maintain the scripts in memory and introduce them once loaded to the VM, as well as the appropriate garbage collection utilities to clear unused scripts from memory and general clean-up duities....then of course the VM would need to work with time slices, or other means of multi-processing control, as well as a means to swap between executeing processes...but it shouldn't be that hard.
You could concieveably create a bunch of object scripts...a script for a particular type of gun, another for a particular type of armor, particular type of movement (running, walking, jumping, etc)...and pieceing them together in parent/child relationships under an AI script...and instance them with a particular game character/enemy/whatever...in this way even simular enemies can have different weapons, and effects at thier disposal, and completely customizeable at run time without haveing to generate bloated AI scripts that take all variations into account.
Obviously this would require a little more planning and work in terms of the VM...effectively a bit like writeing a OS for the VM in that you would need the equivelant load utility to get scripts into memory for VM use, a resource/process manager to maintain the scripts in memory and introduce them once loaded to the VM, as well as the appropriate garbage collection utilities to clear unused scripts from memory and general clean-up duities....then of course the VM would need to work with time slices, or other means of multi-processing control, as well as a means to swap between executeing processes...but it shouldn't be that hard.