This page documents every AIScript action and how they interact/function/work in this game. Explanations are relatively brief, due to the fact every base action the game already has are very simple.
This list features tags for certain actions, which generally means that the action requires a special use-case.
All tags:
[SCRIPTED SEQUENCES ONLY]: This means the action will only have an effect on a scripted sequence, since it requires a possessed pawn.
[LATENT]: This means the action waits until a condition is met, before the action finishes.
[CONDITIONAL]: This means the action will return true or false. If it returns false, it will find the next EndSection action and skip to it.
[BROKEN]: This action is broken to some extent.
The formatting is as follows: <action> - [TAG(s)] <description>
<action> is the literal name of the action that you will see when searching for a new action.
- is a separator to declare when the action name is done being represented in text.
[TAG(s)] will show you any of the tags shown above. These tags are relatively self-explanatory, but make sure you understand them.
<description> will explain in text how the action is intended to act, and what it does. It can also provide additional information that may not be obvious at first glance.
ACTION_ChangeLevel - Loads the level <URL>. <bShowLoadingMessage> does nothing
ACTION_ConsoleCommand - Executes the console command <CommandSTR>. Keep in mind that this CANNOT run console commands outside the scope of its firing. This means that any console commands that only work when a PlayerController fires to them (so nearly every single useful console command) won't work. The main console command you can use is Set (which is extremely powerful), and certain other ones like Quit can be used
ACTION_DestroyActor - Destroys the actor with the tag <DestroyActor>
ACTION_DestroyPawn - Destroys the instigated pawn, or if using a ScriptedTrigger, will destroy its own script
ACTION_DisplayMessage - Displays a message to the KW log (use the console command ShowCM to see it) with the message <Message> (helpful for debugging). <bBroadcast> and <messageType> does nothing
ACTION_EndSection - Used by conditional actions, such as ACTION_IfCondition and ACTION_IfRandomPct. If an action returns false, the action number in the script will skip every action until it reaches an EndSection action. The amount of ACTION_EndSection should equal the amount of conditional actions. If you do not make these equal, you'll run into accidental script terminations
ACTION_Freeze - [LATENT] Freezes the entire script, including the current animation being played by the possessed pawn
ACTION_GotoAction - Goes to action <ActionNumber>. This action is very commonly used to allow for looping scripts, as well as making conditional scripts
ACTION_IfCondition - [CONDITIONAL] Takes a condition from a TriggeredCondition actor in the level tagged <TriggeredConditionTag> and checks the condition status on it. Will return the condition of the TriggeredCondition
ACTION_IfRandomPct - [CONDITIONAL] Takes a percentage (in decimal form) and returns true if it hits that percent chance
ACTION_LeaveSequence - Leaves the sequence, causing the script to permanently end
ACTION_PlayAmbientSound - Changes the values of AmbientSound on the possessed pawn to the values provided. Calling to this action with a sound volume of 0 will turn off the sound the possessed pawn is currently playing
ACTION_PlayLocalSound - Plays the sound <Sound> without localizing the sound
ACTION_PlaySound - Plays the localized sound <Sound>. The location is relative to the currently possessed pawn
ACTION_PlayMusic - Plays the music track <Song> from ..\Music\ and loops the music
ACTION_SetHidden - Changes the value of <bHidden> on the actor with the tag <HideActorTag>
ACTION_SpawnActor - Spawns in the actor <ActorClass> in real-time. Can be configured to be assigned a custom tag and a positional offset
ACTION_TeleportToPoint - Teleports the current instigated pawn to the actor with the tag <DestinationTag>. If there is no instigated pawn, it teleports the current player instead. <bPlaySpawnEffect> does nothing
ACTION_TriggerEvent - Fires to event <Event>
ACTION_WaitForEvent - [LATENT] Waits until the event <ExternalEvent> is fired to
ACTION_WaitForTimer - [LATENT] Waits until <PauseTime> seconds have passed
ACTION_ForceMoveToPoint - [SCRIPTED SEQUENCE ONLY] Forcefully teleports the possessed pawn to point <DestinationTag>. Since this forcefully teleports the possessed pawn, all collision is turned off for the pawn, so only use this if it's absolutely necessary and you know what you're doing
ACTION_FreezeOnAnimEnd - [SCRIPTED SEQUENCE ONLY] [LATENT] Waits for the current animation to finish playing, then holds the last frame of the animation. If the first action in the script is ACTION_WaitForEvent, calling for this same event again will restart the script
ACTION_MoveToPoint - [SCRIPTED SEQUENCE ONLY] [LATENT] Moves the possessed pawn to the actor with the tag <DestinationTag>
ACTION_Run - [SCRIPTED SEQUENCE ONLY] Turns on the possessed pawn's ability to run
ACTION_Walk - [SCRIPTED SEQUENCE ONLY] Turns off the possessed pawn's ability to run
ACTION_SetPhysics - [SCRIPTED SEQUENCE ONLY] Changes <Physics> on the possessed pawn to <NewPhysicsMode>
ACTION_SetViewTarget - [SCRIPTED SEQUENCE ONLY] Tells the possessed pawn to turn to the actor with the tag <ViewTargetTag>
ACTION_PlayAnim - [SCRIPTED SEQUENCE ONLY] Plays animation <BaseAnim> on the possessed pawn. Can be heavily configured
ACTION_StopAnimation - [SCRIPTED SEQUENCE ONLY] Stops playing the current animation on the possessed pawn
ACTION_TurnTowardPlayer - [SCRIPTED SEQUENCE ONLY] [LATENT] Similar to ACTION_SetViewTarget, but makes the possessed pawn turn to the player constantly
ACTION_WaitForAnimEnd - [SCRIPTED SEQUENCE ONLY] [LATENT] Waits until the current animation finishes playing on the possessed pawn
ACTION_WaitForPlayer - [SCRIPTED SEQUENCE ONLY] [LATENT] Waits until the current player is within a <Distance> unit radius of the possessed pawn
ACTION_ChangeScript - [BROKEN] Exits the current AI script and activates another. While this may technically work, this doesn't since all AIScripts start from the beginning of the map loading. What you can do instead is use ACTION_TriggerEvent to start another ScriptedTrigger, then use ACTION_LeaveSequence (in that order)
ACTION_ChangeWeapon - [BROKEN] The weapon system isn't officially supported in Shrek 2
ACTION_Crouch - [BROKEN] Crouching isn't officially supported in Shrek 2
ACTION_DamageInstigator - [BROKEN] Would damage the instigator of the script, but this uses a different and outdated system for damaging the player, meaning it doesn't work
ACTION_FadeView - [BROKEN] [LATENT] Would fade the game's screen to a certain color, but it doesn't use the system made by KnowWonder, making it useless
ACTION_FinishRotation - [BROKEN] [LATENT] Would wait until the possessed pawn fully rotates toward its goal, but this doesn't seem to finish correctly
ACTION_KeepCurrentRotation - [BROKEN] Would prevent the pawn from rotating toward its goal, but this doesn't seem to work
ACTION_KillInstigator - [BROKEN] Would kill the instigator of the script, but this uses a different and outdated system for killing the player, meaning it doesn't work
ACTION_MoveToPlayer - [BROKEN] [LATENT] Moves the instigator of the script to the current player. This has a major bug however where the action never ends, so it's recommended to not use this
ACTION_SetAlertness - [BROKEN] Shrek 2's AI never uses the native alertness system
ACTION_ShootTarget - [BROKEN] The weapon system isn't officially supported in Shrek 2
ACTION_StopShooting - [BROKEN] The weapon system isn't officially supported in Shrek 2
ACTION_ThrowWeapon - [BROKEN] The weapon system isn't officially supported in Shrek 2