Get your own free workspace
View
 

Spawn

Page history last edited by Gamemaster 3 years, 11 months ago

 

Spawn

Usage:

                Spawn(ActorID, ZoneName, X, Y, Z, [RightClickScript], [DeathScript], [Instance])

Description:

The Spawn command allows you to create new NPCs. The ActorID is the unique identifier for the type of actor you wish to create. This is displayed in the "Actors" tab of the GE, or can be found with the ActorID script command. The ZoneName parameter lets you specify an intial zone to create the actor in. The X, Y, and Z parameters specify the position within the zone. The next two optional parameters let you set a script to run when the actor is right clicked, and when it dies. This mimics the functionality of the spawn points created in the "Zones" tab of the GE.

The final optional Instance parameter allows you to spawn the actor in any extra instance of the zone created with CreateZoneInstance.

The Spawn command also returns the handle of the created actor instance, which may be used in the same way as actor handles returned with the Actor and ContextActor commands.

Example:

                Function Main()
                        // Spawn an elf merchant
                        ID = ActorID("Elf", "Mage")
                        Ac = Spawn(ID, "Town", -65, 5, -55, "Merchant")
                        GiveItem(Ac, "Mage Staff", 1)
                        Return()
                End Function

Comments (0)

You don't have permission to comment on this page.