Ground (functions): Difference between revisions

From PMDOWiki
Imbion (talk | contribs)
No edit summary
Imbion (talk | contribs)
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
The ground functions are used for various tasks on ground maps.
{{Hat Note|More functions: [[Script Reference]]''}}


== Hide ==
The '''ground''' functions are used for various tasks on ground maps. Due to the size of the namespace, it is split into subpages based on what each function does.


Hides an entity. {{FuncUsage|nmspace=GROUND|nm=Hide|args=entityName}}
== Entity ==
{{Subpage|Ground (functions)/Entity}}
Generic status changes for entities and characters, under the general umbrella of entities. Also includes ground map spawners.
{{:Ground (functions)/Entity/Table}}


=== Arguments ===
== Entity Turning ==
{| class="wikitable"
{{Subpage|Ground (functions)/Entity Turning}}
{{ArgHeader}}
Functions for entities turning and/or facing directions, primarily for characters.
{{ArgRow
{{:Ground (functions)/Entity Turning/Table}}
|name=entityName
|type=String
|techt=System.String
|purp=The name of the entity to hide.
}}
|}


== Unhide ==
== Entity Movement ==
Unhides an entity. {{FuncUsage|nmspace=GROUND|nm=Unhide|args=entityName}}
{{Subpage|Ground (functions)/Entity Movement}}
Functions for entities moving, primarily for characters.
{{:Ground (functions)/Entity Movement/Table}}


== Entity Animation ==
{{Subpage|Ground (functions)/Entity Animation}}
Functions for the animation of entities, primarily for characters. Includes emotes.
{{:Ground (functions)/Entity Animation/Table}}


=== Arguments ===
== Screen Effects ==
{| class="wikitable"
{{Subpage|Ground (functions)/Screen Effects}}
{{ArgHeader}}
Functions for effects that impact the screen, including screen moving.
{{ArgRow
{{:Ground (functions)/Screen Effects/Table}}
|name=entityName
|type=String
|techt=System.String
|purp=The name of the entity to unhide.
}}
|}


== CreateObject ==
== Leveling ==
{{Subpage|Ground (functions)/Leveling}}
Functions that impact the level of teams and/or characters.
{{:Ground (functions)/Leveling/Table}}


== Map Status ==
{{Subpage|Ground (functions)/Map Status}}
Functions that change the map status.
{{:Ground (functions)/Map Status/Table}}


TODO: WIP. {{FuncUsage|nmspace=GROUND|nm=CreateObject|args=objType, instName, x, y, w, h}}
{{Category:Scripting}}
 
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=objType
|type=(undocumented)
|techt=(undocumented)
|purp=The type of object to create.
}}
{{ArgRow
|name=instName
|type=(undocumented)
|techt=(undocumented)
|purp=The name to create the object with.
}}
{{ArgRow
|name=x
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
{{ArgRow
|name=y
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
{{ArgRow
|name=w
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
{{ArgRow
|name=h
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
|}
 
 
== CreateCharacter ==
 
TODO: WIP. {{FuncUsage|nmspace=GROUND|nm=|args=charType, instName, x, y, actionFunc, thinkFunc}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=objType
|type=(undocumented)
|techt=(undocumented)
|purp=The type of character to create.
}}
{{ArgRow
|name=instName
|type=(undocumented)
|techt=(undocumented)
|purp=The name to create the character with.
}}
{{ArgRow
|name=x
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
{{ArgRow
|name=y
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
{{ArgRow
|name=actionFunc
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
{{ArgRow
|name=thinkFunc
|type=(undocumented)
|techt=(undocumented)
|purp=(undocumented)
}}
|}
 
== RemoveObject ==
 
Deletes an object from the ground map, identified by its instance name. {{FuncUsage|nmspace=GROUND|nm=RemoveObject|args=instName}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=instName
|type=String
|techt=System.String
|purp=The instance name of the object.
}}
|}
 
=== Returns ===
 
Returns true if succeeded, false otherwise.
 
== RemoveCharacter ==
 
Deletes a character from the ground map, identified by its instance name. {{FuncUsage|nmspace=GROUND|nm=RemoveCharacter|args=instName}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=instName
|type=String
|techt=System.String
|purp=The instance name of the character.
}}
|}
 
=== Returns ===
 
Returns true if succeeded, false otherwise.
 
== CreateCharacterFromCharData ==
 
Creates a ground character, given a dungeon character. {{FuncUsage|nmspace=GROUND|nm=CreateCharacterFromCharData|args=instName, dunCh, x, y, dir}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=instName
|type=String
|techt=System.String
|purp=The instance name to give the character
}}
{{ArgRow
|name=dunCh
|type=Dungeon Character
|techt=RogueEssence.Dungeon.Character
|purp=Character data to create from
}}
{{ArgRow
|name=x
|type=Integer
|techt=System.Int32
|purp=X coordinate of the character
}}
{{ArgRow
|name=y
|type=Integer
|techt=System.Int32
|purp=Y coordinate of the character
}}
{{ArgRow
|name=dir
|type=
|techt=
|purp=Direction the character will face, defaults to Dir8.Down
}}
|}
 
== 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. {{FuncUsage|nmspace=GROUND|nm=SetPlayer|args=charData}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=charData
|type=Character Data
|techt=RogueEssence.Dungeon.CharData
|purp=The new character data to use for the player
}}
|}
 
== SpawnerDoSpawn ==
 
Make the specified spawner run its spawn method. {{FuncUsage|nmspace=GROUND|nm=SpawnerDoSpawn|args=spawner}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=spawner
|type=String
|techt=System.String
|purp=The name of the spawner to run the spawn method of.
}}
|}
 
=== Returns ===
 
The ground character spawned.
 
== SpawnerSetSpawn ==
 
Sets the character to the specified spawner. {{FuncUsage|nmspace=GROUND|nm=SpawnerSetSpawn|args=spawner, chara}}
 
=== Arguments ===
{| class="wikitable"
{{ArgHeader}}
{{ArgRow
|name=spawner
|type=
|techt=
|purp=The spawner to set the character to, by name
}}
{{ArgRow
|name=chara
|type=Character Data
|techt=RogueEssence.Dungeon.CharData
|purp=The character to spawn.
}}
|}
 
== GROUND:CharTurnToChar(RogueEssence.Ground.GroundChar,RogueEssence.Ground.GroundChar) ==
 
 
Makes a character turn to face another character instantly.
 
 
=== Arguments ===
 
* <code>turnchar</code>: The character that is turning.
* <code>turnto</code>: The character to turn to.
 
== GROUND:CharTurnToCharAnimated ==
 
 
Makes a character do an animated turn to face another character over the specified time.
Clockwise or counter-clockwise are chosen based on the closest direction.
Waits until the operation is completed.
 
 
=== Arguments ===
 
* <code>curch</code>: Character that is turning
* <code>turnto</code>: Character to turn to
* <code>framedur</code>: Time spent on each direction, in frames
 
=== Example ===
 
<pre>
 
CharTurnToCharAnimated(charFrom, charTo, 3)
 
</pre>
 
== GROUND:EntTurn(RogueEssence.Ground.GroundEntity,RogueElements.Dir8) ==
 
 
Makes a ground entity turn to face a direction.
 
 
=== Arguments ===
 
* <code>ent</code>: The ground entity.  Can be a character or object.
* <code>direction</code>: The direction to face.
 
== GROUND:CharAnimateTurn ==
 
 
Makes a character do an animated turn to face a chosen direction over the specified time.
Must specify clockwise or counter-clockwise.
Waits until the operation is completed.
 
 
=== Arguments ===
 
* <code>ch</code>: The character to turn
* <code>direction</code>: The direction to turn to
* <code>framedur</code>: The time spent in each intermediate direction, in frames
* <code>ccw</code>: false if clockwise, true if counter-clockwise
 
=== Example ===
 
<pre>
 
GROUND:CharTurnToCharAnimated(charFrom, Dir8.Left, 3, true)
 
</pre>
 
== GROUND:CharAnimateTurnTo ==
 
 
Makes a character do an animated turn to face a chosen direction over the specified time.
Waits until the operation is completed.
 
 
=== Arguments ===
 
* <code>ch</code>: The character to turn
* <code>direction</code>: The direction to turn to
* <code>framedur</code>: The time spent in each intermediate direction, in frames
 
=== Example ===
 
<pre>
 
CharAnimateTurnTo(charFrom, Dir8.Left, 3)
 
</pre>
 
== GROUND:TeleportTo(RogueEssence.Ground.GroundEntity,System.Int32,System.Int32,RogueElements.Dir8,System.Int32) ==
 
 
Repositions the ground entity in a specified location.
 
 
=== Arguments ===
 
* <code>ent</code>: The ground entity to reposition
* <code>x</code>: The X coordinate of the destination
* <code>y</code>: The Y coordinate of the destination
* <code>direction</code>: The direction to point the entity.  Defaults to Dir8.None, which leaves it untouched.
* <code>height</code>: None
 
== GROUND:MoveInDirection ==
 
 
Make ground character move in a direction.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to move
* <code>direction</code>: Direction to move in
* <code>duration</code>: Duration of movement, in frames
* <code>run</code>: True if using a running animation, false otherwise
* <code>speed</code>: Speed in pixels per frame
 
=== Example ===
 
<pre>
 
GROUND:MoveInDirection(player, Dir8.Down, 24, false, 2)
 
</pre>
 
== GROUND:MoveToPosition ==
 
 
Make ground character move to a position.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to move
* <code>x</code>: X coordinate of destination
* <code>y</code>: Y  coordinate of destination
* <code>run</code>: True if using a running animation, false otherwise
* <code>speed</code>: Speed in pixels per frame
 
=== Example ===
 
<pre>
 
GROUND:MoveInDirection(player, 200, 240, false, 2)
 
</pre>
 
== GROUND:MoveToMarker ==
 
 
Make ground character move to a ground marker.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to move
* <code>mark</code>: GroundMarker object ot move to
* <code>run</code>: True if using a running animation, false otherwise
* <code>speed</code>: Speed in pixels per frame
 
=== Example ===
 
<pre>
 
GROUND:MoveInDirection(player, marker, false, 2)
 
</pre>
 
== GROUND:MoveObjectToPosition ==
 
 
Make ground object move to a position.
 
 
=== Arguments ===
 
* <code>ent</code>: Ground Entity to move
* <code>x</code>: X coordinate of destination
* <code>y</code>: Y  coordinate of destination
* <code>speed</code>: Speed in pixels per frame
 
=== Example ===
 
<pre>
 
GROUND:MoveInDirection(player, 200, 240, 2)
 
</pre>
 
== GROUND:AnimateInDirection ==
 
 
Make a ground character move in a direction with custom animation
 
 
=== Arguments ===
 
* <code>chara</code>: Character to move
* <code>anim</code>: Name of the animation
* <code>animDir</code>: Direction of animation
* <code>direction</code>: Direction to move in
* <code>duration</code>: Duration of movement, in frames
* <code>animSpeed</code>: Speed of animation, where 1.0 represents normal speed
* <code>speed</code>: Speed movement, in pixels per frame
 
=== Example ===
 
<pre>
 
GROUND:AnimateInDirection(player, "Hurt", Dir8.Down, 24, 0.5, 2)
 
</pre>
 
== GROUND:AnimateToPosition ==
 
 
Make a ground entity move to a position with custom animation
 
 
=== Arguments ===
 
* <code>ent</code>: Entity to move
* <code>anim</code>: Name of the animation
* <code>animDir</code>: Direction of animation
* <code>x</code>: X coordinate of the destination
* <code>y</code>: Y coordinate of the destination
* <code>animSpeed</code>: Speed of animation, where 1.0 represents normal speed
* <code>speed</code>: Speed movement, in pixels per frame
* <code>height</code>: Height of the destination
 
=== Example ===
 
<pre>
 
GROUND:AnimateToPosition(player, "Hurt", Dir8.Down, 200, 240, 0.5, 2, 0)
 
</pre>
 
== GROUND:CharSetEmote(RogueEssence.Ground.GroundChar,System.String,System.Int32) ==
 
 
Make a character emote on the ground map.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to emote
* <code>emoteid</code>: ID of the emote
* <code>cycles</code>: The number of times to play the emote.
 
== GROUND:CharSetDrawEffect(RogueEssence.Ground.GroundChar,RogueEssence.Dungeon.DrawEffect) ==
 
 
Sets the ground character's draw effect to become invisible, shaking, still, etc.
 
 
=== Arguments ===
 
* <code>chara</code>: Target ground character.
* <code>effect</code>: The draw effect.
 
== GROUND:CharEndDrawEffect(RogueEssence.Ground.GroundChar,RogueEssence.Dungeon.DrawEffect) ==
 
 
Sets the ground character's draw effect to become invisible, shaking, still, etc.
 
 
=== Arguments ===
 
* <code>chara</code>: Target ground character.
* <code>effect</code>: The draw effect.
 
== GROUND:CharGetAnimFallback(RogueEssence.Ground.GroundChar,System.String) ==
 
 
Gets the fallback animation for the character.
 
 
=== Arguments ===
 
* <code>chara</code>: None
* <code>anim</code>: The anim to get the fallback anim of.
 
=== Returns ===
 
The fallback animation, as a string.  Blank if there is none.  Will return anim if anim already exists.
 
== GROUND:CharGetAnim(RogueEssence.Ground.GroundChar) ==
 
 
Gets a character's current animation as a string.
 
 
=== Arguments ===
 
* <code>chara</code>: None
 
== GROUND:CharGetAnimPoint(RogueEssence.Ground.GroundChar,RogueEssence.Content.ActionPointType) ==
 
 
Gets the chosen action point of the character at this specific frame.
 
 
=== Arguments ===
 
* <code>chara</code>: None
* <code>actionPoint</code>: The ype of action point to retrieve the coordinates for.
 
=== Returns ===
 
The location of the action point in absolute coordinates on the map.
 
== GROUND:CharSetAnim(RogueEssence.Ground.GroundChar,System.String,System.Boolean) ==
 
 
Set a character's animation.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to animate
* <code>anim</code>: Name of the animation
* <code>loop</code>: Whether to loop the animation
 
== GROUND:CharEndAnim(RogueEssence.Ground.GroundChar) ==
 
 
Stops a character's current animation, reverting them to default idle.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to stop animating
 
== GROUND:CharWaitAnim ==
 
 
Makes the character perform an animation and waits until it's over.
 
 
=== Arguments ===
 
* <code>ent</code>: Character to animate
* <code>anim</code>: Animation to play
 
=== Example ===
 
<pre>
 
GROUND:CharWaitAnim(player, "Hurt")
 
</pre>
 
== GROUND:CharSetAction(RogueEssence.Ground.GroundChar,RogueEssence.Ground.GroundAction) ==
 
 
Set a character's action.
 
 
=== Arguments ===
 
* <code>chara</code>: Character to perfom the action
* <code>action</code>: The action to perform
 
== GROUND:CharWaitAction ==
 
 
Makes the character perform an action and waits until it's over.
 
 
=== Arguments ===
 
* <code>ent</code>: Character to animate
* <code>action</code>: Action to perform
 
=== Example ===
 
<pre>
 
GROUND:CharWaitAction(player, action)
 
</pre>
 
== GROUND:ObjectSetAnim(RogueEssence.Ground.GroundObject,System.Int32,System.Int32,System.Int32,RogueElements.Dir8,System.Int32) ==
 
 
Sets a ground object's animation.  After it finishes, it will return to the default animation.
 
 
=== Arguments ===
 
* <code>obj</code>: The object to animate
* <code>frameTime</code>: The duration of each frame of animation
* <code>startFrame</code>: The start frame of animation
* <code>endFrame</code>: The end frame of animation
* <code>dir</code>: The direction of the animation
* <code>cycles</code>: The number of times to repeat the animation
 
== GROUND:ObjectSetDefaultAnim(RogueEssence.Ground.GroundObject,System.String,System.Int32,System.Int32,System.Int32,RogueElements.Dir8) ==
 
 
Sets a ground object's default animation.
 
 
=== Arguments ===
 
* <code>obj</code>: The object to animate
* <code>animName</code>: The name of the animation
* <code>frameTime</code>: The duration of each frame of animation
* <code>startFrame</code>: The start frame of animation
* <code>endFrame</code>: The end frame of animation
* <code>dir</code>: The direction of the animation
 
== GROUND:ObjectWaitAnimFrame ==
 
 
Waits for the object to reach a specific frame before continuing.
 
 
=== Arguments ===
 
* <code>obj</code>: The object ot wait on
* <code>frame</code>: The frame of animation to wait on.
 
=== Example ===
 
<pre>
 
GROUND:WaitObjectAnim(fountain, 3)
 
</pre>
 
== GROUND:PlayVFX(RogueEssence.Content.FiniteEmitter,System.Int32,System.Int32,RogueElements.Dir8) ==
 
 
Plays a VFX using a finite emitter that generates BaseAnims.
 
 
=== Arguments ===
 
* <code>emitter</code>: The VFX emitter
* <code>x</code>: X position
* <code>y</code>: Y Position
* <code>dir</code>: Direction to orient the VFX, defaults to Down
 
== GROUND:PlayVFX(RogueEssence.Content.FiniteEmitter,System.Int32,System.Int32,RogueElements.Dir8,System.Int32,System.Int32) ==
 
 
Plays a VFX that has a start position and an end position.  It uses a finite emitter that generates BaseAnims.
 
 
=== Arguments ===
 
* <code>emitter</code>: The VFX emitter
* <code>x</code>: Start X position
* <code>y</code>: Start Y Position
* <code>dir</code>: Direction to orient the VFX, defaults to Down.
* <code>xTo</code>: End X position
* <code>yTo</code>: End Y position
 
== GROUND:PlayVFXAnim(RogueEssence.Content.BaseAnim,RogueEssence.Content.DrawLayer) ==
 
 
Plays a VFX using just a BaseAnim
 
 
=== Arguments ===
 
* <code>anim</code>: The animation to play
* <code>layer</code>: The layer to put it on
 
== GROUND:MoveScreen(RogueEssence.Content.ScreenMover) ==
 
 
Plays a screen-moving effect.
 
 
=== Arguments ===
 
* <code>mover</code>: The screen mover.
 
== GROUND:HandoutEXP ==
 
 
Gives a character a set amount of EXP.
Also handles leveling up and learning new moves.
 
 
=== Arguments ===
 
* <code>character</code>: The characters to level up.
* <code>experience</code>: The amount of EXP to gain.
 
== GROUND:LevelUpChar ==
 
 
Levels up a character a certain amount of times all at once.
Also handles learning new moves.
 
 
=== Arguments ===
 
* <code>character</code>: The characters to level up.
* <code>numLevelUps</code>: The number of level ups.
 
== GROUND:AddMapStatus(System.String) ==
 
 
Adds a mapstatus to the ground map.  Map statuses only have an aesthetic effect in ground maps.
 
 
=== Arguments ===
 
* <code>statusIdx</code>: The ID of the Map Status
 
== GROUND:RemoveMapStatus(System.String) ==
 
 
Removes a map status from the ground map.
 
 
=== Arguments ===
 
* <code>statusIdx</code>: The ID of the Map Status to remove.

Latest revision as of 20:43, 17 January 2026

More functions: Script Reference

The ground functions are used for various tasks on ground maps. Due to the size of the namespace, it is split into subpages based on what each function does.

Entity

Generic status changes for entities and characters, under the general umbrella of entities. Also includes ground map spawners.

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

Functions for entities turning and/or facing directions, primarily for characters.

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

Functions for entities moving, primarily for characters.

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

Functions for the animation of entities, primarily for characters. Includes emotes.

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

Functions for effects that impact the screen, including screen moving.

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

Functions that impact the level of teams and/or characters.

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

Functions that change the 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.

Tutorials and reference for modding cutscenes and dialogue in PMDO