Modding MI

Script Modding
          Basics
          Script Coding



Basics
Four movieclips script MI - making people appear at the right place at the right time, having the right backgrounds and dimensions, spawning guns at the appropriate points, etc.
These movieclips are called Banks. A movieclip reads these Banks, which is called the Scripter.
The Banks are:
          Frame 6 / main1 (mc.bank)
          Frame 6 / main2 (mc.bank)
          Frame 6 / main3 (mc.bank)
          Frame 6 / main4 (mc.bank)
The is also a Bank for the tutorial, but that is Redundant in the Swf version of the game.
The Scripter which reads the Banks is:
          Frame 6 / scripter (mc.scripter)



Script Coding
The Banks work by issuing a series of demands, which the game then does. These demands work very like Functions, but have some important differences.
The layout you use for a Demand is:
          new Array("target","function","parameters",hold_event,hold_variable)

Target
Target is the location of the function. For example, if you want to invoke a function in _root.gen, the target will say _root.gen.

Function
Function is the function you want to invoke. For example, if you want to invoke explode, the function will say explode.

Parameters
Parameters are the parameters of the function. Script parameters have a different layout to functions.
The layout you use for the Parameters is:
          type:value
To string several Parameters together, you put a ^ between them.
          type:value^type:value
type is the type of parameter it is. It can either be num, str or ref. To find out which, look at the Function Lists. If the function parameter is a number or a boolean, use num. If it is a string, use str. If it is a reference, use ref.
value is the value of the parameter. If the type is a num, the value is a number. If it is a str, it is a string. If it is a ref, it is the location of an object or variable.

Hold_Event
Hold_Event is the type of event the Scripter waits for before carrying on to the next demand. There are four types of Hold Event.
        0     Scripter immediately proceeds to the next event.
1Timer counts down from Hold_Variable. Scripter proceeds once Timer equals zero.
2Scripter proceeds once the number of enemies onscreen is less than Hold_Variable.
3Terminates the Script completely. Used at the end of the entire Script.
If you are using the Exe version of the Sourcecode (or if you fixed the Tutorial Glitch), there is also a fifth Hold Event.
        4     Scripter proceeds once you have pressed a number of Boxes equal to Hold_Variable.


Hold_Variable
The use for Hold_Variable varies depending on what the Hold Event is.
If the Hold Event is 0 or 3, the Hold Variable is not used, and might as well be set to 0, of left blank.
Otherwise, its use is described in Hold_Event.