Skip to content

ABS Script Actions (SAction)

Pheonix KageDesu edited this page Aug 25, 2025 · 9 revisions

⚠️ Information actual for version 0.10.3 and above

ABS Script Actions (SActions) Guide

ABS Script Actions (SActions) are powerful shortcuts for script calls that allow you to create complex behaviors and actions within the Alpha ABS Z plugin. They provide a simple, standardized way to trigger various game events, effects, and state changes.

Key Features

🎯 Easy to use: Simple text-based commands that can be used in multiple contexts
🔗 Versatile: Works in Event Comments, Enemy Parameters, and Script Calls
🚀 Multiple Actions: Chain multiple actions together (since v0.10.3)
📡 Network Support: Compatible with multiplayer functionality

Quick Start

🥇 Direct Usage: Since version 0.8, you can call SActions directly in Events using Script calls User API
Multiple Actions: Since version 0.10.3, use multiple actions in one line, separated by commas

Usage Contexts

1. Event Comments

Use SActions in Event Comments for automatic triggers. See Extra Events Comments

<onVectorHit:an_138>           # Play animation 138 when any projectile hits event
<onVectorHit_44:ce_2>         # Start common event 2 when projectile with skill ID 44 hits event
<onStart:sw_10_true,vr_5_1>   # Turn on switch 10 and set variable 5 to 1 when event starts

2. Enemy ABS Parameters

Configure enemy behaviors. See ABS Enemies Settings

<onDeath:an_33>               # Play animation 33 when enemy dies
<onSeeTarget:ba_1,se_Alert>   # Show balloon and play sound when enemy sees target
<onHit:ef_shake_5>            # Shake enemy when hit

3. Script Calls in Events

Execute SActions programmatically with optional delays

uAPI.scriptAction("ba_1", this, 100);           // Play Balloon animation 1 above this Event after 100ms delay
uAPI.scriptAction("an_138,se_Bell1", this);     // Play animation and sound immediately
uAPI.scriptAction("ss_A_true,ce_5", null);      // Multiple actions without character reference

Multiple Actions Syntax

Format: action1,action2,action3
Execution: Actions are executed in sequence, left to right

Examples

an_138,ss_A_true              # Play animation 138 and turn on self switch A
ce_2,sw_43_true,vr_10_5       # Start common event 2, turn on switch 43, set variable 10 to 5
ef_shake_10,se_Bell1_90       # Shake character for 10 frames and play bell sound at 90% volume

Complete SActions Reference

Switch & Variable Control

Action Syntax Description Examples
Self Switch ss_SWITCH_VALUE[_EVID] Toggle self switches for events ss_A_true - Turn on self switch A
ss_B_false - Turn off self switch B
ss_C_true_5 - Turn on self switch C for event ID 5
Global Switch sw_ID_VALUE Control global game switches sw_43_true - Turn on switch 43
sw_222_false - Turn off switch 222
Variable vr_ID_VALUE Set variable values vr_54_100 - Set variable 54 to 100
vr_11_0 - Reset variable 11 to 0

Event & Common Event Control

Action Syntax Description Examples
Common Event ce_ID[_this] Start common events ce_43 - Start common event 43
ce_11_this - Start as part of current event
Map Event ev_ID Start specific map events ev_5 - Start event 5 on current map

Audio & Visual Effects

Action Syntax Description Examples
Animation an_ID[_EVID|_X_Y] Play database animations an_140 - Play on current character
an_120_12 - Play on event ID 12
an_55_10_20 - Play at map coordinates (10,20)
Sound Effect se_NAME[_VOLUME_PITCH] Play sound effects se_Bell1 - Play Bell1 at default volume
se_Alert_80_120 - Play Alert at 80% volume, 120% pitch
Balloon ba_NUMBER[_EVID] Show balloon icons ba_1 - Show balloon 1 on current character
ba_3_4 - Show balloon 3 on event ID 4

Character Effects

Action Syntax Description Examples
Shake ef_shake_TIME[_EVID] Make character shake ef_shake_10 - Shake current character for 10 frames
ef_shake_15_3 - Shake event ID 3 for 15 frames
Shatter ef_shatter_DX_DY[_EVID] Create shatter effect ef_shatter_4_4 - Shatter current character
ef_shatter_6_6_2 - Shatter event ID 2

ABS-Specific Actions

Action Syntax Description Examples
Enemy Parameter ap_PARAM_VALUE[_EVID] Change enemy AI parameters ap_viewRadius_6 - Set view radius to 6
ap_teamId_2_12 - Set team ID to 2 for event 12
Global Skill es_OWNER_TEAM_SKILL[_TARGET] Execute ABS skills es_0_-1_303 - Execute skill 303 on self
es_0_0_304_10_20 - Execute at coordinates (10,20)
es_0_1_300_0 - Execute on player
Add State as_STATEID[_EVID] Apply states to characters as_43 - Add state 43 to current character
as_12_5 - Add state 12 to event ID 5
AnimaX Action ax_NAME[_EVID] Trigger AnimaX animations ax_Attack - Play Attack animation
ax_Skill_34 - Play Skill animation on event 34

Parameter Details

Target Specification

  • No target: Action applies to the current character/event
  • _EVID: Action applies to event with specified ID
  • _0: Action applies to the player character
  • _X_Y: Action applies at map coordinates

Boolean Values

  • true: true, 1, on, yes (case-insensitive)
  • false: false, 0, off, no (case-insensitive)

Special Parameters

Enemy AI Parameters (for ap_ action)

Available parameters match those in ABS Enemies Settings:

  • viewRadius, returnRadius, teamId, notAgressive
  • noMoveInBattle, noApproach, heavy
  • And more...

Global Skill Parameters (for es_ action)

  • OWNER: Character ID who "owns" the skill (0 = event/current character)
  • TEAM: Team ID for targeting (-1 = self, 0 = player team, 1+ = enemy teams)
  • SKILL: Database skill ID to execute

Common Use Cases

Enemy Behaviors

<onDeath:an_33,se_EnemyDie,sw_10_true>     # Death sequence with animation, sound, and flag
<onSeeTarget:ba_1,ap_viewRadius_8>         # Alert behavior when spotting player
<onHit:ef_shake_5,se_Hit>                  # Hit reaction with shake and sound

Interactive Objects

<onTouch:sw_5_true,ce_10,an_50>            # Activate switch, start event, show animation
<onAction:vr_10_1,se_Switch,ef_shake_3>    # Increment counter, play sound, shake

Combat Events

<onVectorHit:ef_shatter_4_4,se_Break>      # Break effect when hit by projectile
<onVectorHit_25:as_12,an_65>               # Apply poison state when hit by skill 25

Advanced Examples

Complex Enemy AI

// In enemy onSeeTarget parameter:
"ba_1,ap_viewRadius_10,es_0_1_45,se_Alert_90"
// Show alert balloon, increase view range, cast spell, play alert sound

Interactive Puzzle

// In switch/lever event:
"vr_15_1,sw_20_true,ce_5,an_75_10_15,se_Mechanism"
// Set puzzle state, activate switch, start cutscene, show animation at coordinates, play sound

Conditional Sequences

// You can check variables/switches in Common Events called via ce_ action
// This allows for complex conditional logic beyond simple SActions

Troubleshooting

Common Issues

Action not executing

  • Check syntax: ensure underscores are used correctly
  • Verify IDs: make sure event/switch/variable IDs exist
  • Check context: some actions only work in specific contexts

Self switch not working

  • Ensure switch letter is uppercase (A, B, C, D)
  • Check if event ID is specified correctly
  • Verify the event exists on the current map

Animation not playing

  • Confirm animation ID exists in database
  • Check if target character/coordinates are valid
  • Ensure character is visible on screen

Sound not playing

  • Verify sound file exists in audio/se folder
  • Check volume/pitch values (0-100 for volume, any positive number for pitch)
  • Ensure file name matches exactly (case-sensitive)

Performance Considerations

Multiple Actions: While powerful, avoid excessive chaining in frequently-called events
Network Play: All SActions are automatically synchronized in multiplayer
Error Handling: Invalid actions are logged to console but won't crash the game

Best Practices

Use meaningful delays with uAPI.scriptAction() for cinematic sequences
Combine related actions in single SAction lines for cleaner event code
Test thoroughly especially when using multiple actions or complex parameters
Comment your usage in events for future reference

Resources

📚 Related Documentation:

🎮 Demo Project: See map SActions for working examples


This guide covers Alpha ABS Z version 0.10.3+. Some features may not be available in earlier versions.

Clone this wiki locally