Modding MI

Applied Scripts
          Creating New Levels
          Enemy Creation Scripts



You should read the Script Modding section before this section.
Throughout this whole section, white parameters are mentioned in the Function Lists. Simply look up the appropriate function and parameters to find out what it does. Read the Script Modding section for more information. Some parameters which are coloured white may not be in the Function Lists, which means they are currently under construction.



Creating New Levels
Add a frame to mc.backgrounds. You may want to make this out of order of the others, so that you don't have to change all instances of the background in the Script Banks. This is fine, as you just give a Reference to a Frame.

new Array("_root","setbg","num:bgnum",0,0),
new Array("_root","setwalls","num:imin^num:iminwall^num:imax^num:imaxwall",0,0),
new Array("_root","clearpickups","",0,0),
new Array("_root.shutter","open","",1,30),

new Array("","","",1,60),
new Array("_root.shutter","close","",1,30),

bgnum is the frame number (in mc.backgrounds) of the background the level will have.

Inbetween those two pieces of code is the code for the level (enemies, weapons and suchlike). For that code, go to the Enemy Creation Scripts section.



Enemy Creation Scripts
In each level, the bulk of the script is Enemy Creation. It says who gets created where wearing what, carrying what.
This is pretty simple, and can be worked out from the Script Modding and Function Lists sections. However, here I will show how you modify this script in greater detail.

To change the current clothing type for enemies being created, you need to use the _root.setcostume function.

new Array("_root","setcostume","ref:setname",0,0),

setname is the Reference to the Costume Set (which are declared in Frame 4) which will be used on subsequently created NPCs.

To make individual enemies, you need to use the _root.gen.makeguy function.

new Array("_root.gen","makeguy","num:h^num:z^num:x^num:y^num:gtype",hold_event,hold_variable),

h is whether the character is the Player Character. If it is 0, it is an NPC. If it is 1, it is the Player Character.
z is whether the character is a Zombie or Jesus. If it is 0, it is normal. If it is 1, it is a zombie. If it is 2, it is Jesus.
x is the Horizontal Location of the character.
y is the Horizontal Location of the character.
gtype is the Guntype of the gun the character is carrying.

After the gtype (and before the last quote), the character creation may optionally have three other Parameters. If these Parameters are not decalared, they are all 0 (false) by default.

^isdoor^num:isjetpack^num:isbomb

isdoor is whether the character is coming out of a door (in the background).
isjetpack is whether the character is wearing a jetpack.
isbomb is whether the character is wearing a suicide bomb.