Some reminders to avoid some common mistakes (will prevent headaches):
- File pipes (|) are NOT string token seperators, use semi-colons (;)
- Token strings must be put in quotes, ie. "arms;legs;chest" etc.
- You cannot send params to a timed event (eg. callevent 2.0 shoot_fire FIRE_TARGET ), you must pass the vars via setvard
- You cannot pass params directly from one event to another (eg. callevent pass_on PARAM1 PARAM2) you must store the vars and pass them, eg:
local PASS_PAR1 PARAM1
local PASS_PAR2 PARAM2
callevent pass_on PASS_PAR1 PASS_PAR2
- You cannot pass reserved words directly to an event (eg. "callevent do_retaliate ent_laststruck" must be "callevent do_retaliate $get(ent_laststruck,id)"
- You cannot use string comparisons for reserved words (eg. "if PLAYER_ID equals ent_owner" must be "if PLAYER_ID equals $get(ent_owner,id)"
- Media (sounds/models/sprites) in #include'ed scripts must precached by the top script
- All media used in a summoned script must be precached by the summoning script (including client side fx)
(You can use precachefile [summon_file_name] in game_precache event.)
- The 'precache' command works on a different parser. It therefor will be activated inside comments, and does not parse quotes proper.
- Beware if you have a var and a const of the same name, weird stuff will happen (prob true of locals as well)
- "else if" is the same as "if", it will check both conditions
- "else" is sometimes buggy, I've not found the details as to why
- in a shared sub, clientside and serverside vars will NOT match up
- in a shared sub, if you use a server side command, all subsequent client commands are ignored
- global vars (setvarg) are not shared between client and server
- further, $get() statements do not work clientside, only $getcl, which can pull only a very limited number of properties (see scripting_alldocs.txt)
- if you are building a new stronger or weaker monster by using #include of another monster script, use const NPC_BASE_EXP, or it will have the same XP value as the #include'd monster

Limit your embeded backwards includes.
For a good example as to why this is important, try to figure how swords_longsword works...
Trace it backwards, and it includes all these files:
swords_longswords
swords_base_twohanded
swords_base_onehanded
axes_base_twohanded	//these axe bases hardly make sense
axes_base_onehanded
base_melee
base_weapon
base_item
Suffice to say, that's a LOT Of code to sort through to find out if ONE of your damned vars is being changed somewhere in some unexpected way.
Try to consolidate, and keep all your includes, or as many as possible, in the top script - to save time backtracking.
If you MUST have a lot of backwards include, try to have them all in the top most script

Preferred Conventions:
Vars should be UPPPER_CASE with at least two parts seperated by an underscore (less picky on locals)
Vars should not match names of any key words, regardless of case (bad programming habbit, also makes hard to read with syntax highlights)
Events should be lower_case with at least two parts seperated by an underscore
Bracket seperators must be on their own, individual lines. ie:
if ( XXX_XXX == YYY_YYY )
{
	callevent do_stuff
}
That last bit is less of a convention, but rather a syntax, as it plain old won't work otherwise. 
Also remember SPACES ARE PARSERS, so "if (XXX_XXX==XXX_XXX)" will NOT work, nor will "$get(ent_me, hp )"

Script Optimization:
Save memory:
- If the var is not used outside of the event, use a "local"
- Try to use media that is already precached (see your log_msdll.log for a precache list)
Save processing time:
- keep calleventloops short
- if you need to pull server data that isn't going to change multiple times in a script (such as game.players or game.pvp) - store it in a var once, rather than pulling it repeatedly
- this is especially important when pulling cvar's repeatedly, as it is a relatively CPU consuming process
- don't use repeatdelay for events that are conditional (rather, have an event call itself with a delay)

