Get your own free workspace
View
 

ActorIDFromInstance

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

 

ActorIDFromInstance

Usage:

                ActorIDFromInstance(Actor)

Description:

The ActorIDFromInstance command returns an ID number representing a particular race/class actor combination. These IDs are set when an actor is created in the main editor, and do not change. These IDs can then be used with other scripting commands, such as WaitKill and Spawn.

The difference between this command and ActorID is that instead of specifying the race and class for the actor ID to be returned, you specify an existing actor instance (e.g. a player or NPC), and the ID of the actor it is based on will be returned.

Example:

                Function Main()
                        Player = Actor()

                        // Turn the player into a wolf
                        OldID = ActorIDFromInstance(Player)
                        ID = ActorID("Wolf", "Critter")
                        ChangeActor(Player, ID)

                        // Wait 10 seconds
                        DoEvents(10000)

                        // Turn him back into whatever he was before
                        ChangeActor(Player, OldID)

                        Return()
                End Function

Comments (0)

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