NReality Modifications

Mods for NReality take the form of a string added to the end of the standard map data. When the map is loaded, the string disappears and the modifications are applied. The string is formatted like this:

Contents

Background Image

This function allows a URL image to be inserted into the map. A Background Image will be displayed in the background and will be covered by tiles and objects.

Foreground Image

This function also allows a URL image to be inserted into the map. A Foreground Image will be displayed in front of everything else in the map, meaning if you want to see anything, you will need to use a program that can create transparency (e.g: GIMP, Photoshop etc). This excludes paint, so if that's all you have, then you cannot create transparency.

The foreground image can also be made into a color filter, as described here. To do this, add ?# to the end of the image URL, where # is a number between 1 and 14.

NRealityMapType

Any text in this slot will appear as a map's category when the map is displayed in the userlevels menu.

ObjectMod

This slot allows modifications to any type of object, though modifications to the ninja should be done in the playerMod slot. Modifications are applied to every object of the selected type, not to individual objects.

The modifications are formatted like this: objectNumber,property,modification;, and any number of them can be strung together.objectNumber indicates the type of object and currently must be some of the numbers between 0 and 141 depending on the object's number.property indicates the property of the object to be modified.modification indicates the new value of the property, and it must be a number.

Some of the modifications in here don't acctually go after the fourth "|", some of them need to be manually typed into the object data area as an object (e.g: 6^x,y,Path,0,122,direction, for a tile drone). This allows modifications to be applied to any single object.

About Special drones

Other types of drones can be created by modifying a part of the standard code for a drone (6^x,y,path,specialType,droneType,direction). x and y control the drone's coordinates, path controls the drone's pathfinding algorithm, specialType indicates whether or not the drone is the standard drone of its type (e.g., whether it is a seeker drone rather than a regular drone), droneType controls the type of drone, and direction controls the drone's direction.

Here are the parameters that can be set for each type of object:
(Note: not all parameters have an effect on gameplay.)

Zap Drone & Seeker Drone (0)

r
default = 9speed
default = 1chaseSpeed
default unknown
Note: the game treats 0 as the default value. If you want a drone to stop when it sees the ninja, use a very low value (like 1e-9) instead.

Also, speed and chaseSpeed can be modified per drone, by use of ^speed,chaseSpeed after the drone's code.

Laser Drone & Rotating Laser Drone (1)

r
default = 9speed
default= ???laserPrefireDelay
default = 30; determines the amount of time the drone will spend charginglaserPostfireDelay
default = 40; determines how long the drone will pause after firinglaserRate
default = 80; determines how long the drone will firelaserLen
default = 7; usage unknown

To create a rotating laser drone, replace the fourth attribute of a normal laser drone (specialType) with 1. The code for a rotating laser drone should look like 6^x,y,path,1,1,direction.

Modifications for the rotating laser drone:startingAngle
default = 0; controls the angle at which it startsrotateSpeed
default = 0.5; controls the speed and direction of rotationfixedLaserLength
no default value; if set, the laser will always be a fixed number of pixels long and can go through wallsalwaysMove
default = 0; if set to anything else, the laser drone will move as it fires and rotates.

Also, adding ^1,2,3,4,5 to the end of the code for a rotating laser drone will set the starting angle (1), rotation speed (2), the laser length (3), whether or not the laser moves (4), and its speed (5). This will override global modifications of these same attributes.

Chaingun Drone (2)

r
default = 9speedchaingunPrefireDelay
default = 35; determines the amount of time the drone will spend chargingchaingunPostfireDelay
default = 60; determines how long the drone will pause after firingchaingunMaxNum
default = 8; usage unknownchaingunRate
default = 6; determines the time, in frames, between each bulletchaingunSpread
default = 0.3; usage unknown

Gold (3)

r
default = 6

Bounceblock (4)

stiff
default = 0.05; controls the speed at which the block bounces back- very high or very low values may prevent it from doing somass
default = 0.2; controls the amount of force the block applies against the ninja- negative values make it propel the ninja forwardsleepThreshold
default = 40; determines how close the block has to come to its start position before it stops moving- low values make it stop soonersleepTimer
default = 0; usage unknown

Launchpad (5)

Gauss Turret (6)

closeAimSpeed
default = 0.05; determines how fast the crosshairs move when close to the ninja, represents the percentage of the distance between them coveredmidAimSpeed
default = 0.035; determines how fast the crosshairs move when a medium distance away from the ninjafarAimSpeed
default = 0.03; determines how fast the crosshairs move when far away from the ninjaaimSpeed
default = 0.03; determines how fast the crosshairs move the frame after the turret firesouterThreshold
default = 9216; determines how far away from the ninja is considered "far" awaymidThreshold
default = 1764; determines what is considered to be "mid" distance from the ninjainnerThreshold
default = 576; determines how close the crosshairs must be to the ninja to be considered "close"shotRate
default = 60; controls the minimum time between shotsshotTimer
default = 0; usage unknownfireDelayTimer
default = 0; usage unknownprefireDelay
default = 10; controls the turret's warm-up timepostfireDelay
default = 10; controls the turret's cooldown time

Surface Guards (7)

r
default = 6speed
default = 5.1428568

Ceiling guards are created by adding ^1 to the code of a floorguard (4^x,y). Its speed can be changed by adding ^1,speed instead. A wall guard is created by adding either ^2(left) or ^3(right) instead.

...although adding ^0 for the normal floorguard is completely unnecessary.

Values over about 30 for guards will only continue to increase the guards' aesthetic size; the size of their collision detection zone caps at about 30.

Important note: Increasing guards' size can have adverse effects on their placement; when one attempts to load the code, it changes the guard's location on the Y axis to compensate for the size (so that the bottom of the guard will still touch the bottom). When going into the editor, it reverts changes, but keeps the coordinates intact, which leads to newly located guards, moved upwards. Adding the code again and loading will again compensate, moving the guard even further up. Furthermore, attempting to move the guard manually in the editor, while helping, still does not completely eradicate the changes; when exiting out of the editor, the guards will be moved back up, though to a lesser amount.

Added also is an always chase function.

4^x,y,1^type,speed,alwaysChase

alwaysChase: default 0, set it to 1 if you want it able to always chase the ninja

The further you increase the proportions, the more "bouncy" it becomes. This is hardly noticeable at all for smaller values over the default of 9, but for higher values it becomes increasingly easy to trigger the "bounciness" (which seems to be easier to trigger the faster you come at it, and is always easier on the sides). Any values over about 26 pixels for either dimension (though the x dimension is *slightly* more sensitive to this) will cause it to be reliably "bouncy," making it so it is impossible to stay touching it for more than a frame or two at a time. The collision detection seems to cap at about 30 pixels wide/tall, but the magnitude of the "bounciness" continues to increase with no known limit, eventually killing the ninja the moment he hits the collision box, which is nested deep inside the sprite. Furthermore, while the blue "zap" part at the end continues to zap correctly upon impact (up to about 30), the thwump's collision with tiles does not seem to scale at all. It will "hit" the tile about a normal thwump's length away from the end of it, meaning the blue "zap" part can easily clip through many tiles, along with the rest of it.

These can be added at the end of the code in the ObjectMod section or on to any individual drone.

detectRadius
default = 100; controls the distance at which the drone starts firingforcePower
default = 4; controls the force at which the ninja is pushed away from the drone (note: the ninja's velocity is reset when the drone fires, like when he hits a launchpad)forceDelayTimer
default = 10; controls the length of the drone's cooldown time (the drone keeps moving during this time, unlike other drones)forceMaxCount
default = 3; controls the number of consecutive shots the drone can fire before recharging for a longer timeforceMaxCountDelay
default = 200; controls the time spent recharging after forceMaxCount is reachedalwaysMove
default = 0; controls whether or not the force field drone will stop when it activates it force field; 0 for stopping, 1 for continuing.

These properties, as well as the additional properties for all objects, can be modified in the standard way:speed
default = 1;r
default = 9;

Ghost Drone (101, 102, or 103)

Ghost drones follow the ninja whenever he isn't looking and stop when he is. The main difference between the types is that the second type does not hurt the ninja when stopped, and the third type acts like a rocky drone when stopped.

These can be added at the end of the code in the ObjectMod section or on to any individual drone.

acceleration
default = 0.02; controls how fast the drone accelerates towards the ninjamaxvelocity
default = 2; controls how fast the drone can goalwaysChase
default = undefined; if set to 1, the first type of drone will not stop movingminAlpha
default = 0; controls how completely the second type can fade away

Rocky Drone (121)

This drone is essentially a platform that moves like a drone.

6^x,y,path,0,121,direction^speed,chase_speed

Change number in bold to 1 to make the drone seeking.

These properties, as well as the additional properties for all objects, can be modified in the standard way:speed
default = 1;r
default = 9;

Tile Drone (122)

This drone will place tiles behind it as it travels.

6^x,y,Path,0,122,direction^speed,chase_speed,tiles

Change number in bold to 1 to make the drone seeking.

Tiles is the text string for the tile pattern, it is just like the map data, the tile drone will loop through the string to lay the tiles. For example, if you use "NN10", the drone will place two 5-tiles, an E-tile, a space, and then repeat.

Alarm Drone (132)

This drone will emit a circular laser going outwards when it sees the ninja. The ninja will die upon contact with the laser.

laserMinRadius, the min radius of the laser, default 30
laserMaxRadius, the max radius of the laser, default 400
radiusUp, the increase rate of the radius, default 1
radiusDown, the decrease rate of the radius, default 2
neverDown, if it is set to 1 then the laser will never decrease in size
alwaysMove, if it is set to 1 then the drone will move even when it sees you

Greedy Drone (141)

This drone can steal or give time/gold to the ninja.

6^x,y,Path,0,141,direction^speed,chase_speed,collect_coin

Change number in bold to 1 to make the drone seeking

For collect_coin:
value for stealing 1 second = -40
value for stealing 1 frame = -1
value for giving player 1 second = 40
This value must be an integer.

AI Pathing Objects

All objects except rocket launcher and floor guard can be applied for Drone's AI Pathing system on it.

Circular Pathing

Path ID 7: append the following to the drones/objects:
^^^,7,direction,speed,startAngle,Radius

This will use objects' original position as center; x,y

Chase Pathing

Path ID 10: append the following to the drones/objects:
^^^,10,direction,speed,chaseWhenSighted,chaseKeepUpdate

chaseWhenSighted: makes the object/drone chase the ninja only when the it sees the them.
chaseKeepUpdate: makes the drone/object keep updating the path when it sees the ninja

Coordinate Pathing

Path ID 8: append the following to the drones/objects:
^^^x1.y1:x2.y2:x3.y3:x4.y4,8,direction,speed

You can have as many x?.y? positions as you want.
When it moved to the last point it will move back to the first point.

Custom Path

Path ID 6: append the following to drones:
6^x,y,6,0,droneType,direction^^^customPath
Append the following to objects:
^^^custompath,6,0,speed

CustomPath is formed with U (up) D (down) L (left) R (right) and every letter represents a tile moved in that direction.

When the end of a custom path is reached, it loops back to the beginning of the custom path to do it all over again. If you need to stop an object from further loops, insert any letter other than U, D, L or R at the end (e.g: B). This will stop the drone moving after the first loop.

For example, using ^^^UR will make the drone zig-zag diagonally upwards. Because there is no stop letter, the drone will not stop, even when it reaches the edge of the map.

Triggerable Objects

Objects can be "triggered" on and off via special door switches. "Off" objects will simply stop moving and not detect the ninja player at all, but they still detect collision, so an "off" zap drone, for example, is still dangerous.

To add "Trigger" to a door switch, append
^startTriggers(if you are using more than one, separate with "."),stopTriggers(separated by ".") to the door switch object (which starts with 9^)

To make the object triggerable, append
^^waitForTrigger,startTriggers(separated by "."),stopTriggers(separated by ".")

waitForTrigger should be set to 1 when you don't want an object or drone moving right away. This is commonly confused with startTriggers.startTriggers are the trigger(s) which start movement of the drone/object after using waitForTrigger.

Special Triggers

To add "Special Trigger" to a door switch, append
^startTriggersID(separated by "."),stopTriggersID(separated by "."),startSpecialTriggersID(separated by "."),stopSpecialTriggersID(separated by ".") to the door object.

To make the object special triggerable, append
^^waitForTrigger(boolean, 0 or 1),startTriggersID(separated by "."),stopTriggersID(separated by "."),startSpecialTriggersID(separated by "."),stopSpecialTriggersID(separated by ".")

If you want to make the drone 'chase' the ninja, use AI Pathing Objects to chase the ninja. You can then ajust the x and y offset to your taste.

Note: Non english characters will not be able to be shown on all users computers.

Custom Icon

To set Custom Icons to objects, use
||||objectType,_icon,x_offset^y_offset^url

Beware that in N, all the object icon sizes are scaled down by default, so the image you loaded will probably be scaled down too. You can set _xscale,100 and _yscale,100 to restore your image's default size.
The eye movieclip of the drone will disappear if you change its icon.

Since the image loaded into the object will not auto center itself, you will probably need to set x_offset and y_offset to adjust the correct position of the image to the object.

Additional Properties

There are also some properties relating to an object's display that can be applied to anything. Note that these will not affect gameplay, though.

_xscale controls an object's width. The input is a number of pixels, so setting this to 20 would make the object appear to be 20 pixels wide._yscale is the same as _xscale, except it applies to height._alpha controls an objects transparency, and can be anything from 0 to 100, with 0 being invisible._color controls an object's color, and can modify red, green, and blue values for the object.
It can be set to a value in the format red%.redMod.green%.greenMod.blue%.blueMod.transparent%.transparentMod. The "%" values multiply that channel by the given percent (e.g., if blue% was 50, the object's blue hues would be half as intense). The "Mod" values add the given amount to that channel.

PlayerMod

The syntax for this slot is much like the syntax for the objectMod slot, except without the identifier number: property,modification;. Again, any number of these can be strung together.

Here is a list of all modifiable properties:

r
default = 10maxspeedAir
default = 5; controls the maximum speed the ninja can accelerate up to in the air (the ninja can go faster if he is propelled by something else, though)maxspeedGround
default = 5; controls the maximum speed the ninja can accelerate up to on the groundgroundAccel
default = 0.15; controls the ninja's acceleration on the groundairAccel
default = 0.1; controls the ninja's aerial accelerationg
default = 0.15; controls gravity until the first time the ninja jumpsd
default = 0.99; controls air resistance until the first time the ninja jumpsnormGrav
default = 0.15; controls gravity after the ninja has jumpednormDrag
default = 0.99; controls air resistance after the ninja has jumpedjumpGrav
default = 0.025; controls gravity for a short time after the jump button is pressed for as long as it it heldmax_jump_time
default = 30; controls the maximum amount of time that jump gravity can apply to the ninjawinDrag
default = 0.8; controls the speed the ninja experiences after he passes the activated exit door. Increase to make him move faster away from it, or set to "0" to stop moving completelywallFriction
default = 0.13; controls the friction the ninja experiences while wallslidingskidFriction
default = 0.92; controls the friction the ninja experiences while sliding to a stop (note: higher values mean less friction, and values above 1 cause the ninja to speed up)standFriction
default = 0.8; controls the friction the ninja experiences as he stops sliding entirelyjumpAmt
default = 1; controls the strength with which the ninja pushes off from the floor/slopes/wallsjump_y_bias
default = 2; controls the upwards motion (downwards if negative) the ninja experiences regardless of where he jumps fromterminal_vel
default = 9; controls the speed at which hitting the ground becomes deadlynoWallJump
default = 0; set to 1 to disable wall jumpnoWallSlide
default = 0; set to 1 to disable wall slidemaxJumpCount
default = 1; set to 2 to enable double jump (i.e. you can jump in air), set to 3 to enable triple jump and so on, set to 0 to disable floor jumpjumpResetYSpeed
default = 0; set to 1 to reset coordinate Y speed when jumping

AreaTrigger

Area Triggers allow objects to only respond when the ninja is in a certain area of the map. This can apply to everything regular triggers apply to, including AI chasing drone, laser and chaingun drone, and AI pathing on anything (this allows for some control over the ninja's movement, but it is not the same as activating/deactivating playerMods).

Placed after the playerMods, i.e. after six |'sobjectnumber^x0.y0:x1.y1^startTriggersID,stopTriggersID,specialOnTriggersID,specialOffTriggersID
with multiple of the same type of triggerIDs being seperated by periods.

(x0,y0) and (x1,y1) form the rectangle area that triggers things, and the triggerIDs do the same thing as the door switch trigger.

You can make multiple area triggers by putting ; between two of the above.