Ground (functions)/Movement

From PMDOWiki
More functions: Script Reference

This page documents the ScriptGround class for Lua scripting.

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

CharTurnToChar

GROUND:CharTurnToChar(turnchar, turnto)

Makes a character turn to face another character instantly.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character that is turning.
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character to turn to.


CharTurnToCharAnimated

GROUND:CharTurnToCharAnimated(curch, turnto, framedur)

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.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar Character that is turning
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar Character to turn to
System.Int32 System.Int32 Time spent on each direction, in frames

Returns

Type Description
NLua.LuaFunction


CharAnimateTurn

GROUND:CharAnimateTurn(ch, direction, framedur, ccw)

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.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character to turn
RogueElements.Dir8 RogueElements.Dir8 The direction to turn to
System.Int32 System.Int32 The time spent in each intermediate direction, in frames
System.Boolean System.Boolean false if clockwise, true if counter-clockwise

Returns

Type Description
NLua.LuaFunction


CharAnimateTurnTo

GROUND:CharAnimateTurnTo(ch, direction, framedur)

Makes a character do an animated turn to face a chosen direction over the specified time.
Waits until the operation is completed.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar The character to turn
RogueElements.Dir8 RogueElements.Dir8 The direction to turn to
System.Int32 System.Int32 The time spent in each intermediate direction, in frames

Returns

Type Description
NLua.LuaFunction


EntTurn

GROUND:EntTurn(ent, direction)

Makes a ground entity turn to face a direction.
Useful for non-character objects.

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity The ground entity. Can be a character or object.
RogueElements.Dir8 RogueElements.Dir8 The direction to face.


TeleportTo

GROUND:TeleportTo(ent, x, y, direction, height)

Repositions the ground entity in a specified location.

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity The ground entity to reposition
System.Int32 System.Int32 The X coordinate of the destination
System.Int32 System.Int32 The Y coordinate of the destination
RogueElements.Dir8 RogueElements.Dir8 The direction to point the entity. Defaults to Dir8.None, which leaves it untouched.
System.Int32 System.Int32


MoveInDirection

GROUND:MoveInDirection(chara, direction, duration, run, speed)

Make ground character move in a direction.

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar Character to move
RogueElements.Dir8 RogueElements.Dir8 Direction to move in
System.Int32 System.Int32 Duration of movement, in frames
System.Boolean System.Boolean True if using a running animation, false otherwise
System.Single System.Single Speed in pixels per frame

Returns

Type Description
NLua.LuaFunction


MoveToPosition

GROUND:MoveToPosition(chara, x, y, run, speed)

Make ground character move to a position.

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity Character to move
System.Int32 System.Int32 X coordinate of destination
System.Int32 System.Int32 Y coordinate of destination
System.Boolean System.Boolean True if using a running animation, false otherwise
System.Single System.Single Speed in pixels per frame

Returns

Type Description
NLua.LuaFunction


MoveToMarker

GROUND:MoveToMarker(chara, mark, run, speed)

Make ground character move to a ground marker.

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity Character to move
RogueEssence.Ground.GroundMarker RogueEssence.Ground.GroundMarker GroundMarker object ot move to
System.Boolean System.Boolean True if using a running animation, false otherwise
System.Single System.Single Speed in pixels per frame

Returns

Type Description
NLua.LuaFunction


MoveObjectToPosition

GROUND:MoveObjectToPosition(ent, x, y, speed)

Make ground object move to a position.

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity Ground Entity to move
System.Int32 System.Int32 X coordinate of destination
System.Int32 System.Int32 Y coordinate of destination
System.Int32 System.Int32 Speed in pixels per frame

Returns

Type Description
NLua.LuaFunction


AnimateInDirection

GROUND:AnimateInDirection(chara, anim, animDir, direction, duration, animSpeed, speed)

Make a ground character move in a direction with custom animation

Parameters

Name Type Description
RogueEssence.Ground.GroundChar RogueEssence.Ground.GroundChar Character to move
System.String System.String Name of the animation
RogueElements.Dir8 RogueElements.Dir8 Direction of animation
RogueElements.Dir8 RogueElements.Dir8 Direction to move in
System.Int32 System.Int32 Duration of movement, in frames
System.Single System.Single Speed of animation, where 1.0 represents normal speed
System.Single System.Single Speed movement, in pixels per frame

Returns

Type Description
NLua.LuaFunction


AnimateToPosition

GROUND:AnimateToPosition(ent, anim, animDir, x, y, animSpeed, speed, height)

Make a ground entity move to a position with custom animation

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity Entity to move
System.String System.String Name of the animation
RogueElements.Dir8 RogueElements.Dir8 Direction of animation
System.Int32 System.Int32 X coordinate of the destination
System.Int32 System.Int32 Y coordinate of the destination
System.Single System.Single Speed of animation, where 1.0 represents normal speed
System.Single System.Single Speed movement, in pixels per frame
System.Int32 System.Int32 Height of the destination

Returns

Type Description
NLua.LuaFunction


ActionToPosition

GROUND:ActionToPosition(ent, baseAction, x, y, animSpeed, speed, height)

Make a ground entity action to a position with custom animation

Parameters

Name Type Description
RogueEssence.Ground.GroundEntity RogueEssence.Ground.GroundEntity Entity to move
RogueEssence.Ground.GroundAction RogueEssence.Ground.GroundAction Action for the entity to perform
System.Int32 System.Int32 X coordinate of the destination
System.Int32 System.Int32 Y coordinate of the destination
System.Single System.Single Speed of animation, where 1.0 represents normal speed
System.Single System.Single Speed movement, in pixels per frame
System.Int32 System.Int32 Height of the destination

Returns

Type Description
NLua.LuaFunction


References

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