This is a fast tutorial on how to spawn hero parties with action points.

For this tutorial I used Unearth and KeeperFX. This tutorial should also work for Dungeon Keeper, and other map editors should also be able to create action points and hero gates.

The reason why we spawn heroes at action points and hero gates instead of just putting them everywhere on the map, is mostly to make sure we don't reach any creature limits. But it can also be used to hide the heroes and surprise the player.

Scripting documentation

KeeperFX scripting reference: https://keeperfx.net/wiki/New-and-Mo...cript-Commands
DK1 scripting reference: https://lubiki.keeperklan.com/dk1_do...ipting_ref.htm

Download the map

You can download the map used in this tutorial at this URL: https://mega.nz/file/DIlDCCZL#OvJ_FY...zFEDG5lFL33cIc

For KeeperFX you can simply drop these files in your /levels/standard folder.




Spawn party when reaching an action point

We can spawn a party when reaching an action point to surprise the player.

1. In Unearth we'll select the Action Point. You'll have to change from Slab mode to Thing mode at the top.



2. We'll set an appropriate Point range for the action point in the Properties window.



The range is in subtiles. You'll have to play around a little to figure out the right range you'll want to use.
In this example you see I chose 3, but for the image in the 5x5 room below this will be 7.

3. Put the action point in a room



You'll probably not want to do this on Red claimed ground, but in our example this makes it easy to test out the functionality.

4. Create the party to spawn

In your mapscript we'll create the party. It will not be spawned yet.

Code:
REM -- Create a hero party to spawn
CREATE_PARTY(BARB_PARTY)
ADD_TO_PARTY(BARB_PARTY,BARBARIAN,1,250,ATTACK_DUNGEON_HEART,0)
ADD_TO_PARTY(BARB_PARTY,BARBARIAN,1,250,ATTACK_DUNGEON_HEART,0)
This party is named BARB_PARTY and consists of 2 Barbarians. There are some other parameters defined for stuff like their level, their carried gold, their objective and an extra delay for which they wait to spawn.

5. Spawn the party when reaching this action point

Code:
REM -- Spawn a hero party at action point 3 when reaching action point 3
IF_ACTION_POINT(3,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARB_PARTY,3,1)
	QUICK_INFORMATION(1, "Action point 3 triggered. Heroes spawned at action point 3.", 3)
ENDIF
I chose action point number 3 in step 3. You'll have to match this number in your script.

6. Now heroes will spawn when any creature triggers the action point



Super easy!

Documentation:
- CREATE_PARTY
- ADD_TO_PARTY
- ADD_PARTY_TO_LEVEL




Spawn party a bit further

For this example we will spawn the party a bit further in a room so the player has some time to react. We can also spawn them like this to prevent us reaching the map creature limit. We'll just spawn them a few rooms further in such cases.

1. Create an action point in the hallway towards the room where to spawn them



2. Create an action point where to spawn them



3. Spawn the heroes at action point 2 when we reach action point 1

Code:
REM -- Spawn a hero party at action point 2 when reaching action point 1
IF_ACTION_POINT(1,PLAYER0)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARB_PARTY,2,1)
	QUICK_INFORMATION(0, "Action point 1 triggered. Heroes spawned at action point 2.", 2)
ENDIF
We can always re-use any existing hero parties, and spawn them as many times as we want.

The hero party will now spawn when any creature reaches the action point.






Spawn heroes at a hero gate

This is just as easy as spawning them at an action point.
However, in the map script we'll make the number of the gate negative. That means we'll use number -1 to refer to hero gate 1.

Example where we spawn them after 1 minute:

Code:
REM -- Spawn a hero party after 1 minute
REM --		20 turns = 1 second
REM --		20 * 60 = 1200
IF(PLAYER0,GAME_TURN >= 1200)
	ADD_PARTY_TO_LEVEL(PLAYER_GOOD,BARB_PARTY,-1,1)
	QUICK_INFORMATION(2, "1 minute passed. Heroes spawned at hero gate 1", -1)
ENDIF
And as you see they will spawn after 1 minute






Spawn a tunneller party.

Tunneller parties can be nice in some levels to put pressure on the player. In this example we'll make them spawn at hero gate number 2. (Which is referred to as -2 in the script)

Its important to have a way for them to reach your dungeon.



When spawning a tunneller party, we can just use an existing hero party and when spawning the party we will add the tunneller.

Here is an example to spawn them after 2 minutes:

Code:
REM -- Spawn a tunneler party after 2 minutes
REM -- Using ADD_TUNNELLER_PARTY_TO_LEVEL will also add the tunneller to the party
IF(PLAYER0,GAME_TURN >= 2400)
	ADD_TUNNELLER_PARTY_TO_LEVEL(​PLAYER_GOOD,BARB_PARTY,-2,DUNGEON,PLAYER0,​1,250)
	QUICK_INFORMATION(3, "2 minutes passed. Tunneler party spawned at hero gate 2", -2)
ENDIF
And in game it will look like this:



Documentation:
- ADD_TUNNELLER_PARTY_TO_LEVEL
- ADD_TUNNELLER_TO_LEVEL (can be used for a tunneller without a party)




Enjoy!