Lua Function Reference: Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
Imbion (talk | contribs)
Line 198: Line 198:
== Ground ==
== Ground ==
{{main|Ground (functions)}}
{{main|Ground (functions)}}
{{Sectstub}}
 
=== Entity ===
{{main|Ground (functions)/Entity}}
{{:Ground (functions)/Entity/Table}}
 
=== Entity Turning ===
{{main|Ground (functions)/Entity Turning}}
{{:Ground (functions)/Entity Turning/Table}}
 
=== Entity Movement ===
{{main|Ground (functions)/Entity Movement}}
{{:Ground (functions)/Entity Movement/Table}}
 
=== Entity Animation ===
{{main|Ground (functions)/Entity Animation}}
{{:Ground (functions)/Entity Animation/Table}}
 
=== Screen Effects ===
{{main|Ground (functions)/Screen Effects}}
{{:Ground (functions)/Screen Effects/Table}}
 
=== Leveling ===
{{main|Ground (functions)/Leveling}}
{{:Ground (functions)/Leveling/Table}}
 
=== Map Status ===
{{main|Ground (functions)/Map Status}}
{{:Ground (functions)/Map Status/Table}}
 
== Sound ==
== Sound ==
{{main|Sound (functions)}}
{{main|Sound (functions)}}

Revision as of 20:38, 17 January 2026

This article is in need of cleanup to increase its quality. You can help PMDO Wiki by improving it.

This is a reference page of all the functions that can be called in Lua and their namespaces. See the main page for each namespace for further details.

AI

Main article: AI (functions)
Function Description
SetCharacterAI Gives the ground character the assigned AI.
DisableCharacterAI Disables the AI processing of the ground character.
EnableCharacterAI Enables the AI processing of the ground character, if it has been disabled by DisableCharacterAI.
SetAIState ???

Dungeon

Main article: Dungeon (functions)
Function Description
CharTurnToChar Makes a character turn to face another.
LastDungeonResult Gets the result of the last dungeon adventure.
DungeonCurrentFloor Returns the floor number of the current dungeon.
DungeonAssetName Returns the internal name for the current dungeon.
DungeonDisplayName Returns the localized name of the current dungeon.
CharSetEmote Set a character's emote in a dungeon map.
CharStartAnim Set a character's animation.
CharEndAnim Stops a character's current animation, reverting them to default idle.
PlayVFX Plays a VFX in the dungeon map
PlayVFX Plays a VFX that has a start position and an end position. It uses a finite emitter that generates BaseAnims.
MoveScreen Plays a screen-moving effect.

Game

Main article: Game (functions)

Game Control

Function Description
GetModDiff ?
RestartToTitle Leave the current map and load the title screen.
RestartRogue Restarts a roguelocke run based on the configuration.

Map and Adventure Control

Function Description
GetCurrentGround Returns the current ground map.
GetCurrentFloor Returns the current dungeon map.
GetCurrentDungeon Returns the current zone (aka dungeon).
EnterGroundMap Enter the specified ground map.
EnterDungeon Enter the specified dungeon.
ContinueDungeon Enter the zone and continue the current ongoing adventure.
EndDungeonRun Enter the zone and continue the current ongoing adventure.
EnterZone Enter the zone and begin an adventure.

Rescue Management

Function Description
EnterRescue Enter a zone and begin a rescue.
AddAOKRemark ?
HasSOSMail ?
HasAOKMail ?

Camera & Scene Control

Function Description
FadeOut Fades screen out, waits to finish.
FadeIn Fades screen in, waits to finish.
MoveCamera Moves the camera.
MoveCameraToChara Moves the camera to the specified character.
GetCameraCenter Returns the current center of the camera.
IsCameraOnChar Returns true if the camera is centered relative to the player, false if not.

Team Management

Function Description
GetTeamLeaderIndex Returns the index of the currently player controlled entity in the party.
SetTeamLeaderIndex Sets the leader to the chosen index in the party.
SetCanSwitch Configure the ability to switch leaders in the save file.
SetCanRecruit Configure the ability to recruit in the save file.

Party Management

Function Description
GetPlayerPartyCount Returns the player's party count.
GetPlayerPartyTable Returns the player's party as a lua table, excluding guests.
GetPlayerPartyMember Returns the party member at the specified team index.
AddPlayerTeam Adds the given character to the player's team.
RemovePlayerTeam Removes the character from the given slot from the team.

Assembly Management

Function Description
GetPlayerAssemblyCount Returns the amount of characters currently in the player's assembly.
GetPlayerAssemblyTable Returns the player's assembly as a lua table.
GetPlayerAssemblyMember Gets the character at the specified index from the assembly.
AddPlayerAssembly Adds the given character to the player's assembly.
RemovePlayerAssembly Removes the character from the given slot from the assembly.

Guest Management

Function Description
GetPlayerGuestCount Returns the amount of guests currently in the player's party.
GetPlayerGuestTable Returns the player's party guests as a lua table.
GetPlayerGuestMember Gets the character at the specified index from the guests.
AddPlayerGuest Adds the given character to the player's guest list.
RemovePlayerGuest Removes the character from the given slot from the guest list.

Character Control

This section is a stub. You can help PMDO Wiki by expanding it.

Bag, Equips, & Storage

This section is a stub. You can help PMDO Wiki by expanding it.

Money

This section is a stub. You can help PMDO Wiki by expanding it.

Inputs

This section is a stub. You can help PMDO Wiki by expanding it.

Dungeons

This section is a stub. You can help PMDO Wiki by expanding it.

Direction

This section is a stub. You can help PMDO Wiki by expanding it.


Ground

Main article: Ground (functions)

Entity

Function Description
Hide Hides an entity.
Unhide Unhides an entity.
CreateObject (undocumented)
CreateCharacter (undocumented)
RemoveObject Deletes an object from the ground map, identified by its instance name.
RemoveCharacter Deletes a character from the ground map, identified by its instance name.
CreateCharacterFromCharData Creates a ground character, given a dungeon character.
RefreshPlayer Reloads the controllable player's character data to be the current team's leader.
SetPlayer Sets the controllable player to use new character data.
SpawnerDoSpawn Make the specified spawner run its spawn method.
SpawnerSetSpawn Sets the character to the specified spawner.

Entity Turning

Function Description
CharTurnToChar Makes a character turn to face another character instantly.
CharTurnToCharAnimated Makes a character do an animated turn to face another character over the specified time.
EntTurn Makes a ground entity turn to face a direction.
CharAnimateTurn Makes a character do an animated turn to face a chosen direction over the specified time.
CharAnimateTurnTo Makes a character do an animated turn to face a chosen direction over the specified time.

Entity Movement

Function Description
TeleportTo Repositions the ground entity in a specified location.
MoveInDirection Make ground character move in a direction.
MoveToPostition Make ground character move to a position.
MoveToMarker Make ground character move to a ground marker.
MoveObjectToPosition Make ground object move to a position.
AnimateInDirection Make a ground character move in a direction with custom animation
AnimateToPosition Make a ground entity move to a position with custom animation

Entity Animation

Function Description
CharSetEmote Make a character emote on the ground map.
CharSetDrawEffect Sets the ground character's draw effect to become invisible, shaking, still, etc.
CharEndDrawEffect Ends the character's draw effect.
CharGetAnimFallback Gets the fallback animation for the character.
CharGetAnim Gets a character's current animation as a string.
CharGetAnimPoint Gets the chosen action point of the character at this specific frame.
CharSetAnim Set a character's animation.
CharEndAnim Stops a character's current animation, reverting them to default idle.
CharWaitAnim Makes the character perform an animation and waits until it's over.
CharSetAction Set a character's action.
CharWaitAction Makes the character perform an action and waits until it's over.
ObjectSectAnim Sets a ground object's animation. After it finishes, it will return to the default animation.
ObjectSetDefaultAnim Sets a ground object's default animation.
ObjectWaitAnimFrame Waits for the object to reach a specific frame before continuing.

Screen Effects

Function Description
PlayVFX Plays a VFX using a finite emitter that generates BaseAnims.
PlayVFX Plays a VFX that has a start position and an end position. It uses a finite emitter that generates BaseAnims.
PlayVFXAnim Plays a VFX using just a BaseAnim
MoveScreen Plays a screen-moving effect.

Leveling

Function Description
HandoutEXP Gives a character a set amount of EXP. Also handles leveling up and learning new moves.
LevelUpChar Levels up a character a certain amount of times all at once. Also handles learning new moves.

Map Status

Function Description
AddMapStatuses Adds a mapstatus to the ground map. Map statuses only have an aesthetic effect in ground maps.
RemoveMapStatuses Removes a map status from the ground map.

Sound

Main article: Sound (functions)
This section is a stub. You can help PMDO Wiki by expanding it.

Strings

Main article: Strings (functions)
This section is a stub. You can help PMDO Wiki by expanding it.

Task

Main article: Task (functions)
This section is a stub. You can help PMDO Wiki by expanding it.

UI

Main article: UI (functions)
This section is a stub. You can help PMDO Wiki by expanding it.