That's where Extender Functions come in. Here's an example:
function Scream(this Character*)
{
this.Say("AAAAARRRRGGGGHHHHHH!!!!");
}
This adds a new "Scream" function to the Character type, so that in your script code
elsewhere you can do things like:
player.Scream(); character[EGO].Scream();and so on.
Where do I put this code?
In the script header, you'd put:
import function Scream(this Character*);
and then put the main function in the script file. This will then allow it to be used by other scripts.