Lua Function Reference: Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
Imbion (talk | contribs)
Line 55: Line 55:
! Function !! Description  
! Function !! Description  
|-
|-
| GAME:GetModDiff ||?  
| GetModDiff ||?  
|-
|-
| GAME:RestartToTitle||Leave the current map and load the title screen.  
| RestartToTitle||Leave the current map and load the title screen.  
|-
|-
| GAME:RestartRogue ||Restarts a [[roguelocke]] run based on the configuration.
| RestartRogue ||Restarts a [[roguelocke]] run based on the configuration.
|-
|-
|}
|}
Line 67: Line 67:
! Function !! Description
! Function !! Description
|-
|-
| GAME:GetCurrentGround || Returns the current ground map.
| GetCurrentGround || Returns the current ground map.
|-
|-
| GAME:GetCurrentFloor||Returns the current dungeon map.
| GetCurrentFloor||Returns the current dungeon map.
|-
|-
| GAME:GetCurrentDungeon || Returns the current zone (aka dungeon).
| GetCurrentDungeon || Returns the current zone (aka dungeon).
|-
|-
| GAME:EnterGroundMap || Enter the specified ground map.
| EnterGroundMap || Enter the specified ground map.
|-
|-
| GAME:EnterDungeon ||  Enter the specified dungeon.
| EnterDungeon ||  Enter the specified dungeon.
|-
|-
| GAME:ContinueDungeon || Enter the zone and continue the current ongoing adventure.
| ContinueDungeon || Enter the zone and continue the current ongoing adventure.
|-
|-
| GAME:EndDungeonRun|| Enter the zone and continue the current ongoing adventure.
| EndDungeonRun|| Enter the zone and continue the current ongoing adventure.
|-
|-
| GAME:EnterZone|| Enter the zone and begin an adventure.
| EnterZone|| Enter the zone and begin an adventure.
|-
|-
|}
|}
Line 90: Line 90:
! Function !! Description  
! Function !! Description  
|-
|-
| GAME:EnterRescue|| Enter a zone and begin a rescue.
| EnterRescue|| Enter a zone and begin a rescue.
|-
|-
| GAME:AddAOKRemark|| ?
| AddAOKRemark|| ?
|-
|-
| GAME:HasSOSMail|| ?
| HasSOSMail|| ?
|-
|-
| GAME:HasAOKMail|| ?
| HasAOKMail|| ?
|-
|-
|}
|}
Line 105: Line 105:
! Function !! Description
! Function !! Description
|-
|-
| GAME:FadeOut || Fades screen out, waits to finish.
| FadeOut || Fades screen out, waits to finish.
|-
|-
| GAME:FadeIn || Fades screen in, waits to finish.
| FadeIn || Fades screen in, waits to finish.
|-
|-
| GAME:MoveCamera || Moves the camera.
| MoveCamera || Moves the camera.
|-
|-
| GAME:MoveCameraToChara || Moves the camera to the specified character.
| MoveCameraToChara || Moves the camera to the specified character.
|-
|-
| GAME:GetCameraCenter ||  Returns the current center of the camera.
| GetCameraCenter ||  Returns the current center of the camera.
|-
|-
| GAME:IsCameraOnChar || Returns true if the camera is centered relative to the player, false if not.
| IsCameraOnChar || Returns true if the camera is centered relative to the player, false if not.
|-
|-
|}
|}
Line 124: Line 124:
! Function !! Description
! Function !! Description
|-
|-
| GAME:GetTeamLeaderIndex|| Returns the index of the currently player controlled entity in the party.
| GetTeamLeaderIndex|| Returns the index of the currently player controlled entity in the party.
|-
|-
| GAME:SetTeamLeaderIndex|| Sets the leader to the chosen index in the party.
| SetTeamLeaderIndex|| Sets the leader to the chosen index in the party.
|-
|-
| GAME:SetCanSwitch|| Configure the ability to switch leaders in the save file.
| SetCanSwitch|| Configure the ability to switch leaders in the save file.
|-
|-
| GAME:SetCanRecruit|| Configure the ability to recruit in the save file.
| SetCanRecruit|| Configure the ability to recruit in the save file.
|-
|-
|}
|}
Line 139: Line 139:
|-
|-
|-
|-
| GAME:GetPlayerPartyCount||Returns the player's party count.
| GetPlayerPartyCount||Returns the player's party count.
|-
|-
| GAME:GetPlayerPartyTable||Returns the player's party as a lua table, excluding guests.
| GetPlayerPartyTable||Returns the player's party as a lua table, excluding guests.
|-
|-
| GAME:GetPlayerPartyMember||Returns the party member at the specified team index.
| GetPlayerPartyMember||Returns the party member at the specified team index.
|-
|-
| GAME:AddPlayerTeam||Adds the given character to the player's team.
| AddPlayerTeam||Adds the given character to the player's team.
|-
|-
| GAME:RemovePlayerTeam||Removes the character from the given slot from the team.
| RemovePlayerTeam||Removes the character from the given slot from the team.
|-
|-
|}
|}
Line 156: Line 156:
! Function !! Description
! Function !! Description
|-
|-
| GAME:GetPlayerAssemblyCount||Returns the amount of characters currently in the player's assembly.
| GetPlayerAssemblyCount||Returns the amount of characters currently in the player's assembly.
|-
|-
| GAME:GetPlayerAssemblyTable||Returns the player's assembly as a lua table.
| GetPlayerAssemblyTable||Returns the player's assembly as a lua table.
|-
|-
| GAME:GetPlayerAssemblyMember||Gets the character at the specified index from the assembly.
| GetPlayerAssemblyMember||Gets the character at the specified index from the assembly.
|-
|-
| GAME:AddPlayerAssembly||Adds the given character to the player's assembly.
| AddPlayerAssembly||Adds the given character to the player's assembly.
|-
|-
| GAME:RemovePlayerAssembly||Removes the character from the given slot from the assembly.
| RemovePlayerAssembly||Removes the character from the given slot from the assembly.
|}
|}


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


Line 195: Line 195:
=== Direction ===
=== Direction ===
{{Sectstub}}
{{Sectstub}}
== Ground ==
== Ground ==
{{main|Ground (functions)}}
{{main|Ground (functions)}}

Revision as of 20:25, 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)
This section is a stub. You can help PMDO Wiki by expanding it.

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.