This extension plugin requires Alpha ABS Z to work.
- Overview
- Prerequisites
- Quick Start Guide
- Spawn Point Configuration
- Implementation
- Spawn Types
- Advanced Settings
- Troubleshooting
- Script API
- Examples
The Spawn Points extension allows you to create dynamic enemy spawning systems in your Alpha ABS Z game. You can configure spawn points that will automatically generate enemies based on various conditions and settings.
Key Features:
- โ Multiple spawn types (self, region, player-based)
- โ Configurable spawn rates and limits
- โ Conditional spawning with switches
- โ Player proximity detection
- โ Custom events on spawn completion
- โ Full script API for advanced control
Before using Spawn Points, ensure you have:
- Alpha ABS Z plugin installed and configured
- Spawn Map set up - see Enemy Spawning guide
- Enemy events created on your Spawn Map
โก Important: The Spawn Map is essential for spawn points to work. It contains the enemy events that will be spawned on your game maps.
- Open Plugin Parameters โ Enemy settings group โ Spawn Points
- Click Add to create a new spawn point
- Configure the basic settings:
- ID: Give it a unique identifier (e.g., "forestSpawner")
- Spawn Type: Choose "self" for basic spawning around the event
- Events to spawn: Enter the enemy event IDs from your Spawn Map (e.g., "1, 2, 3")
- Create or select an event on your map
- Add a comment command to the event page
- In the comment, write:
<absSpawnPoint:ID>- Replace
IDwith your spawn point's ID from Step 1
- Replace
Example: <absSpawnPoint:forestSpawner>
<absSpawnPoint> comment.
| Parameter | Type | Description | Default |
|---|---|---|---|
| ID | Text | Unique identifier for the spawn point | "spawnPoint" |
| Spawn Type | Select | Where enemies spawn (self/region/player) | "self" |
| Radius or Region | Extended Value | Spawn area size or region ID | "3" |
| Events to spawn | Extended Value | Enemy event IDs from Spawn Map | "1, 2, 3" |
| Parameter | Type | Description | Default |
|---|---|---|---|
| Max | Extended Value | Maximum total spawned enemies (0 = unlimited) | "3" |
| Max alive | Extended Value | Maximum alive enemies at once (0 = unlimited) | "2" |
| Rate | Extended Value | Spawn interval in seconds (minimum 1) | "4" |
| Parameter | Type | Description | Default |
|---|---|---|---|
| Switch | Switch | Conditional switch (0 = always spawn) | 0 |
| Visor | Number | Player detection radius (0 = always active) | 3 |
| On Reach Max | Common Event | Event called when max spawns reached | 0 |
// Event page with spawn point comment
<absSpawnPoint:mySpawner>You can have multiple spawn points with different configurations:
// Forest area spawner
<absSpawnPoint:forestSpawner>
// Cave area spawner
<absSpawnPoint:caveSpawner>
// Boss area spawner
<absSpawnPoint:bossSpawner>Spawns enemies around the spawn point event itself.
Best for: Static spawn locations, guard posts, nests
Configuration:
- Radius: Distance from the spawn point event where enemies can appear
- Example: Radius of 3 means enemies spawn within 3 tiles of the event
Spawns enemies within a specific map region.
Best for: Area-based spawning, territorial enemies
Configuration:
- Region: The region ID where enemies will spawn
- Example: Region 5 means enemies spawn anywhere within region 5
Spawns enemies around the player's current position.
Best for: Dynamic encounters, pursuit enemies
Configuration:
- Radius: Distance from the player where enemies can appear
- Example: Radius of 5 means enemies spawn within 5 tiles of the player
Many parameters support Extended Values, allowing for dynamic configurations:
// Static value
"5"
// Variable reference
"10|V"
// Formula
"10|V + 2"
// Random number from list
"1, 2, ..."Use switches to control when spawning occurs:
- Switch 0: Always spawn (no condition)
- Switch 1-N: Only spawn when the specified switch is ON
Control spawning based on player proximity:
- 0: Always active (spawns regardless of player position)
- 1-N: Only spawn when player is within N tiles of the spawn point
Execute custom logic when spawn limits are reached:
// Example: Show message when area is cleared
// Set in "On Reach Max" parameter
Common Event 1:
Show Text: "All enemies in this area have been defeated!"โ Spawn point not working
- Ensure the event page contains the
<absSpawnPoint:ID>comment - Verify the spawn point ID matches the one in plugin parameters
- Check if the conditional switch (if used) is ON
โ No enemies spawning
- Verify the Spawn Map is properly configured
- Check if the enemy event IDs exist on the Spawn Map
- Ensure spawn limits haven't been reached
โ Enemies spawning in wrong location
- For region spawning: Verify the region is painted correctly on the map
- For self/player spawning: Check the radius value
- Ensure spawn areas have passable tiles
โ Too many/few enemies
- Adjust "Max alive" parameter to control simultaneous enemies
- Modify "Rate" parameter to change spawn frequency
- Use "Visor" parameter to control when spawning is active
The plugin provides a comprehensive API for advanced spawn point control:
// Get the last spawned enemy (useful for immediate actions)
let lastEnemy = uAPI.getLastSpawnedEnemy();
if (lastEnemy) {
console.log("Enemy spawned at position:", lastEnemy.x, lastEnemy.y);
}
// Get all enemies spawned by a specific spawn point
let spawnedEnemies = uAPI.getSpawnPointSpawnedEnemies(eventId);
spawnedEnemies.forEach(enemy => {
console.log("Enemy HP:", enemy.AABattler().hp);
});
// Get total count of enemies ever spawned by this spawn point
let totalSpawned = uAPI.getSpawnPointSpawnedTotal(eventId);
console.log("Total enemies spawned:", totalSpawned);
// Get count of currently alive enemies from this spawn point
let aliveCount = uAPI.getSpawnPointSpawnedAlive(eventId);
console.log("Enemies still alive:", aliveCount);// Example: Reward player when all spawned enemies are defeated
if (uAPI.getSpawnPointSpawnedAlive(5) === 0 &&
uAPI.getSpawnPointSpawnedTotal(5) > 0) {
$gameParty.gainGold(100);
$gameMessage.add("Area cleared! Bonus gold awarded!");
}
// Example: Adjust difficulty based on spawn count
let totalSpawned = uAPI.getSpawnPointSpawnedTotal(3);
if (totalSpawned > 10) {
// Make future enemies stronger
$gameSwitches.setValue(10, true);
}
// Example: Special action for the latest spawned enemy
let lastEnemy = uAPI.getLastSpawnedEnemy();
if (lastEnemy) {
// Make it glow or add special effects
lastEnemy.requestAnimation(1);
}| Function | Parameters | Return Type | Description |
|---|---|---|---|
getLastSpawnedEnemy() |
None | Game_Event | null |
Returns the most recently spawned enemy |
getSpawnPointSpawnedEnemies() |
eventId: number |
Game_Event[] |
Returns array of all spawned enemies from specific spawn point |
getSpawnPointSpawnedTotal() |
eventId: number |
number |
Returns total count of enemies ever spawned by the spawn point |
getSpawnPointSpawnedAlive() |
eventId: number |
number |
Returns count of currently alive spawned enemies |
You can find comprehensive examples in the Demo Project, map SpawnPoints (ID 37) ๐บ๏ธ
{
"id": "guardTower",
"spawnPointType": "self",
"spawnRadius": "2",
"spawnMax": "5",
"spawnAliveMax": "2",
"spawnRate": "6",
"spawnEnemiesId": "1, 2",
"visorRadius": 4
}{
"id": "forestRegion",
"spawnPointType": "region",
"spawnRadius": "3",
"spawnMax": "0",
"spawnAliveMax": "3",
"spawnRate": "8",
"spawnEnemiesId": "5, 6, 7",
"conditionSwitch": 15
}{
"id": "pursuitSpawner",
"spawnPointType": "player",
"spawnRadius": "4",
"spawnMax": "10",
"spawnAliveMax": "1",
"spawnRate": "3",
"spawnEnemiesId": "10",
"visorRadius": 0
}If you need additional help:
- Check the Alpha ABS Z Wiki
- Visit the KDWorkshop for updates and support

