Game (functions): Difference between revisions
Created page with "{{Cleanup}} == GAME:GroundSave == Saves the game while in ground mode. === Example === <pre> GAME:GroundSave() </pre> == GAME:GetModDiff(System.String) == TODO === Arguments === * <code>uuidStr</code>: None == GAME:GetCurrentGround == Gets the current ground map. == GAME:GetCurrentFloor == Gets the current dungeon map. == GAME:GetCurrentDungeon == Gets the current zone, also known as dungeon. == GAME:EnterGroundMap(System.Int32,System.Int32,Syst..." |
No edit summary |
||
| Line 1: | Line 1: | ||
{{Hat Note|More functions: [[Script Reference]]''}} | |||
{{Cleanup}} | {{Cleanup}} | ||
== GAME:GroundSave == | == GAME:GroundSave == | ||
Revision as of 20:12, 17 January 2026
GAME:GroundSave
Saves the game while in ground mode.
Example
GAME:GroundSave()
GAME:GetModDiff(System.String)
TODO
Arguments
uuidStr: None
GAME:GetCurrentGround
Gets the current ground map.
GAME:GetCurrentFloor
Gets the current dungeon map.
GAME:GetCurrentDungeon
Gets the current zone, also known as dungeon.
GAME:EnterGroundMap(System.Int32,System.Int32,System.Boolean)
Leave current map, and enter specified ground map within the current zone
Arguments
id: The index of the ground map in the zoneidxentrypoint: The index of the entry point in the ground mappreserveMusic: If set to true, does not change the music when moving to the new ground map.
GAME:EnterGroundMap(System.String,System.String,System.Boolean)
Leave current map, and enter specified ground map within the current zone
Arguments
name: The name of the ground map. It must exist within in the zone.entrypoint: The name of the entry point in the ground mappreserveMusic: If set to true, does not change the music when moving to the new ground map.
GAME:EnterGroundMap(System.String,System.String,System.String,System.Boolean)
Leave current map, and enter specified ground map within a new zone.
Arguments
zone: The name of the destination zone.name: The name of the ground map. It must exist within in the zone.entrypoint: The name of the entry point in the ground mappreserveMusic: If set to true, does not change the music when moving to the new ground map.
GAME:EnterDungeon
Enters a zone and begins a new adventure.
Arguments
dungeonid: The id of the dungeon to travel to.structureid: The segment within the dungeon to start in. -1 represents ground maps.mapid: The id of the ground map or dungeon map within the dungeon segment.entry: The entry point on the resulting mapstakes: Decides what happens when the adventure fails/succeeds.recorded: Record the adventure in a replaysilentRestrict: Make the dungeon restrictions silently
Example
GAME:EnterDungeon(1, 0, 0, 0, RogueEssence.Data.GameProgress.DungeonStakes.Risk, true, false)
GAME:ContinueDungeon
Enters a zone and continues the current adventure.
Arguments
dungeonid: The id of the dungeon to travel to.structureid: The segment within the dungeon to start in. -1 represents ground maps.mapid: The id of the ground map or dungeon map within the dungeon segment.entry: The entry point on the resulting map
Example
GAME:ContinueDungeon(1, 1, 0, 0)
GAME:EndDungeonRun
Ends the current adventure, sending the player to a specified destination.
Arguments
result: The result of the adventure.destzoneid: The id of the dungeon to travel to.structureid: The segment within the dungeon to start in. -1 represents ground maps.mapid: The id of the ground map or dungeon map within the dungeon segment.entryid: The entry point on the resulting mapdisplay: Display an epitaph marking the end of the adventure.fanfare: Play a fanfare.completedZone: Zone to mark as completed. Defaults to current zone.
Example
GAME:EndDungeonRun(GameProgress.ResultType.Cleared, 0, -1, 1, 0, true, true)
GAME:EnterRescue
Enters a zone and begins a rescue adventure.
Arguments
sosPath: The path of the sos mail.
Example
GAME:EnterRescue("RESCUE/INBOX/SOS/example.sosmail")
GAME:AddAOKRemark(System.Int32)
TODO: WIP
Arguments
remarkIndex: None
GAME:RestartToTitle
Leave current map and load up the title screen.
GAME:RestartRogue(RogueEssence.Data.RogueConfig)
Restarts a Roguelocke run based on the configuration
Arguments
config: The configuration of the roguelocke run
GAME:EnterZone(System.String,System.Int32,System.Int32,System.Int32)
Enters a zone and begins a new adventure.
Arguments
dungeonid: The id of the dungeon to travel to.structureid: The segment within the dungeon to start in. -1 represents ground maps.mapid: The id of the ground map or dungeon map within the dungeon segment.entry: The entry point on the resulting map
GAME:FadeOut
Fade out the screen. Waits to complete before continuing.
Arguments
white: Fade to white if set to true. Fades to black otherwise.duration: The amount of time to fade in frames.
Example
GAME:FadeOut(false, 60)
GAME:FadeIn
Fade into the screen. Waits to complete before continuing.
Arguments
duration: The amount of time to fade in frames.
Example
GAME:FadeIn(60)
GAME:MoveCamera
Centers the camera on a position.
Arguments
x: X coordinate of the camera centery: Y coordinate of the camera centerduration: The amount of time it takes ot move to the destinationtoPlayer: Destination is in absolute coordinates if false, and relative to the player character if set to true.
Example
GAME:MoveCamera(200, 240, 60, false)
GAME:MoveCameraToChara
Centers the camera on a character.
As we are simply moving the camera to a character, this will simply set ViewCenter and not ViewOffset.
Arguments
x: X coordinate of the camera center, as an offset for the charay: Y coordinate of the camera center, as an offset for the charaduration: The amount of time it takes ot move to the destinationchara: The character to center on.
Example
GAME:MoveCameraToChara(200, 240, 60, false)
GAME:GetCameraCenter
Gets the current center of the camera.
Returns
A Loc object representing the center of the camera.
GAME:IsCameraOnChar
Determines whether the camera is centered relative to the player.
Returns
Returns true if the camera is relative to the player, false otherwise.
GAME:HasSOSMail
TODO
GAME:HasAOKMail
TODO
GAME:GetTeamLeaderIndex
Returns the index of the currently player controlled entity in the party.
Returns
Index of the currently player controlled entity in the party.
GAME:SetTeamLeaderIndex(System.Int32)
Sets the leader to the chosen index within the party.
Arguments
idx: The index of the team member within the team.
GAME:SetCanSwitch(System.Boolean)
Prevents or allows the switching of leaders for the save file.
Arguments
canSwitch: Set to true to allow switching, set to false to prevent it.
GAME:SetCanRecruit(System.Boolean)
Prevents or allows the joining of recruits for the save file.
Arguments
canRecruit: Set to true to allow recruit joins, set to false to prevent it.
GAME:GetPlayerPartyCount
Returns the player party count. Does not include guests.
Returns
The count of players
GAME:GetPlayerPartyTable
Return the party as a LuaTable. Does not include guests.
Returns
A Lua Table of Characters
GAME:GetPlayerPartyMember(System.Int32)
Gets the character at the specified index within the player's team.
Arguments
index: The specified index
Returns
The team member retrieved.
GAME:GetPlayerGuestCount
Gets the number of guests currently in the player's party.
Returns
The number of guests
GAME:GetPlayerGuestTable
Return the guests as a LuaTable
Returns
A Lua Table of Characters
GAME:GetPlayerGuestMember(System.Int32)
Gets the character at the specified index within the player's guests.
Arguments
index: The specified index
Returns
The team member retrieved.
GAME:GetPlayerAssemblyCount
Gets the number of characters currently in the player's assembly.
Returns
The number of characters
GAME:GetPlayerAssemblyTable
Return the assembly as a LuaTable
Returns
A Lua Table of Characters
GAME:GetPlayerAssemblyMember(System.Int32)
Gets the character at the specified index within the player's assembly.
Arguments
index: The specified index
Returns
The assembly member retrieved.
GAME:AddPlayerTeam(RogueEssence.Dungeon.Character)
Adds a character to the player's team.
Arguments
character: The character to add.
GAME:RemovePlayerTeam(System.Int32)
Removes the character from the team, placing its item back in the inventory.
Arguments
slot: The slot of the player to remove.
GAME:AddPlayerGuest(RogueEssence.Dungeon.Character)
Adds a character to the player's guests.
Arguments
character: The character to add.
GAME:RemovePlayerGuest(System.Int32)
Removes the character from the team's guests, placing its item back in the inventory.
Arguments
slot: The slot of the player to remove.
GAME:AddPlayerAssembly(RogueEssence.Dungeon.Character)
Adds a character to the player's assembly.
Arguments
character: The character to add.
GAME:RemovePlayerAssembly(System.Int32)
Removes the character from the assembly, placing its item back in the inventory.
Arguments
slot: The slot of the player to remove.
GAME:SetCharacterNickname(RogueEssence.Dungeon.Character,System.String)
Sets a character's nickname
Arguments
character: The character to renamenickname: The new name
GAME:GetCharacterNickname(RogueEssence.Dungeon.Character)
Gets the character nickname
Arguments
character: The character to get the nickname from
Returns
The character's nickname
GAME:SetTeamName(System.String)
Sets the name of the player's team
Arguments
teamname: The new team name
GAME:GetTeamName
Gets the name of the player's team
Returns
The team's name
GAME:CanRelearn(RogueEssence.Dungeon.Character)
Checks if the character can relearn any skills.
Arguments
character: The character to check
GAME:CanForget(RogueEssence.Dungeon.Character)
Checks if the character can forget any skills.
Arguments
character: The character to check
GAME:CanLearn(RogueEssence.Dungeon.Character)
Checks if the character can learn any skills.
Arguments
character: The character to check
GAME:CheckLevelSkills
Checks the levels gained by a character and prompts to learn all skills along the levels. Waits until all skills have been accepted or declined before continuing.
Arguments
chara: The character to prompt for learning.oldLevel: The level that the character leveled up from.
Example
GAME:CheckLevelSkills(player, 5)
GAME:TryLearnSkill
Attempts to give a new skill to the specified character, prompting to replace an old one if they are full. Waits until all the skill has been accepted or declined before continuing.
Arguments
chara: The character to learn the skillskill: The skill to learn
Example
GAME:TryLearnSkill(player, "thunder")
GAME:LearnSkill(RogueEssence.Dungeon.Character,System.String)
Gives a new skill to a specified character. Fails if the character's skills are full.
Arguments
chara: The character to learn the skillskill: The skill to learn
GAME:ForgetSkill(RogueEssence.Dungeon.Character,System.Int32)
Removed a skill from the specified character.
Arguments
chara: The character to forget the skillslot: The slot of the skill to forget
GAME:LockSkill(RogueEssence.Dungeon.Character,System.Int32)
Makes a skill impossible to forget or replace for the specified character. Note that this only affects normal gameplay. Scripts can still freely get rid of the skill.
Arguments
chara: The character to lock the skillslot: The slot of the skill to lock
GAME:UnlockSkill(RogueEssence.Dungeon.Character,System.Int32)
Unlocks a previously locked skill for the specified character, making it possible to be forgotten or replaced during normal gameplay.
Arguments
chara: The character to unlock the skillslot: The slot of the skill to unlock
GAME:SetCharacterSkill(RogueEssence.Dungeon.Character,System.String,System.Int32,System.Boolean)
Gives a new skill to a specified character, replacing a specifically chosen slot.
Arguments
character: The character to learn the skillskillId: The skill to learnslot: The slot to replace
GAME:GetCharacterSkill(RogueEssence.Dungeon.Character,System.Int32)
Gets the skill from a specified character and specified slot.
Arguments
chara: The character to get the skill from.slot: The slot to get the skill from.
Returns
The ID of the skill in the slot
GAME:CanPromote(RogueEssence.Dungeon.Character)
Checks if the character can be promoted to a new class.
Arguments
character: The character to check
Returns
True if the character can be promoted, false otherwise.
GAME:GetAvailablePromotions(RogueEssence.Dungeon.Character,System.String)
Gets a list of possible classes that the character can prmote to.
Arguments
character: The character to checkbypassItem: An exception item that can bypass checks for promotion
Returns
A lua table of PromoteBranch objects
GAME:PromoteCharacter(RogueEssence.Dungeon.Character,RogueEssence.Data.PromoteBranch,System.String)
Promotes a character ot a new class.
Arguments
character: The character to promotebranch: The PromoteBranch to promote withbypassItem: An exception item that can bypass checks for promotion
GAME:FindPlayerItem(System.String,System.Boolean,System.Boolean)
Finds an item in the player's team and returns its slot within the inventory or among its team's equips.
Arguments
id: The item ID to search for.held: Check equipped items.inv: Check inventory items.
Returns
The InvSlot of the item. Invalid if the item could not be found.
GAME:GetPlayerEquippedCount
Get the number of items equipped by players. Does not include guests.
Returns
The number of items.
GAME:GetPlayerBagCount
Get the number of items in the bag.
Returns
The number of items.
GAME:GetPlayerBagLimit
Gets the maximum amount of item the player's team can carry.
Returns
The number of items.
GAME:GetPlayerEquippedItem(System.Int32)
Gets the equipped item for the character in the specified slot.
Arguments
slot: The team slot of the character to check
Returns
The character's equipped item
GAME:GetGuestEquippedItem(System.Int32)
Gets the equipped item for the character in the specified guest slot.
Arguments
slot: The guest slot of the character to check
Returns
The character's equipped item
GAME:GivePlayerItem(RogueEssence.Dungeon.InvItem)
Gives an item and adds it to the player team's bag.
Arguments
item: The item to give
GAME:GivePlayerItem(System.String,System.Int32,System.Boolean,System.String)
Gives an item and adds it to the player team's bag.
Arguments
id: The ID of the itemcount: The amount to give. Default 1cursed: Whether the item is cursed. Default false.hiddenval: The hidden value of the item. Default empty string.
GAME:GetPlayerBagItem(System.Int32)
Gets the item found at the specified slot of the player's bag.
Arguments
slot: The slot to check
Returns
The item found in the slot
GAME:TakePlayerBagItem(System.Int32,System.Boolean)
Remove an item from player inventory
Arguments
slot: The slot from which to remove the itemtakeAll: None
GAME:TakePlayerEquippedItem(System.Int32,System.Boolean)
Remove the equipped item from a chosen member of the team
Arguments
slot: The slot of the character on the team from which to remove the itemtakeAll: None
GAME:TakeGuestEquippedItem(System.Int32,System.Boolean)
Remove the equipped item from a chosen guest of the team
Arguments
slot: The slot of the character on the team's guest list from which to remove the itemtakeAll: None
GAME:GetPlayerStorageCount
Get the amount of items in the player's storage
GAME:GetPlayerStorageItemCount(System.String)
Get the amount of a specific item in the player's storage
Arguments
id: ID of the item ot check
Returns
The amount of copies currently in storage
GAME:GivePlayerStorageItem(RogueEssence.Dungeon.InvItem)
Gives an item and adds it to the player team's storage.
Arguments
item: The item to give
GAME:GivePlayerStorageItem(System.String,System.Int32,System.Boolean,System.String)
Gives an item and adds it to the player team's storage.
Arguments
id: The ID of the itemcount: The amount to give. Default 1cursed: Whether the item is cursed. Default false.hiddenval: The hidden value of the item. Default empty string.
GAME:TakePlayerStorageItem(System.String)
Takes an item from the storage
Arguments
id: The ID of the item to take
GAME:DepositAll
Takes all items in the player team's bag and equipped items, and deposits them in storage.
GAME:GetPlayerMoney
Gets the amount of money the player currently has on hand.
Returns
The amount of money.
GAME:AddToPlayerMoney(System.Int32)
Adds money to the player's wallet.
Arguments
toadd: The amount of money to add.
GAME:RemoveFromPlayerMoney(System.Int32)
Removes money from the player's wallet.
Arguments
toremove: The amount of money to remove.
GAME:GetPlayerMoneyBank
Gets the amount of money in the player's bank
Returns
The amount of money.
GAME:AddToPlayerMoneyBank(System.Int32)
Adds money to the player's bank.
Arguments
toadd: The amount of money to add.
GAME:RemoveFromPlayerMoneyBank(System.Int32)
Removes money from the player's bank.
Arguments
toremove: The amount of money to remove.
GAME:IsKeyDown(System.Int32)
Checks if a player is making a certain physical keyboard input.
Arguments
keyid: The ID of the input
Returns
True if the button is currently pressed. False otherwise.
GAME:IsInputDown(System.Int32)
Checks if a player is making a certain game input.
Arguments
inputid: None
Returns
True if the input is currently pressed. False otherwise.
GAME:CutsceneMode(System.Boolean)
Sets the game in cutscene mode. This prevents characters from taking idle action and hides certain UI.
Arguments
bon: If set to true, turns cutscene mode on. If set to false, turns it off.
GAME:GetDailySeed
Gets the random seed for the current adventure.
Returns
The current adventure's seed.
GAME:UnlockDungeon(System.String)
Unlocks a specified dungeon.
Arguments
dungeonid: ID of the dungeon to unlock.
GAME:DungeonUnlocked(System.String)
Checks if a dungeon is unlocked.
Arguments
dungeonid: ID of the dungeon to check
Returns
True if unlocked, false otherwise.
GAME:InRogueMode
Checks if the current game is in rogue mode.
Returns
True if in rogue mode, false otherwise.
GAME:HasServerSet
TODO: WIP
GAME:GetRescueAllowed
Checks to see if rescue is allowed.
Returns
True if rescues are allowed, false otherwise.
GAME:SetRescueAllowed(System.Boolean)
Sets the value in the player's save file to determine if they can be rescued or not. If rescue is possible on the Save File level, it can still be prevented by the map.
Arguments
allowed: Set to true to allow the player to be rescued. False otherwise.
GAME:QueueLeaderEvent(System.Object)
Prepares an event to execute on the next frame.
Arguments
obj: None
GAME:WaitFrames
Waits for a specified number of frames before continuing.
Arguments
frames: The number of frames ot wait. Each frame is 1/60th of a second.
Example
GAME:WaitFrames(60)
GAME:VectorToDirection(RogueElements.Loc)
Turns a vector (preferably a unit vector) into a cardinal or diagonal direction.
Arguments
v: The vector.
Returns
The direction as one of 8 values.
GAME:VectorToDirection(System.Double,System.Double)
Convenience function to get a vector's components from lua numbers(doubles)
Arguments
X: The X value of the vectorY: The Y value of the vector
Returns
The direction the vector points to as one of 8 values.
GAME:RandomDirection
Generates a random direction.
Returns
An 8-directional direction.
GAME:SetupLuaFunctions(RogueEssence.Script.LuaEngine)
Setups any extra functionalities for this object written on the lua side.
