AI Manual *new*
Posted: Sat Jun 21, 2008 9:32 am
***************************
**** AI Command Manual ****
***************************
Syntax for commands will be shown like this:
requiredText, TEXT_YOU_MUST_CHANGE, [OptionalText]
++++ For CORE Only: ++++
Random Waypoints
Syntax: randomWaypoints, [SPEED]
Description: Moves the core (and everything) to random waypoints on the screen. Speed defaults to 1.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Waypoints
Syntax, waypoints, LOOP(1 or 0), SPEED, X, Y, [X, Y]
Description: Moves the core (and everything) to set x,y coordinates on the screen. Specify as many x,y pairs as desired. Setting loop to 0 will cause the motion to stop after it reaches its final waypoint, 1 means it will go back to the first waypoint when it's done.
Note: If you use randomWaypoints prior to waypoints, you may want to run "stop, randomWaypoints" as well.
Follow Ship
Syntax: followShip, [SPEED]
Description: Moves the core (and everything) toward the player's ship. The core will not go closer than 50 pixels. Speed defaults to 1.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Random Rotate
Syntax: randomRotate, [SPEED]
Description: Rotates the core (and everything) in a random direction and random speed (where user specified speed is max). Speed defaults to 15.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Rotate toward ship
Syntax: rotateToShip, [SPEED]
Description: Rotates the core (and everything) toward the player's ship. The core will not go within 20° of the ship on both sides. Speed defaults to 1.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Gun: Double
Syntax: coreGun_double
Description: Shoots 2 spike bullets in a random direction.
Gun: Spread
Syntax: coreGun_spread
Description: Shoots a shockwave of bullets in all directions, then 7 bullets in a random direction.
Gun: 4 Way, 2 Shot
Syntax: coreGun_4way_2shot
Description: Shoots a pair of bullets in 4 opposite directions
Gun: Twin Rapid
Syntax: coreGun_twinRapid
Description: Rapidly shoots in 2 directions. Random direction that gradually changes.
++++ For any PARTS: ++++
Rotate
Syntax: rotatePart, PART#, SPEED, [MIN_ANGLE], [MAX_ANGLE], [START_ANGLE]
Description: Rotate a part at the specified velocity (Ex: for a magnitude of 2 and direction of backwards use "-2"). The rotation will bounce back and forth in between MIN and MAX angles (degrees) or will continually rotate if you specify 0 and 0 (or specify nothing at all).
Example: rotatePart, 4, -2, 0, 45 //Rotate part 4, with velocity of -2, between 0° and 45°
Example: rotatePart, 4, 1 //Rotate part 4, with velocity of 1, forever
Rotate to ship
Syntax: rotatePartToShip, PART#, [MORE_PART#]
Description: Rotate parts to the exact angle where the player's ship is. Hint: Point guns straight up in the editor. You may specify as many parts as desired.
Invincible
Syntax: makeInvincible, PART#, [MORE_PART#]
Description: Make PART# invincible. Note that invincible behaviour has changed slightly, for instance, shooting an invincible part will no longer make parts attached to it flash from damage. You may specify as many parts as desired.
Vulnerable
Syntax: makeVulnerable, PART#, [MORE_PART#]
Description: Set PART#'s hp to its original value. You may specify as many parts as desired. This doesn't do anything on its own, so use it with a trigger.
Disable Gun
Syntax: disableGun, PART#, [MORE_PART#]
Description: Make PART# unable to shoot. You may specify as many parts as desired.
Enable Gun
Syntax: enableGun, PART#, [MORE_PART#]
Description: Make PART# capable of shooting again. You may specify as many parts as desired. This doesn't do anything on its own, so use it with a trigger.
Destroy
Syntax: destroy, PART#, [MORE_PART#]
Description: Destroy PART#. You may specify as many parts as desired. This isn't interesting on its own, so use it with a trigger.
Change colour
Syntax: col, HEX_COLOUR, PART#, [MORE_PART#]
Description: Change the colour of PART#. You may specify as many parts as desired. This isn't interesting on its own, so use it with a trigger.
Example: col, FF0000, 1,2,3,4 //Set some parts to red
++++ ADVANCED: ++++
Death Trigger > Any Command
Syntax: makeTrigger, death, SOURCE_PART#, ANY_COMMAND
Description: Execute any command the isntant SOURCE_PART# is dead. You can have more than one trigger at the same time (see Example)
Example: makeTrigger, death, 7, destroy, 1, 2
makeTrigger, death, 7, enableGun, 3, 4
Time Trigger > Any Command
Syntax: makeTrigger, time, FRAMES, ANY_COMMAND
Description: Execute any command at the specified START_FRAME. If used within another trigger then START_FRAME will be relative to current frame (see Example(2)). You can have more than one trigger at the same time (see Example(3)).
Example(1): makeTrigger, time, 300, destroy, 0 //Destroy core after 10 seconds
Example(2): makeTrigger, death, 1, makeTrigger, time, 300, destroy, 0 //Destroy core 10 seconds after part 1 dies
Example(3): makeTrigger, time, 60, destroy, 1, 2
makeTrigger, time, 60, enableGun, 3, 4
Repeating Trigger > Any Command
Syntax: makeTrigger, timeRepeat, START_FRAME, REPEAT_AFTER_FRAMES, ANY_COMMAND
Description: Execute any command at the specified START_FRAME then repeat it whenever the number of frames specified in REPEAT_AFTER_FRAMES passes.
Example: makeTrigger, timeRepeat, 90, 60, col, FF0000, 0 //After 3 seconds, colour the core red every 2 seconds.
Stop > Repeating Command
Syntax: stop, ANY_REPEATING_COMMAND
Description: Stop a repeating command, also can stop a Repeating Trigger. Specify the parameters you used originally if you want to be specific about which action to stop. This isn't interesting on its own, so use it with a trigger.
Example: Assuming you have "randomWaypoints": stop, randomWaypoints
Example: Assuming you have "rotatePart, 5, 1": stop, rotatePart
Example: Assuming you have "rotatePart, 5, 1 and rotatePart, 4, 2": stop, rotatePart, 5 OR stop,rotatePart, 5, 1
Example: Assuming you have "makeTrigger, timeRepeat, 0, 30, col, FF0000, 0": stop, makeTrigger, timeRepeat, 0, 30, col, FF0000, 0
**** AI Command Manual ****
***************************
Syntax for commands will be shown like this:
requiredText, TEXT_YOU_MUST_CHANGE, [OptionalText]
++++ For CORE Only: ++++
Random Waypoints
Syntax: randomWaypoints, [SPEED]
Description: Moves the core (and everything) to random waypoints on the screen. Speed defaults to 1.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Waypoints
Syntax, waypoints, LOOP(1 or 0), SPEED, X, Y, [X, Y]
Description: Moves the core (and everything) to set x,y coordinates on the screen. Specify as many x,y pairs as desired. Setting loop to 0 will cause the motion to stop after it reaches its final waypoint, 1 means it will go back to the first waypoint when it's done.
Note: If you use randomWaypoints prior to waypoints, you may want to run "stop, randomWaypoints" as well.
Follow Ship
Syntax: followShip, [SPEED]
Description: Moves the core (and everything) toward the player's ship. The core will not go closer than 50 pixels. Speed defaults to 1.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Random Rotate
Syntax: randomRotate, [SPEED]
Description: Rotates the core (and everything) in a random direction and random speed (where user specified speed is max). Speed defaults to 15.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Rotate toward ship
Syntax: rotateToShip, [SPEED]
Description: Rotates the core (and everything) toward the player's ship. The core will not go within 20° of the ship on both sides. Speed defaults to 1.
WARNING: Can no longer specify this more than once in order to get it to move faster. Specify a speed value instead.
Gun: Double
Syntax: coreGun_double
Description: Shoots 2 spike bullets in a random direction.
Gun: Spread
Syntax: coreGun_spread
Description: Shoots a shockwave of bullets in all directions, then 7 bullets in a random direction.
Gun: 4 Way, 2 Shot
Syntax: coreGun_4way_2shot
Description: Shoots a pair of bullets in 4 opposite directions
Gun: Twin Rapid
Syntax: coreGun_twinRapid
Description: Rapidly shoots in 2 directions. Random direction that gradually changes.
++++ For any PARTS: ++++
Rotate
Syntax: rotatePart, PART#, SPEED, [MIN_ANGLE], [MAX_ANGLE], [START_ANGLE]
Description: Rotate a part at the specified velocity (Ex: for a magnitude of 2 and direction of backwards use "-2"). The rotation will bounce back and forth in between MIN and MAX angles (degrees) or will continually rotate if you specify 0 and 0 (or specify nothing at all).
Example: rotatePart, 4, -2, 0, 45 //Rotate part 4, with velocity of -2, between 0° and 45°
Example: rotatePart, 4, 1 //Rotate part 4, with velocity of 1, forever
Rotate to ship
Syntax: rotatePartToShip, PART#, [MORE_PART#]
Description: Rotate parts to the exact angle where the player's ship is. Hint: Point guns straight up in the editor. You may specify as many parts as desired.
Invincible
Syntax: makeInvincible, PART#, [MORE_PART#]
Description: Make PART# invincible. Note that invincible behaviour has changed slightly, for instance, shooting an invincible part will no longer make parts attached to it flash from damage. You may specify as many parts as desired.
Vulnerable
Syntax: makeVulnerable, PART#, [MORE_PART#]
Description: Set PART#'s hp to its original value. You may specify as many parts as desired. This doesn't do anything on its own, so use it with a trigger.
Disable Gun
Syntax: disableGun, PART#, [MORE_PART#]
Description: Make PART# unable to shoot. You may specify as many parts as desired.
Enable Gun
Syntax: enableGun, PART#, [MORE_PART#]
Description: Make PART# capable of shooting again. You may specify as many parts as desired. This doesn't do anything on its own, so use it with a trigger.
Destroy
Syntax: destroy, PART#, [MORE_PART#]
Description: Destroy PART#. You may specify as many parts as desired. This isn't interesting on its own, so use it with a trigger.
Change colour
Syntax: col, HEX_COLOUR, PART#, [MORE_PART#]
Description: Change the colour of PART#. You may specify as many parts as desired. This isn't interesting on its own, so use it with a trigger.
Example: col, FF0000, 1,2,3,4 //Set some parts to red
++++ ADVANCED: ++++
Death Trigger > Any Command
Syntax: makeTrigger, death, SOURCE_PART#, ANY_COMMAND
Description: Execute any command the isntant SOURCE_PART# is dead. You can have more than one trigger at the same time (see Example)
Example: makeTrigger, death, 7, destroy, 1, 2
makeTrigger, death, 7, enableGun, 3, 4
Time Trigger > Any Command
Syntax: makeTrigger, time, FRAMES, ANY_COMMAND
Description: Execute any command at the specified START_FRAME. If used within another trigger then START_FRAME will be relative to current frame (see Example(2)). You can have more than one trigger at the same time (see Example(3)).
Example(1): makeTrigger, time, 300, destroy, 0 //Destroy core after 10 seconds
Example(2): makeTrigger, death, 1, makeTrigger, time, 300, destroy, 0 //Destroy core 10 seconds after part 1 dies
Example(3): makeTrigger, time, 60, destroy, 1, 2
makeTrigger, time, 60, enableGun, 3, 4
Repeating Trigger > Any Command
Syntax: makeTrigger, timeRepeat, START_FRAME, REPEAT_AFTER_FRAMES, ANY_COMMAND
Description: Execute any command at the specified START_FRAME then repeat it whenever the number of frames specified in REPEAT_AFTER_FRAMES passes.
Example: makeTrigger, timeRepeat, 90, 60, col, FF0000, 0 //After 3 seconds, colour the core red every 2 seconds.
Stop > Repeating Command
Syntax: stop, ANY_REPEATING_COMMAND
Description: Stop a repeating command, also can stop a Repeating Trigger. Specify the parameters you used originally if you want to be specific about which action to stop. This isn't interesting on its own, so use it with a trigger.
Example: Assuming you have "randomWaypoints": stop, randomWaypoints
Example: Assuming you have "rotatePart, 5, 1": stop, rotatePart
Example: Assuming you have "rotatePart, 5, 1 and rotatePart, 4, 2": stop, rotatePart, 5 OR stop,rotatePart, 5, 1
Example: Assuming you have "makeTrigger, timeRepeat, 0, 30, col, FF0000, 0": stop, makeTrigger, timeRepeat, 0, 30, col, FF0000, 0