Tips and Tricks

From Aleph One Wiki

Jump to: navigation, search

Tips and Tricks for Scenario Designers under Aleph One

Contents

[edit] Alternate Textures by Map

With AlephOne, you can now change the textures used in each map on a map-by-map basis. This is done by MML texture assignments. The main MML script file performs the basic texture assignments for each texture collection. For each specific map, you can override those texture assignments and use custom textures or textures from another collection. Edit the resource fork of your map file, and add a TEXT resource (if not already there). In resource ID 128, reference the level and the MML resource ID for that level. Then create a TEXT resource ID for that level and enter the standard <texture> tags to assign textures.

EXAMPLE:

ID: 128

	<marathon_levels>
	
	<level index="12">
	<mml resource="1012"/>
	</level>
	
	</marathon_levels>

ID: 1012

	<marathon>
	<opengl>
	
	<texture coll="21" bitmap="52" normal_image="emrtextures/broken-window.jpg"
		opac_type="1"
		/>
	
	</opengl>
	</marathon>

IMPORTANT NOTE: These assignments stay in place after the map is completed, so if you want to restore the original texture assignment, you need to re-assign the texture in an MML resource for the following level. If your scenario is non-linear, you may want to perform texture assignments individually for every level to make sure that the correct textures are being used.

[edit] Fog

To use fog, you need to specify to turn on fog with MML. Similar to the above, you'll want to establish in the TEXT resource fork of the map file that you want to access MML for a specific level. Then in that level's resource ID, specify something like:

	<marathon>
	<opengl>

	<fog on="true" />

	</opengl>
	</marathon>

With the attributes of:

depth="x" (number of units distance still visible to the player; default value is 8)

landscape="true/false" (whether landscape textures are affected)

index="x" (0 = true above liquid, 1= true below liquid)


It is also possible to add color to the fog by including a child element within <fog>, e.g.,

       <fog on="true"> 
         <color red="x" green="y" blue="z" />
       </fog>

where x, y & z are values between 0 and 1.

If applied as a script to a specific level be sure to also specify MML for the map following this level; otherwise, the fog is persistent and will remain throughout the remaining levels. Therefore, in the following level's resource, you would have:

	<marathon>
	<opengl>

	<fog on="false" />

	</opengl>
	</marathon>

[edit] Music and Movies

Music and movies are also specified in the map's TEXT resource (ID 128) using MML. The following is an example of specifying a movie file to play at the beginning of the first level, and a music file to play continuously through the 2nd level:

	<marathon_levels>

	<level index="0">
	<movie file="Merlin's Prologue"/>
	</level>

	<level index="1">
	<music file="Music/Morgana Dance.mp3"/>
	</level>

	</marathon_levels>

[edit] Application Name

ghs: changing things that aren't provided for by MML is not supported, and could change or break at any time

Even though you renamed your AlephOne application, when you run the program, it still shows AlephOne as the running application. OS X works differently than OS 9, so if you want the name to show differently, you'll need to dig into the package contents of the application. Choose open package on the application, and inside the Contents folder is a file called Info.plist. Edit this file, and change the CFBundleGetInfoString and CFBundleName XML tag values. DO NOT change the CFBundleExecutable or you'll break the application. You can also change the version strings as well as the CFBundleSignature (if you use custom icons). For example:

   <key>CFBundleExecutable</key>
   <string>AlephOne</string>
   <key>CFBundleGetInfoString</key>
   <string>EMR for OS X</string>
   <key>CFBundleIconFile</key>
   <string>AlephOne.icns</string>
   <key>CFBundleIdentifier</key>
   <string>org.bungie.source.AlephOneCarbon</string>
   <key>CFBundleInfoDictionaryVersion</key>
   <string>6.0</string>
   <key>CFBundleName</key>
   <string>EMR for OS X</string>
   <key>CFBundlePackageType</key>
   <string>APPL</string>
   <key>CFBundleShortVersionString</key>
   <string>3.0</string>
   <key>CFBundleSignature</key>
   <string>27.?</string>
   <key>CFBundleVersion</key>
   <string>3.0</string>

[edit] Custom icons

If you have custom icons, it is optional to change the bundle signature. If you choose to do this, you'll have to do it both in the Info.plist file as well as the resource file for AlephOne (see next item for details on editing the resource). The easiest way to change the icons is to edit the *.icns files (you can find them in the applications package, Contents/Resources. Use an icon editor, such as Icon Machine III, to edit the OS X icons. If you do the latter, it isn't crucial to change the bundle, unless you want the icons to show up correctly under OS 9.

[edit] Fix center view (for keyboarders)

By default, AlephOne preferences are setup assuming that the player uses the mouse instead of the keyboard for movement controls (such as looking up and down, etc.). However, for keyboarders, there are specific keys assigned to look up, down, and center view. Unfortunately in the "Mouse" mode, the center view key causes a jagged stuttering movement when it levels your view (very annoying). To fix this, uncheck the Mouse checkbox in the Preferences.

[edit] Teleporter Pads

Using Lua scripting, you can create a teleporter pad that supports teleporting in and teleporting out on the same polygon (in-level teleport). The teleport in function is controlled by some other teleporter in the level or the prior level. You do not want to make the teleport in poly a teleport poly; otherwise, you'd teleport out immediately after you've teleported in. Instead you create a Lua script that teleports you out when you are standing on that poly IF some other condition has been met (such as a light activated).

I created a light-activated (light 63) teleport pad (polygon 170) using the following Lua script:

function init ()

  last_poly = -1;
  end

function idle ()
 
  player_poly = get_player_polygon (0 );
  if ((player_poly ~= last_poly) and (player_poly == 170) and 
     (get_light_state(63))) then
     teleport_player(0, 234);
     last_poly = player_poly;
     end
  end

You teleport in on the pad, you go to the controls to activate the pad as a teleport "out" (aka, turn on light 63), then go stand back on the pad, and away you go!

Personal tools