AI (functions)

From PMDOWiki
More functions: Script Reference

This page documents the ScriptAI class for Lua scripting.

As a singleton class, it can be accessed from Lua with AI.

SetCharacterAI

AI:SetCharacterAI(ch, classpath, args)

Assign the given scripted AI class to the specified GroundChar.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character to apply the AI to.
System.String System.String The Scripted AI to apply.
System.Object[] System.Object[]


DisableCharacterAI

AI:DisableCharacterAI(ch)

Disable a given groundchar's AI processing until its enabled again.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character to disable the AI of.


EnableCharacterAI

AI:EnableCharacterAI(ch)

Enable a given groundchar's AI processing if its currently disabled.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character to enable the AI of.


SetAIState

AI:SetAIState(ch, state)

Force the AI to change to the specified state if it exists

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character of which to force the AI state.
System.String System.String The state to force the AI to.


SetupLuaFunctions

AI:SetupLuaFunctions(state)

Initializes any LuaFunctions found in the class.
Automatically on lua initialization.

Parameters

Name Type Description
RogueEssence.Script.LuaEngine RogueEssence.Script.LuaEngine The lua engine to initialize with.


References

https://github.com/RogueCollab/RogueEssence/blob/master/RogueEssence/Lua/ScriptAI.cs