AI Manual *new*

Scripting help, tricks, and tips. How to use the editor.
Post Reply
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

AI Manual *new*

Post by MD »

***************************
**** 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.
Image

Gun: Spread
Syntax: coreGun_spread
Description: Shoots a shockwave of bullets in all directions, then 7 bullets in a random direction.
Image

Gun: 4 Way, 2 Shot
Syntax: coreGun_4way_2shot
Description: Shoots a pair of bullets in 4 opposite directions
Image

Gun: Twin Rapid
Syntax: coreGun_twinRapid
Description: Rapidly shoots in 2 directions. Random direction that gradually changes.
Image

++++ 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.
Image

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
Last edited by MD on Tue Jun 24, 2008 5:37 pm, edited 3 times in total.
Mouzi
Posts: 153
Joined: Sat Sep 01, 2007 5:34 am
Location: Finland
Contact:

Post by Mouzi »

Hey, wait, does the "stop, rotate" mean it stops ALL rotating parts? :S
And how can it be "ANY_COMMAND"? :o
Wouldn't "stop, disableGun" be quite illogical :D

EDIT: And what happens if you put two rotatePart commands on one part and then use stop, rotate? Does it stop only another of them?
EDIT2: And "rotate" isn't even a command it's "rotatePart".
Last edited by Mouzi on Sat Jun 21, 2008 10:21 am, edited 1 time in total.
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Post by MD »

It was kind of a last minute thing :p

So I just updated it, hopefully that makes more sense.
asdasdg
Posts: 240
Joined: Sun Dec 28, 2008 11:27 am
Contact:

Re: AI Manual *new*

Post by asdasdg »

Would it be possible for you to make an individual pice waypoint system? I'm kinda wanting one for one of my levels that I plan to make.
raz3124
Posts: 16
Joined: Tue Jun 30, 2009 12:15 pm

Re: AI Manual *new*

Post by raz3124 »

Never mind.I got it.Thanks for your help!
zxzx89002
Posts: 14
Joined: Wed Oct 15, 2014 11:55 am

Re: AI Manual *new*

Post by zxzx89002 »

i do everything u say but nothing works...why ?


The Script



rotatePartToShip,PART#2,[MORE_PART#3]
rotatePart,PART#1,SPEED,[90],[180],[90-]
MD
Site Admin
Posts: 195
Joined: Sun Aug 12, 2007 2:06 pm

Re: AI Manual *new*

Post by MD »

zxzx89002 wrote:rotatePartToShip,PART#2,[MORE_PART#3]
rotatePart,PART#1,SPEED,[90],[180],[90-]
The words in CAPITALS should be replaced.

For instance, try this:

Code: Select all

rotatePartToShip, 2, 3
rotatePart, 1, 10, 90, 180, 90
zxzx89002
Posts: 14
Joined: Wed Oct 15, 2014 11:55 am

Re: AI Manual *new*

Post by zxzx89002 »

CANT BELIVE IT..IT WORKED \(^o^)/ :D :D
zxzx89002
Posts: 14
Joined: Wed Oct 15, 2014 11:55 am

Re: AI Manual *new*

Post by zxzx89002 »

how i can make parts move >_>

i only can move the core this isn`t what i want for future lvls :!:

i see alot of people do :O :shock:
Post Reply